Skip to content

Commit

Permalink
refactor(registry): use kustomize for templates
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsimonemms committed Nov 8, 2024
1 parent 3e6f4d9 commit b8712ed
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 7 deletions.
31 changes: 30 additions & 1 deletion registry/clusters/dev/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,37 @@ spec:
project: default
source:
repoURL: https://github.com/mrsimonemms/infrastructure
path: registry/clusters/dev
path: registry/templates/registry
targetRevision: HEAD
kustomize:
patches:
- target:
group: vault.banzaicloud.com
version: v1alpha1
kind: Vault
name: vault
patch: >
- op: replace
path: /spec/ingress/annotations/cert-manager.io/cluster-issuer
value: letsencrypt-staging
- target:
group: vault.banzaicloud.com
version: v1alpha1
kind: Vault
name: vault
patch: >
- op: replace
path: /spec/ingress/spec/rules/0/host
value: vault.dev.simonemms.com
- target:
group: vault.banzaicloud.com
version: v1alpha1
kind: Vault
name: vault
patch: >
- op: replace
path: /spec/ingress/spec/tls/0/hosts
value: vault.dev.simonemms.com
destination:
server: https://kubernetes.default.svc
namespace: argocd
Expand Down
7 changes: 6 additions & 1 deletion registry/clusters/prod/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ spec:
project: default
source:
repoURL: https://github.com/mrsimonemms/infrastructure
path: registry/clusters/prod
path: registry/templates/registry
targetRevision: HEAD
kustomize:
patches:
- target:
patch: >
-
destination:
server: https://kubernetes.default.svc
namespace: argocd
Expand Down
2 changes: 1 addition & 1 deletion registry/templates/registry/cert-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
project: default
source:
repoURL: https://github.com/mrsimonemms/infrastructure
path: registry/clusters/dev/components/cert-manager
path: registry/templates/registry/components/cert-manager
targetRevision: HEAD
destination:
server: https://kubernetes.default.svc
Expand Down
6 changes: 3 additions & 3 deletions registry/templates/registry/components/vault/vault.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ spec:
nginx.ingress.kubernetes.io/ssl-passthrough: "true"
nginx.ingress.kubernetes.io/backend-protocol: HTTPS
kubernetes.io/tls-acme: "true"
cert-manager.io/cluster-issuer: letsencrypt-staging
cert-manager.io/cluster-issuer: letsencrypt
spec:
ingressClassName: nginx
rules:
- host: vault.dev.simonemms.com
- host: vault.simonemms.com
http:
paths:
- backend:
Expand All @@ -53,7 +53,7 @@ spec:
pathType: Prefix
tls:
- hosts:
- vault.dev.simonemms.com
- vault.simonemms.com
secretName: vault-tls

volumeClaimTemplates:
Expand Down
5 changes: 5 additions & 0 deletions registry/templates/registry/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- cert-manager.yaml
- vault.yaml
2 changes: 1 addition & 1 deletion registry/templates/registry/vault.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
project: default
source:
repoURL: https://github.com/mrsimonemms/infrastructure
path: registry/clusters/dev/components/vault
path: registry/templates/registry/components/vault
targetRevision: HEAD
destination:
server: https://kubernetes.default.svc
Expand Down

0 comments on commit b8712ed

Please sign in to comment.