File tree Expand file tree Collapse file tree 8 files changed +145
-5
lines changed
Expand file tree Collapse file tree 8 files changed +145
-5
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ apiVersion : cert-manager.io/v1
3+ kind : Certificate
4+ metadata :
5+ name : app-codepod-io
6+ spec :
7+ secretName : app-codepod-io-tls
8+ issuerRef :
9+ name : letsencrypt-production
10+ kind : ClusterIssuer
11+ commonName : " app.codepod.io"
12+ dnsNames :
13+ - " app.codepod.io"
Original file line number Diff line number Diff line change 1+ ---
2+ apiVersion : cert-manager.io/v1
3+ kind : Certificate
4+ metadata :
5+ name : app-codepod-io-staging
6+ spec :
7+ secretName : app-codepod-io-staging-tls
8+ issuerRef :
9+ name : letsencrypt-staging
10+ kind : ClusterIssuer
11+ commonName : " app.codepod.io"
12+ dnsNames :
13+ - " app.codepod.io"
14+
Original file line number Diff line number Diff line change 1+ ---
2+ apiVersion : cert-manager.io/v1
3+ kind : ClusterIssuer
4+ metadata :
5+ name : letsencrypt-production
6+ spec :
7+ acme :
8+ server : https://acme-v02.api.letsencrypt.org/directory
9+ 10+ privateKeySecretRef :
11+ name : letsencrypt-production
12+ solvers :
13+ - dns01 :
14+ cloudflare :
15+ 16+ apiTokenSecretRef :
17+ name : cloudflare-token-secret
18+ key : cloudflare-token
19+ selector :
20+ dnsZones :
21+ - " app.codepod.io"
Original file line number Diff line number Diff line change 1+ ---
2+ apiVersion : cert-manager.io/v1
3+ kind : ClusterIssuer
4+ metadata :
5+ name : letsencrypt-staging
6+ spec :
7+ acme :
8+ server : https://acme-staging-v02.api.letsencrypt.org/directory
9+ 10+ privateKeySecretRef :
11+ name : letsencrypt-staging
12+ solvers :
13+ - dns01 :
14+ cloudflare :
15+ 16+ apiTokenSecretRef :
17+ name : cloudflare-token-secret
18+ key : cloudflare-token
19+ selector :
20+ dnsZones :
21+ - " app.codepod.io"
Original file line number Diff line number Diff line change 1+ ---
2+ apiVersion : v1
3+ kind : Secret
4+ metadata :
5+ name : cloudflare-token-secret
6+ namespace : cert-manager
7+ type : Opaque
8+ stringData :
9+ cloudflare-token : <YOUR-API-TOKEN>
Original file line number Diff line number Diff line change 22
33## Prerequist
44
5- Also need the secrets:
5+ ### Create namespaces
6+
7+ We need to create one more namespace manually:
8+
9+ kubectl create ns codepod-staging
10+ kubectl create ns codepod-staging-runtime
11+
12+ ### Apply the secrets
13+
14+ Need the secrets:
615
716```
817apiVersion: v1
@@ -30,11 +39,24 @@ Need to manually apply these secrets:
3039kubectl apply -f secrets.yaml
3140```
3241
33- ## Install
42+ ### Install longhorn
3443
35- We need to create one more namespace manually:
44+ Longhorn is needed to dynamically allocate volumes for DB.
3645
37- kubectl create ns codepod-staging-runtime
46+ ### Get SSL certificate (required for prod)
47+
48+ See ` ../cert-manager ` . Basically:
49+
50+ 1 . install cert-manager
51+ 2 . save cloudflare API token to secrets (to cert-manager ns)
52+ 3 . define issuers (clusterwise)
53+ 4 . retrieve certs (into codepod-prod namespace)
54+
55+ Ref: https://docs.technotim.live/posts/kube-traefik-cert-manager-le/#cert-manager
56+
57+ End result: the app-codepod-io-tls certificate.
58+
59+ ## Install
3860
3961Install:
4062
Original file line number Diff line number Diff line change @@ -15,6 +15,12 @@ kind: IngressRoute
1515metadata :
1616 name : codepod-ingress
1717spec :
18+ {{- if .Values.ingress.tls }}
19+ entryPoints :
20+ - websecure
21+ tls :
22+ secretName : {{ .Values.ingress.tls.secretName }}
23+ {{- end }}
1824 routes :
1925 - match : " Host(`{{ .Values.hostname }}`) && PathPrefix(`/`)"
2026 kind : Rule
3339 services :
3440 - name : codepod-proxy-service
3541 port : 4010
42+
43+ {{- if .Values.ingress.tls }}
44+ ---
45+ apiVersion : traefik.containo.us/v1alpha1
46+ kind : Middleware
47+ metadata :
48+ name : redirect-https
49+ spec :
50+ redirectScheme :
51+ scheme : https
52+ permanent : true
53+
54+ ---
55+ apiVersion : traefik.containo.us/v1alpha1
56+ kind : IngressRoute
57+ metadata :
58+ name : http-redirect-to-https
59+ spec :
60+ entryPoints :
61+ - web
62+ routes :
63+ - match : " Host(`{{ .Values.hostname }}`)"
64+ kind : Rule
65+ # We need this services clause to make the route valid.
66+ services :
67+ - name : codepod-ui-service
68+ port : 80
69+ middlewares :
70+ - name : redirect-https
71+ {{- end }}
Original file line number Diff line number Diff line change 1- hostname : " app.codepod.io"
1+ hostname : " app.codepod.io"
2+
3+ ingress :
4+ tls :
5+ secretName : app-codepod-io-tls
You can’t perform that action at this time.
0 commit comments