From 0095d9a166792cba9bd4978b32d2245f00c259aa Mon Sep 17 00:00:00 2001 From: Khue Doan Date: Sun, 22 Aug 2021 17:40:38 +0700 Subject: [PATCH] Try new ArgoCD pattern --- system/argocd/applicationsets.yaml | 23 +++++++++++++++++++++++ system/argocd/ingress.yaml | 19 +++++++++++++++++++ system/argocd/kustomization.yaml | 11 +++++++++++ system/argocd/namespace.yaml | 4 ++++ system/argocd/system-applicationset.yaml | 21 +++++++++++++++++++++ system/ingress-nginx/Chart.yaml | 7 +++++++ system/ingress-nginx/values.yaml | 0 system/longhorn-system/Chart.yaml | 7 +++++++ system/longhorn-system/values.yaml | 0 system/metallb-system/Chart.yaml | 7 +++++++ system/metallb-system/values.yaml | 7 +++++++ 11 files changed, 106 insertions(+) create mode 100644 system/argocd/applicationsets.yaml create mode 100644 system/argocd/ingress.yaml create mode 100644 system/argocd/kustomization.yaml create mode 100644 system/argocd/namespace.yaml create mode 100644 system/argocd/system-applicationset.yaml create mode 100644 system/ingress-nginx/Chart.yaml create mode 100644 system/ingress-nginx/values.yaml create mode 100644 system/longhorn-system/Chart.yaml create mode 100644 system/longhorn-system/values.yaml create mode 100644 system/metallb-system/Chart.yaml create mode 100644 system/metallb-system/values.yaml diff --git a/system/argocd/applicationsets.yaml b/system/argocd/applicationsets.yaml new file mode 100644 index 00000000..585c31ca --- /dev/null +++ b/system/argocd/applicationsets.yaml @@ -0,0 +1,23 @@ +apiVersion: argoproj.io/v1alpha1 +kind: ApplicationSet +metadata: + name: system-applicationset +spec: + generators: + - git: + repoURL: https://github.com/khuedoan/homelab.git + revision: master + directories: + - path: examples/git-generator-directory/cluster-addons/* + template: + metadata: + name: '{{path.basename}}' + spec: + project: default + source: + repoURL: https://github.com/argoproj-labs/applicationset.git + targetRevision: HEAD + path: '{{path}}' + destination: + server: https://kubernetes.default.svc + namespace: '{{path.basename}}' diff --git a/system/argocd/ingress.yaml b/system/argocd/ingress.yaml new file mode 100644 index 00000000..2607ad42 --- /dev/null +++ b/system/argocd/ingress.yaml @@ -0,0 +1,19 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: argocd-server + labels: + nginx.ingress.kubernetes.io/force-ssl-redirect: "true" + nginx.ingress.kubernetes.io/ssl-passthrough: "true" +spec: + rules: + - host: argocd.khuedoan.com + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: argocd-server + port: + number: 80 diff --git a/system/argocd/kustomization.yaml b/system/argocd/kustomization.yaml new file mode 100644 index 00000000..fdd54842 --- /dev/null +++ b/system/argocd/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: +- namespace.yaml +- https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml +- https://raw.githubusercontent.com/argoproj-labs/applicationset/stable/manifests/install.yaml +- ingress.yaml +- system-applicationset.yaml + +namespace: argocd diff --git a/system/argocd/namespace.yaml b/system/argocd/namespace.yaml new file mode 100644 index 00000000..a040f2ba --- /dev/null +++ b/system/argocd/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: argocd diff --git a/system/argocd/system-applicationset.yaml b/system/argocd/system-applicationset.yaml new file mode 100644 index 00000000..aed2961e --- /dev/null +++ b/system/argocd/system-applicationset.yaml @@ -0,0 +1,21 @@ +apiVersion: argoproj.io/v1alpha1 +kind: ApplicationSet +metadata: + name: system +spec: + generators: + - git: + repoURL: https://github.com/khuedoan/homelab.git + revision: master + directories: + - path: system/* + template: + metadata: + name: '{{path.basename}}' + spec: + destination: + server: in-cluster + namespace: '{{path.basename}}' + project: system + source: + path: '{{path}}' diff --git a/system/ingress-nginx/Chart.yaml b/system/ingress-nginx/Chart.yaml new file mode 100644 index 00000000..2f85da66 --- /dev/null +++ b/system/ingress-nginx/Chart.yaml @@ -0,0 +1,7 @@ +apiVersion: v2 +name: ingress-nginx +version: 3.35.0 +dependencies: +- name: ingress-nginx + version: 3.35.0 + repository: https://kubernetes.github.io/ingress-nginx diff --git a/system/ingress-nginx/values.yaml b/system/ingress-nginx/values.yaml new file mode 100644 index 00000000..e69de29b diff --git a/system/longhorn-system/Chart.yaml b/system/longhorn-system/Chart.yaml new file mode 100644 index 00000000..387345f7 --- /dev/null +++ b/system/longhorn-system/Chart.yaml @@ -0,0 +1,7 @@ +apiVersion: v2 +name: longhorn +version: 1.1.2 +dependencies: +- name: longhorn + version: 1.1.2 + repository: https://charts.longhorn.io diff --git a/system/longhorn-system/values.yaml b/system/longhorn-system/values.yaml new file mode 100644 index 00000000..e69de29b diff --git a/system/metallb-system/Chart.yaml b/system/metallb-system/Chart.yaml new file mode 100644 index 00000000..3882cf42 --- /dev/null +++ b/system/metallb-system/Chart.yaml @@ -0,0 +1,7 @@ +apiVersion: v2 +name: metallb +version: 0.10.2 +dependencies: +- name: metallb + version: 0.10.2 + repository: https://metallb.github.io/metallb diff --git a/system/metallb-system/values.yaml b/system/metallb-system/values.yaml new file mode 100644 index 00000000..8f077409 --- /dev/null +++ b/system/metallb-system/values.yaml @@ -0,0 +1,7 @@ +configInline: + address-pools: + - name: default + protocol: layer2 + addresses: + # TODO (optimize) Use metal values for MetalLB values + - 192.168.1.150-192.168.1.180