Skip to content

Commit

Permalink
refactor(cert-manager): add tls ks (#3302)
Browse files Browse the repository at this point in the history
  • Loading branch information
buroa authored Jan 13, 2025
1 parent 6c60861 commit f3c9772
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 77 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-production
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: &email [email protected]
privateKeySecretRef:
name: letsencrypt-production
solvers:
- dns01:
cloudflare:
email: *email
apiTokenSecretRef:
name: cloudflare-issuer-secret
key: CLOUDFLARE_API_TOKEN
selector:
dnsZones: ["ktwo.io"]
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: cloudflare
name: cloudflare-issuer
spec:
secretStoreRef:
kind: ClusterSecretStore
name: onepassword-connect
target:
name: cloudflare-secret
name: cloudflare-issuer-secret
creationPolicy: Owner
template:
engineVersion: v2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./clusterissuer.yaml
- ./externalsecret.yaml
- ./letsencrypt.yaml
42 changes: 0 additions & 42 deletions kubernetes/apps/cert-manager/cert-manager/issuers/letsencrypt.yaml

This file was deleted.

22 changes: 22 additions & 0 deletions kubernetes/apps/cert-manager/cert-manager/ks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,25 @@ spec:
interval: 30m
retryInterval: 1m
timeout: 5m
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: &app cert-manager-tls
namespace: flux-system
spec:
targetNamespace: cert-manager
commonMetadata:
labels:
app.kubernetes.io/name: *app
dependsOn:
- name: cert-manager-issuers
path: ./kubernetes/apps/cert-manager/cert-manager/tls
prune: true
sourceRef:
kind: GitRepository
name: flux-system
wait: true
interval: 30m
retryInterval: 1m
timeout: 5m
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: wildcard
name: ktwo-io
spec:
secretName: wildcard-tls
secretName: ktwo-io-tls
issuerRef:
name: letsencrypt-production
kind: ClusterIssuer
commonName: ktwo.io
dnsNames:
- ktwo.io
- "*.ktwo.io"
dnsNames: ["ktwo.io", "*.ktwo.io"]
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./wildcard.yaml
- ./certificates.yaml
2 changes: 1 addition & 1 deletion kubernetes/apps/networking/nginx/external/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ spec:
ssl-protocols: TLSv1.3 TLSv1.2
use-forwarded-headers: true
extraArgs:
default-ssl-certificate: networking/wildcard-tls
default-ssl-certificate: cert-manager/ktwo-io-tls
publish-status-address: &hostname external.ktwo.io
ingressClass: external
ingressClassResource:
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/apps/networking/nginx/internal/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ spec:
ssl-early-data: true
ssl-protocols: TLSv1.3 TLSv1.2
extraArgs:
default-ssl-certificate: networking/wildcard-tls
default-ssl-certificate: cert-manager/ktwo-io-tls
publish-status-address: &hostname internal.ktwo.io
ingressClass: internal
ingressClassResource:
Expand Down
26 changes: 2 additions & 24 deletions kubernetes/apps/networking/nginx/ks.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,6 @@
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: &app nginx-certificates
namespace: flux-system
spec:
targetNamespace: networking
commonMetadata:
labels:
app.kubernetes.io/name: *app
dependsOn:
- name: cert-manager-issuers
path: ./kubernetes/apps/networking/nginx/certificates
prune: true
sourceRef:
kind: GitRepository
name: flux-system
wait: true
interval: 30m
retryInterval: 1m
timeout: 5m
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: &app nginx-external
namespace: flux-system
Expand All @@ -32,7 +10,7 @@ spec:
labels:
app.kubernetes.io/name: *app
dependsOn:
- name: nginx-certificates
- name: cert-manager-tls
path: ./kubernetes/apps/networking/nginx/external
prune: true
sourceRef:
Expand All @@ -54,7 +32,7 @@ spec:
labels:
app.kubernetes.io/name: *app
dependsOn:
- name: nginx-certificates
- name: cert-manager-tls
path: ./kubernetes/apps/networking/nginx/internal
prune: true
sourceRef:
Expand Down

0 comments on commit f3c9772

Please sign in to comment.