diff --git a/ansible/playbooks/bootstrap.yaml b/ansible/playbooks/bootstrap.yaml index 07ac4c974eae85082de0096e6f76dda484c2c067..63115ac45830b9adca0884881077303725b3e698 100644 --- a/ansible/playbooks/bootstrap.yaml +++ b/ansible/playbooks/bootstrap.yaml @@ -32,7 +32,7 @@ - name: Bootstrap the cluster ansible.builtin.shell: | - helm upgrade --install --dependency-update --create-namespace -n infra-ops hepto /tmp/hepto-bootstrap \ + helm upgrade --install --dependency-update --create-namespace -n infra-bootstrap hepto /tmp/hepto-bootstrap \ -f /tmp/cluster_info \ -f /tmp/node_info environment: diff --git a/helm/Chart.lock b/helm/Chart.lock index 4a1d0f32a0da6f22255dcc3f978a3df11e042836..ac72d23dfdfa8b7b67f6eff6604f6f1b10f4a42d 100644 --- a/helm/Chart.lock +++ b/helm/Chart.lock @@ -2,5 +2,11 @@ dependencies: - name: tigera-operator repository: https://docs.tigera.io/calico/charts version: v3.26.3 -digest: sha256:54a9520b60cb22afd9e54349deafba0783bc392d992a109ee72a36bebd52ccc6 -generated: "2023-11-11T10:08:04.803047813+01:00" +- name: flux2 + repository: https://fluxcd-community.github.io/helm-charts + version: 2.12.2 +- name: argo-cd + repository: https://argoproj.github.io/argo-helm + version: 6.0.5 +digest: sha256:3019db6e6b31150b3502402b5370c82577a7770afbd0941e68bf3b4b5cc0fa2f +generated: "2024-02-14T15:53:16.803857047+01:00" diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 5845ffb43d2fa35af6356c79b2ce76dd44c1adea..82c3282d0b1a81307af048660d927ba4d53d4e7e 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -14,8 +14,8 @@ dependencies: - name: flux2 version: "2.12.2" repository: "https://fluxcd-community.github.io/helm-charts" - condition: gitops.type == "fluxcd" + condition: gitops.fluxcd.enabled - name: argo-cd version: "6.0.5" repository: "https://argoproj.github.io/argo-helm" - condition: gitops.type == "argocd" + condition: gitops.argocd.enabled diff --git a/helm/templates/argocd.yaml b/helm/templates/argocd.yaml new file mode 100644 index 0000000000000000000000000000000000000000..739e120f52fa7236e405c83dc063cb420f0ccf16 --- /dev/null +++ b/helm/templates/argocd.yaml @@ -0,0 +1,18 @@ +{{- if .Capabilities.APIVersions.Has "argoproj.io/v1alpha1/Application" }} +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: {{ .Values.gitops.name }} + namespace: {{ .Values.gitops.namespace }} +spec: + project: default + source: + repoURL: {{ .Values.gitops.repo }} + targetRevision: {{ .Values.gitops.branch }} + path: {{ .Values.gitops.path }} + destination: + server: https://kubernetes.default.svc + namespace: {{ .Values.gitops.namespace }} + syncPolicy: + automated: {} +{{- end }} diff --git a/helm/templates/flux.yaml b/helm/templates/flux.yaml index 53b18784beded144727effa397c3c3130cb95f0b..f90b05e3dd97751e61717935bc166a14cade7c86 100644 --- a/helm/templates/flux.yaml +++ b/helm/templates/flux.yaml @@ -1,39 +1,39 @@ -{{- if .Values.flux.enabled }} +{{- if .Capabilities.APIVersions.Has "kustomize.toolkit.fluxcd.io/v1/Kustomization" }} --- apiVersion: source.toolkit.fluxcd.io/v1 kind: GitRepository metadata: - name: {{ .Values.flux.name }} - namespace: {{ .Values.flux.namespace }} + name: {{ .Values.gitops.name }} + namespace: {{ .Values.gitops.namespace }} spec: interval: 10m ref: - branch: {{ .Values.flux.source.branch }} - url: {{ .Values.flux.source.url }} + branch: {{ .Values.gitops.branch }} + url: {{ .Values.gitops.repo }} --- apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: {{ .Values.flux.name }} - namespace: {{ .Values.flux.namespace }} + name: {{ .Values.gitops.name }} + namespace: {{ .Values.gitops.namespace }} spec: interval: 60m - path: ./ + path: {{ .Values.gitops.path }} prune: true sourceRef: kind: GitRepository - name: {{ .Values.flux.name }} + name: {{ .Values.gitops.name }} validation: client decryption: provider: sops secretRef: - name: {{ .Values.flux.name }} + name: {{ .Values.gitops.name }} --- apiVersion: v1 kind: Secret metadata: - name: {{ .Values.flux.name }} - namespace: {{ .Values.flux.namespace }} + name: {{ .Values.gitops.name }} + namespace: {{ .Values.gitops.namespace }} stringData: - age.agekey: {{ .Values.flux.age }} + age.agekey: {{ .Values.gitops.age }} {{- end }} diff --git a/helm/values.yaml b/helm/values.yaml index 61561a61375b0fd79ba6a4de735adc36f417d3c7..d92f850388f4fab1302e18026033643d594498ba 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -47,19 +47,26 @@ coredns: # Gitops configuration gitops: - enabled: false - type: argocd + fluxcd: + enabled: false + argocd: + enabled: false name: cluster - namespace: infra-gitops + namespace: infra-bootstrap + repo: https://path.to.git.repo + branch: main age: agesecretkey - source: - url: https://path.to.git.repo - branch: main -cli.image: registry.ipv6.docker.com/fluxcd/flux-cli -helmController.image: registry.ipv6.docker.com/fluxcd/helm-controller -imageAutomationController.image: registry.ipv6.docker.com/fluxcd/image-automation-controller -imageReflectionController.image: registry.ipv6.docker.com/fluxcd/image-reflection-controller -kustomizeController.image: registry.ipv6.docker.com/fluxcd/kustomize-controller -notificationController.image: registry.ipv6.docker.com/fluxcd/notification-controller -sourceController.image: registry.ipv6.docker.com/fluxcd/source-controller - +flux2: + cli: {image: registry.ipv6.docker.com/fluxcd/flux-cli} + helmController: {image: registry.ipv6.docker.com/fluxcd/helm-controller} + imageAutomationController: {image: registry.ipv6.docker.com/fluxcd/image-automation-controller} + imageReflectionController: {image: registry.ipv6.docker.com/fluxcd/image-reflection-controller} + kustomizeController: {image: registry.ipv6.docker.com/fluxcd/kustomize-controller} + notificationController: {image: registry.ipv6.docker.com/fluxcd/notification-controller} + sourceController: {image: registry.ipv6.docker.com/fluxcd/source-controller} +argo-cd: + dex: {image: {repository: registry.ipv6.docker.com/dexidp/dex}} + redis: {image: {repository: registry.ipv6.docker.com/library/redis}} + configs: + params: + application.namespaces: "*"