@@ -24,7 +24,8 @@ If you need to install a new kubernetes cluster you can use my [Ansible Playbook
24
24
25
25
## Resources
26
26
27
- You can find all of the resources from this tutorial [ here] ( https://github.com/techno-tim/launchpad/tree/master/kubernetes/traefik-cert-manager )
27
+ > You can find all of the resources from this tutorial [ here] ( https://github.com/techno-tim/launchpad/tree/master/kubernetes/traefik-cert-manager )
28
+ {: .prompt-success }
28
29
29
30
### helm
30
31
@@ -81,7 +82,7 @@ Check the status of the Traefik ingress controller service
81
82
kubectl get svc --all-namespaces -o wide
82
83
```
83
84
84
- should see traefik with the specified IP
85
+ We should see traefik with the specified IP
85
86
86
87
``` console
87
88
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
@@ -96,7 +97,7 @@ traefik traefik LoadBalancer 10.43.156.161 192.168.30.80
96
97
kubectl get pods --namespace traefik
97
98
```
98
99
99
- should see
100
+ We should see pods in the ` traefik ` namespace
100
101
101
102
``` console
102
103
NAME READY STATUS RESTARTS AGE
@@ -115,7 +116,7 @@ kubectl apply -f default-headers.yaml
115
116
kubectl get middleware
116
117
```
117
118
118
- should see
119
+ We should see our headers
119
120
120
121
``` console
121
122
NAME AGE
@@ -124,83 +125,86 @@ default-headers 25s
124
125
125
126
### dashboard
126
127
127
- install ` htpassword `
128
+ Install ` htpassword `
128
129
129
130
``` bash
130
131
sudo apt-get update
131
132
sudo apt-get install apache2-utils
132
133
```
133
134
134
- generate password
135
+ Generate a credential / password that's base64 encoded
135
136
136
137
``` bash
137
138
htpasswd -nb techno password | openssl base64
138
139
```
139
140
140
- apply secret
141
+ Apply secret
141
142
142
143
``` bash
143
144
kubectl apply -f secret-dashboard.yaml
144
145
```
145
146
146
- get secret
147
+ Get secret
147
148
148
149
``` bash
149
150
kubectl get secrets --namespace traefik
150
151
```
151
152
152
- apply middleware
153
+ Apply middleware
153
154
154
155
``` bash
155
156
kubectl apply -f middleware.yaml
156
157
```
157
158
158
- apply dashboard
159
+ Apply dashboard
159
160
160
161
``` bash
161
162
kubectl apply -f ingress.yaml
162
163
```
163
164
164
- visit
165
+ Visit ` https://traefik.local.example.com `
165
166
166
- < https://traefik.local.technotim.live/ >
167
-
168
-
169
- ## sample workload
167
+ ## Sample Workload
170
168
171
169
``` bash
172
170
kubectl apply -f deployment.yaml
173
171
kubectl apply -f service.yaml
174
172
kubectl apply -f ingress.yaml
175
173
```
176
174
177
- or folder
175
+ Or you can apply an entire folder at once!
178
176
179
177
``` bash
180
178
kubectl apply -f nginx
181
179
```
182
180
183
181
## cert-manager
184
182
185
- add repo
183
+ Add repo
186
184
187
185
``` bash
188
186
helm repo add jetstack https://charts.jetstack.io
189
187
```
190
188
189
+ Update it
190
+
191
191
``` bash
192
192
helm repo update
193
193
```
194
194
195
+ Create our namespace
196
+
195
197
``` bash
196
198
kubectl create namespace cert-manager
197
199
```
198
200
201
+ Get all namespaces
202
+
199
203
``` bash
200
204
kubectl get namespaces
201
205
```
202
206
203
- should see
207
+ We should see
204
208
205
209
``` console
206
210
NAME STATUS AGE
@@ -213,60 +217,69 @@ metallb-system Active 21h
213
217
traefik Active 4h35m
214
218
```
215
219
216
- apply crds (1.9.1)
220
+ Apply crds (1.9.1)
221
+
222
+ > * Note: Be sure to change this to the [ latest version] ( https://cert-manager.io/docs/installation/supported-releases/ ) of ` cert-manager ` *
223
+ {: .prompt-info }
217
224
218
225
``` bash
219
226
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.9.1/cert-manager.crds.yaml
220
227
```
221
228
229
+ Install with helm
230
+
222
231
``` bash
223
232
helm install cert-manager jetstack/cert-manager --namespace cert-manager --values=values.yaml --version v1.9.1
224
233
```
225
234
226
- secrets
235
+ Apply secrets
227
236
228
237
``` bash
229
238
kubectl apply -f secret-cf-token.yaml
230
239
kubectl apply -f secret-cf-email.yaml
231
240
```
232
241
233
- issuers
234
-
242
+ Apply ` ClusterIssuer ` s
235
243
236
244
``` bash
237
245
kubectl apply -f letsencrypt-staging.yaml
238
246
```
239
247
240
- create certs
248
+ Create certs
241
249
242
- staging
250
+ ### staging
243
251
244
- from staging folder
252
+ From staging folder
245
253
246
254
``` bash
247
255
kubectl apply -f technotim-live-cert.yaml
248
256
```
249
257
250
- looks at logs
251
-
252
- can tail with
258
+ Check the logs
253
259
254
260
``` bash
255
261
kubectl logs -n cert-manager -f cert-manager-877fd747c-fjwhp
256
262
```
257
263
258
- get challenges
264
+ Get ` challenges `
259
265
260
266
``` bash
261
267
kubectl get challenges
262
268
```
263
269
264
- or more details with
270
+ Get more details
265
271
266
272
``` bash
267
273
kubectl describe order local-technotim-live-frm2z-1836084675
268
274
```
269
275
276
+ ### production
277
+
278
+ From production folder
279
+
280
+ ``` bash
281
+ kubectl apply -f technotim-live-cert.yaml
282
+ ```
270
283
271
284
## Links
272
285
0 commit comments