From d9865f6da6520d0151ec30fbcd40f9fe9a5ff221 Mon Sep 17 00:00:00 2001 From: Khue Doan Date: Fri, 21 May 2021 18:11:33 +0700 Subject: [PATCH] Move all apps to ArgoCD --- apps/Makefile | 6 +++++- apps/cert-manager.yaml | 25 +++++++++++++++++++++++++ apps/longhorn.yaml | 21 +++++++++++++++++++++ apps/metallb.yaml | 28 ++++++++++++++++++++++++++++ apps/nginx.yaml | 21 +++++++++++++++++++++ apps/prometheus.yaml | 21 +++++++++++++++++++++ apps/vault.yaml | 21 +++++++++++++++++++++ 7 files changed, 142 insertions(+), 1 deletion(-) create mode 100644 apps/cert-manager.yaml create mode 100644 apps/longhorn.yaml create mode 100644 apps/metallb.yaml create mode 100644 apps/nginx.yaml create mode 100644 apps/prometheus.yaml create mode 100644 apps/vault.yaml diff --git a/apps/Makefile b/apps/Makefile index 133ab4cc..118d978b 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -1,6 +1,10 @@ .POSIX: -default: apply +default: init apply + +init: + kubectl create namespace argocd --dry-run=client -o yaml | kubectl --kubeconfig ../infra/kube_config.yaml apply -f - + kubectl --kubeconfig ../infra/kube_config.yaml apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml apply: kubectl --kubeconfig ../infra/kube_config.yaml --namespace argocd apply --filename . diff --git a/apps/cert-manager.yaml b/apps/cert-manager.yaml new file mode 100644 index 00000000..c114cc7a --- /dev/null +++ b/apps/cert-manager.yaml @@ -0,0 +1,25 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: cert-manager +spec: + destination: + name: in-cluster + namespace: cert-manager + server: '' + source: + path: '' + repoURL: 'https://charts.jetstack.io' + targetRevision: 1.3.1 + chart: cert-manager + helm: + parameters: + - name: 'installCRDs' + value: 'true' + project: default + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true diff --git a/apps/longhorn.yaml b/apps/longhorn.yaml new file mode 100644 index 00000000..7d89a59a --- /dev/null +++ b/apps/longhorn.yaml @@ -0,0 +1,21 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: longhorn +spec: + destination: + name: in-cluster + namespace: longhorn-system + server: '' + source: + path: '' + repoURL: 'https://charts.longhorn.io' + targetRevision: 1.1.0 + chart: longhorn + project: default + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true diff --git a/apps/metallb.yaml b/apps/metallb.yaml new file mode 100644 index 00000000..37d1423c --- /dev/null +++ b/apps/metallb.yaml @@ -0,0 +1,28 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: metallb +spec: + destination: + name: in-cluster + namespace: kube-system + server: '' + source: + path: '' + repoURL: 'https://charts.bitnami.com/bitnami' + targetRevision: 2.3.5 + chart: metallb + helm: + parameters: + - name: 'configInline' + value: | + address-pools: + - name: default + protocol: layer2 + addresses: + - 192.168.1.150-192.168.1.180 # TODO (optimize) Use metal values for MetalLB values + project: default + syncPolicy: + automated: + prune: true + selfHeal: true diff --git a/apps/nginx.yaml b/apps/nginx.yaml new file mode 100644 index 00000000..6cd75ecd --- /dev/null +++ b/apps/nginx.yaml @@ -0,0 +1,21 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: ingress-nginx +spec: + destination: + name: in-cluster + namespace: kube-system + server: '' + source: + path: '' + repoURL: 'https://kubernetes.github.io/ingress-nginx' + targetRevision: 3.29.0 + chart: ingress-nginx + project: default + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true diff --git a/apps/prometheus.yaml b/apps/prometheus.yaml new file mode 100644 index 00000000..b74e90e5 --- /dev/null +++ b/apps/prometheus.yaml @@ -0,0 +1,21 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: prometheus +spec: + destination: + name: in-cluster + namespace: monitoring-system + server: '' + source: + path: '' + repoURL: 'https://prometheus-community.github.io/helm-charts' + targetRevision: 15.1.1 + chart: kube-prometheus-stack + project: default + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true diff --git a/apps/vault.yaml b/apps/vault.yaml new file mode 100644 index 00000000..a99d9643 --- /dev/null +++ b/apps/vault.yaml @@ -0,0 +1,21 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: vault +spec: + destination: + name: in-cluster + namespace: vault + server: '' + source: + path: '' + repoURL: 'https://helm.releases.hashicorp.com' + targetRevision: 0.11.0 + chart: vault + project: default + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true