Skip to content

Commit

Permalink
Add Document Auto-Generation (#12)
Browse files Browse the repository at this point in the history
Keeps docs in-sync with versions, at the expense of having to deal with
templates, but it's better than messing about with the alternatives.
  • Loading branch information
spjmurray authored Jul 18, 2024
1 parent 9f75951 commit 4aa9c4b
Show file tree
Hide file tree
Showing 9 changed files with 445 additions and 55 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
name: Pull Request
on:
pull_request:
branches:
- '*'
tags-ignore:
- '*'
types:
- opened
- synchronize
- reopened
- ready_for_review
env:
GO_VERSION: 1.22.5
jobs:
helm-template:
name: 'Test Helm Template'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Install Helm
uses: azure/setup-helm@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate Documentation
run: make docs
- name: Generated Code Checked In
run: '[[ -z $(git status --porcelain) ]]'
- name: Run Test
run: make test
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,8 @@ test:
helm lint --strict charts/$${chart}; \
helm template charts/$${chart} > /dev/null; \
done

.PHONY: docs
docs:
@go install github.com/unikorn-cloud/core/hack/docs-generate@main
docs-generate
66 changes: 15 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<!-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT -->

# Helm Charts to Deploy Cluster API

## Why?
Expand All @@ -14,49 +16,7 @@ When we encounter one of the annoying environment variables, we replace it with

This chart requires the following to be installed on the target cluster first:

### Cert-Manager

<details>
<summary>Helm</summary>

```shell
helm repo add jetstack https://charts.jetstack.io
helm repo update
helm install cert-manager jetstack/cert-manager --version v1.15.1 --namespace cert-manager --create-namespace --set crds.enabled=true
```
</details>

<details>
<summary>ArgoCD</summary>

```yaml
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
generateName: cert-manager-
namespace: argocd
spec:
project: default
source:
chart: cert-manager
repoURL: https://charts.jetstack.io
targetRevision: v1.15.1
helm:
releaseName: cert-manager
parameters:
- name: installCRDs
value: "true"
destination:
server: https://kubernetes.default.svc
namespace: cert-manager
syncPolicy:
automated:
selfHeal: true
syncOptions:
- CreateNamespace=true
```
</details>
* [Jetstack cert-manager](https://cert-manager.io/)

## Deploying One-Shot

Expand All @@ -68,7 +28,7 @@ There is a top level chart-of-charts that will just install everything as a big
```shell
helm repo add unikorn-cloud-capi https://unikorn-cloud.github.io/helm-cluster-api
helm repo update
helm install cluster-api unikorn-cloud-capi/cluster-api --version v0.2.0
helm upgrade --install cluster-api unikorn-cloud-capi/cluster-api -n cluster-api --create-namespace --version v0.2.0
```
</details>

Expand All @@ -90,7 +50,7 @@ spec:
targetRevision: v0.2.0
destination:
server: https://kubernetes.default.svc
namespace: foo
namespace: cluster-api
ignoreDifferences:
# Aggregated roles are mangically updated by the API.
- group: rbac.authorization.k8s.io
Expand All @@ -113,6 +73,7 @@ spec:
selfHeal: true
syncOptions:
- RespectIgnoreDifferences=true
- CreateNamespace=true
```
</details>
Expand All @@ -128,7 +89,7 @@ You may want to be a little less gung-ho and deploy the pieces as separate appli
```shell
helm repo add unikorn-cloud-capi https://unikorn-cloud.github.io/helm-cluster-api
helm repo update
helm install cluster-api-core unikorn-cloud-capi/cluster-api-core --version v0.2.0
helm upgrade --install cluster-api-core unikorn-cloud-capi/cluster-api-core -n cluster-api --create-namespace --version v0.2.0
```
</details>

Expand All @@ -150,7 +111,7 @@ spec:
targetRevision: v0.2.0
destination:
server: https://kubernetes.default.svc
namespace: foo
namespace: cluster-api
ignoreDifferences:
# Aggregated roles are mangically updated by the API.
- group: rbac.authorization.k8s.io
Expand All @@ -168,6 +129,7 @@ spec:
selfHeal: true
syncOptions:
- RespectIgnoreDifferences=true
- CreateNamespace=true
```
</details>
Expand All @@ -179,7 +141,7 @@ spec:
```shell
helm repo add unikorn-cloud-capi https://unikorn-cloud.github.io/helm-cluster-api
helm repo update
helm install cluster-api-bootstrap-kubeadm unikorn-cloud-capi/cluster-api-bootstrap-kubeadm --version v0.2.0
helm upgrade --install cluster-api-bootstrap-kubeadm unikorn-cloud-capi/cluster-api-bootstrap-kubeadm -n cluster-api --create-namespace --version v0.2.0
```
</details>

Expand All @@ -201,7 +163,7 @@ spec:
targetRevision: v0.2.0
destination:
server: https://kubernetes.default.svc
namespace: foo
namespace: cluster-api
ignoreDifferences:
- group: apiextensions.k8s.io
jsonPointers:
Expand All @@ -212,6 +174,7 @@ spec:
selfHeal: true
syncOptions:
- RespectIgnoreDifferences=true
- CreateNamespace=true
```
</details>
Expand All @@ -223,7 +186,7 @@ spec:
```shell
helm repo add unikorn-cloud-capi https://unikorn-cloud.github.io/helm-cluster-api
helm repo update
helm install cluster-api-control-plane-kubeadm unikorn-cloud-capi/cluster-api-control-plane-kubeadm --version v0.2.0
helm upgrade --install cluster-api-control-plane-kubeadm unikorn-cloud-capi/cluster-api-control-plane-kubeadm -n cluster-api --create-namespace --version v0.2.0
```
</details>

Expand All @@ -245,7 +208,7 @@ spec:
targetRevision: v0.2.0
destination:
server: https://kubernetes.default.svc
namespace: foo
namespace: cluster-api
ignoreDifferences:
- group: rbac.authorization.k8s.io
jsonPointers:
Expand All @@ -261,6 +224,7 @@ spec:
selfHeal: true
syncOptions:
- RespectIgnoreDifferences=true
- CreateNamespace=true
```
</details>
Expand Down
Loading

0 comments on commit 4aa9c4b

Please sign in to comment.