Try new ArgoCD pattern

This commit is contained in:
Khue Doan 2021-08-22 17:40:38 +07:00
parent 55b293fce7
commit 0095d9a166
11 changed files with 106 additions and 0 deletions

View File

@ -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}}'

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: argocd

View File

@ -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}}'

View File

@ -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

View File

View File

@ -0,0 +1,7 @@
apiVersion: v2
name: longhorn
version: 1.1.2
dependencies:
- name: longhorn
version: 1.1.2
repository: https://charts.longhorn.io

View File

View File

@ -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

View File

@ -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