Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Utiliser AppSets #7

Merged
merged 2 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ spec:
targetRevision: HEAD
directory:
recurse: true
include: "{*.argoapp.yaml,*.argoapp.yml}"
include: "{*.argoapp.yaml,*.argoapp.yml}"
61 changes: 36 additions & 25 deletions common/cert-manager/cert-manager.argoapp.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,41 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
kind: ApplicationSet
metadata:
name: cert-manager
namespace: argocd
spec:
destination:
namespace: cert-manager
server: https://kubernetes.default.svc
project: default
sources:
- chart: cert-manager
helm:
valueFiles:
- $values/common/cert-manager/helm/cert-manager-values.yaml
parameters:
- name: installCRDs # Not recommended for prod installs according to: https://cert-manager.io/docs/installation/helm/
value: "true"
repoURL: https://charts.jetstack.io
targetRevision: v1.16.1
- repoURL: 'https://github.com/ClubCedille/k8s-base.git'
targetRevision: master
ref: values
- repoURL: 'https://github.com/ClubCedille/k8s-base.git'
targetRevision: master
path: common/cert-manager/issuers
syncPolicy:
automated: {}
syncOptions:
- CreateNamespace=true
goTemplate: true
goTemplateOptions: ["missingkey=error"]
generators:
- clusters: {}
template:
metadata:
name: "{{.name}}-cert-manager"
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "-70"
spec:
destination:
namespace: cert-manager
server: "{{.server}}"
project: "{{.name}}"
sources:
- chart: cert-manager
helm:
valueFiles:
- $values/common/cert-manager/helm/cert-manager-values.yaml
parameters:
- name: installCRDs # Not recommended for prod installs according to: https://cert-manager.io/docs/installation/helm/
value: "true"
repoURL: https://charts.jetstack.io
targetRevision: v1.16.1
- repoURL: 'https://github.com/ClubCedille/k8s-base.git'
targetRevision: master
ref: values
- repoURL: 'https://github.com/ClubCedille/k8s-base.git'
targetRevision: master
path: common/cert-manager/issuers
syncPolicy:
automated: {}
syncOptions:
- CreateNamespace=true
45 changes: 28 additions & 17 deletions common/contour/contour.argoapp.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
kind: ApplicationSet
metadata:
name: contour
namespace: argocd
spec:
destination:
namespace: project-contour
server: https://kubernetes.default.svc
project: default
sources:
- chart: contour
helm:
parameters:
- name: envoy.service.type
value: "LoadBalancer"
repoURL: https://charts.bitnami.com/bitnami
targetRevision: 19.3.1
syncPolicy:
automated: {}
syncOptions:
- CreateNamespace=true
goTemplate: true
goTemplateOptions: ["missingkey=error"]
generators:
- clusters: {}
template:
metadata:
name: "{{.name}}-contour"
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "-70"
spec:
destination:
namespace: project-contour
server: "{{.server}}"
project: "{{.name}}"
sources:
- chart: contour
helm:
parameters:
- name: envoy.service.type
value: "LoadBalancer"
repoURL: https://charts.bitnami.com/bitnami
targetRevision: 19.3.1
syncPolicy:
automated: {}
syncOptions:
- CreateNamespace=true
36 changes: 36 additions & 0 deletions common/external-ip/external-ip.argoapp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: external-ips
namespace: argocd
spec:
goTemplate: true
goTemplateOptions: ["missingkey=error"]
generators:
- clusters:
selector:
matchLabels:
etsmtl.club/external-network: "true"
template:
metadata:
name: '{{.name}}-external-ip'
annotations:
argocd.argoproj.io/sync-wave: "-80"
spec:
project: "{{.name}}"
source:
repoURL: https://github.com/ClubCedille/k8s-management/
targetRevision: HEAD
path: common/external-ip
destination:
server: {{.server}}
namespace: metallb-system
kustomize:
patches:
patch: |-
- op: add
path: /spec/addresses/0
value:
ip: {{ index .metadata.annotations "etsmtl.club/external-ip" }}
target:
kind: IPAddressPool
19 changes: 19 additions & 0 deletions common/external-ip/ip-reservation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: public-ip
namespace: metallb-system
spec:
addresses: []
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: public-ip
namespace: metallb-system
spec:
ipAddressPools:
- public-ip
nodeSelectors:
- matchLabels:
etsmtl.club/external-network: "true"
3 changes: 3 additions & 0 deletions common/external-ip/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resources:
- routes-daemonset.yaml
- ip-reservation.yaml
1 change: 0 additions & 1 deletion common/metallb/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ namespace: metallb-system

resources:
- https://github.com/metallb/metallb//config/native?ref=v0.14.8
- routes-daemonset.yaml

patches:
# add pod security labels to ns
Expand Down
29 changes: 19 additions & 10 deletions common/metallb/metallb.argoapp.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
kind: ApplicationSet
metadata:
name: metallb
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "-90"
spec:
project: default
destination:
server: https://kubernetes.default.svc
source:
repoURL: https://github.com/ClubCedille/k8s-base
path: common/metallb
targetRevision: HEAD
goTemplate: true
goTemplateOptions: ["missingkey=error"]
generators:
- clusters: {}
template:
metadata:
name: "{{.name}}-metallb"
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "-90"
spec:
project: "{{.name}}"
destination:
server: "{{.server}}"
source:
repoURL: https://github.com/ClubCedille/k8s-base
path: common/metallb
targetRevision: HEAD
37 changes: 23 additions & 14 deletions common/rook/rook.argoapp.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
kind: ApplicationSet
metadata:
name: rook
name: metallb
namespace: argocd
spec:
destination:
namespace: rook
server: https://kubernetes.default.svc
project: default
source:
repoURL: https://github.com/ClubCedille/k8s-base
path: common/rook/ressources
targetRevision: HEAD
syncPolicy:
automated: {}
syncOptions:
- CreateNamespace=true
goTemplate: true
goTemplateOptions: ["missingkey=error"]
generators:
- clusters: {}
template:
metadata:
name: "{{.name}}-rook"
namespace: argocd
spec:
destination:
namespace: rook
server: "{{.server}}"
project: "{{.name}}"
source:
repoURL: https://github.com/ClubCedille/k8s-base
path: common/rook/ressources
targetRevision: HEAD
syncPolicy:
automated: {}
syncOptions:
- CreateNamespace=true
Loading