-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path2020-05.community-n-dex.html
264 lines (253 loc) · 10.1 KB
/
2020-05.community-n-dex.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
<!doctype html>
<html>
<head>
<!-- Use with reveal.js 3.8.0 -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>A kubernetes failure story (#1 - dex)</title>
<link rel="stylesheet" href="reveal.js-3.8.0/css/reveal.css">
<link rel="stylesheet" href="reveal.js-3.8.0/css/theme/black.css">
<link rel="stylesheet" href="css/custom.css">
<!-- Theme used for syntax highlighting of code -->
<link rel="stylesheet" href="reveal.js-3.8.0/lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'reveal.js-3.8.0/css/print/pdf.css' : 'reveal.js-3.8.0/css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
</head>
<body>
<div class="reveal">
<div class="slides" >
<section>
<section>
<h1>A kubernetes failure story (repeat)</h1>
<img src="img/k8s.png" style="border:none; background:none;width:25%;"/>
<img src="img/dex.png" style="border:none; background:none;width:25%;"/><br/>
</section>
<section>
<img src="img/meetup.png" style="border:none; background:none;width:25%;"/>
</section>
<section>
<div id="left">
<img src="img/devopsams.png" style="border:none; background:none;width:80%;"/>
</div>
<div id="right">
<img src="img/dockernl.png" style="border:none; background:none;width:65%;float:right;"/>
</div>
</section>
<section>
<img src="img/stdmeetup.jpg" style="border:none; background:none;width:55%;"/><br/>
</section>
<section>
<img src="img/adam.jpg" style="border:none; background:none;width:30%;"/><br/>
<h2><a href="https://twitter.com/adamsand0r">Ádám Sándor</a></h2>
</section>
<section>
<a href="https://www.meetup.com/Kubernetes-Support-Group/">kubernetes support group</a><br/>
<img src="img/k8saddicts.jpg" style="border:none; background:none;width:65%;"/><br/>
</section>
<section>
<h2>Henning Jacobs</h2>
<img src="img/henningjacobs.png" style="border:none; background:none;width:10%;"/><br/>
<a href="https://k8s.af">k8s.af</a><br/>
</section>
<section>
<h3># whoami</h3>
<div id="left">
<ul>
<li>Pieter Lange</li>
<li>IT infrastructure technician</li>
<li>[email protected]</li>
<li><a href="https://github.com/pieterlange/">github.com/pieterlange</a></li>
<li class="fragment"><a href="https://twitter.com/kuberpieters">@kuberpieters</a></li>
<li class="fragment" style="font-family: 'Lucida Console', Monaco, monospace;">eat, sleep, <img src="img/k8sparty.gif" style="border:none; background:none;width:10%;"/>, repeat</li>
</ul>
</div>
<div id="right">
<img src="img/profile.jpg" style="border:none; background:none;width:80%;"/><br/>
</div>
</section>
</section>
<section>
<section>
<h2>The setting</h2>
<p>Kubernetes authentication</p>
<ul>
<li class="fragment">Dex</li>
<li class="fragment">OIDC "proxy"</li>
<li class="fragment">Storage backends</li>
</ul>
</section>
<section>
<h2>Configuration</h2>
<pre style="width:30%">
<code data-trim>
config:
storage:
type: kubernetes
config:
inCluster: true
</code>
</pre>
</section>
<section>
<h2>The problem</h2>
<p>Bad defaults</p>
<ul>
<li class="fragment">AKA "stop hitting yourself"</li>
<li class="fragment">Insane TTL</li>
<li class="fragment">Refreshing dashboards</li>
<li class="fragment">Actual security bug</li>
</ul>
</section>
<section data-background="img/downtherabbithole.png">
</section>
<section>
<h3>I got these hints earlier..</h3>
<img src="img/api-slow.png" style="border:none; background:none;width:50%;"/>
</section>
<section>
<h3>I got these hints earlier..</h3>
<img src="img/dex-memusage.png" style="border:none; background:none;width:95%;"/>
</section>
<section data-background="img/authrequest.png">
</section>
</section>
<section>
<section>
<h2>Now i got $x AuthRequests</h2>
<ul>
<li class="fragment">How do i clean this mess?!</li>
<li class="fragment">Listing all AuthRequests times out</li>
<li class="fragment">Kinda need that to delete the resources</li>
</ul>
</section>
<section>
<h2>Think in solutions..</h2>
<ol>
<li class="fragment">Tweak timeouts in etcd/apiserver</li>
<li class="fragment">Delete namespace and let k8s clean up for us</li>
<li class="fragment">Bypass k8s and delete resources in etcd</li>
<li class="fragment">...</li>
</ol>
</section>
<section>
<img src="img/hopingthisworks.jpg" style="border:none; background:none;width:30%;"/>
</section>
<section>
<h2>Whats behind door number two?</h2>
<p class="fragment"><img src="img/k8sparty.gif" style="border:none; background:none;width:4%;"/> is magic, The End</p>
</section>
<section data-background="img/carousel.jpg">
</section>
<section>
<h2>Reconciliation loops</h2>
<ul>
<li class="fragment">List all AuthRequests</li>
<li class="fragment">Timeout</li>
<li class="fragment">Repeat</li>
<li class="fragment">Control plane nodes' load spikes to 60</li>
</ul>
</section>
<section data-background="img/cheshirecat.jpg">
</section>
<section>
<h2>New situation</h2>
<ul>
<li class="fragment">Control plane down</li>
<li class="fragment">Can't access monitoring (no auth, no port-forward)</li>
<li class="fragment">Plenty of alerts in slack though..</li>
</ul>
</section>
</section>
<section>
<section data-background="img/waterg.jpg">
</section>
<section>
<h2>Dirty tricks</h2>
<pre style="width:30%">
<code data-trim>
apiVersion: v1
kind: Namespace
metadata:
name: dex
spec:
finalizers:
- kubernetes
status:
phase: Terminating
</code>
</pre>
</section>
<section>
<p>You cant actually remove that finalizer with kubectl</p>
<ul>
<li class="fragment">Go directly through API and do not pass go</li>
<li class="fragment"><a href="https://github.com/ctron/kill-kube-ns">https://github.com/ctron/kill-kube-ns</a></li>
<li class="fragment"><b>NEVER DO THIS</b></li>
</ul>
</section>
<section>
<h1>NEVER DO THIS</h1>
</section>
<section>
<h2>That "fixed" it</h2>
<ul>
<li class="fragment">Still left with 0.5G of authrequests in etcd</li>
<li class="fragment">Fairly confident <div style="font-family: 'Lucida Console', Monaco, monospace;">kubectl create namespace dex</div> kills the cluster</li>
<li class="fragment">Deployed dex to new namespace with SANE DEFAULTS</li>
</ul>
</section>
<section>
<img src="img/thereifixedit.png" style="border:none; background:none;width:98%;"/>
</section>
<section>
<h2>Postmortem</h2>
<div id="left">
<img src="img/nietzsche.jpg" style="border:none; background:none;width:50%;"/>
</div>
<div id="right">
<p><i>"To live is to suffer, to survive is to find some meaning in the suffering."</i></p>
<p>Friedrich Nietzsche</p>
</div>
</section>
<section>
<h2>Postmortem</h2>
<div id="left">
<img src="img/charity.png" style="border:none; background:none;width:50%;"/>
</div>
<div id="right">
<p><i>"To live is to suffer, to survive is to impose a post hoc narrative across loosely or disconnected events."</i></p>
<p>Charity Majors</p>
</div>
</section>
<section>
<h1>No business applications were harmed during this outage.</h1>
</section>
</section>
</div>
</div>
<script src="reveal.js-3.8.0/lib/js/head.min.js"></script>
<script src="reveal.js-3.8.0/js/reveal.js"></script>
<script>
// More info https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
history: true,
width: "90%",
margin: 0.05,
// More info https://github.com/hakimel/reveal.js#dependencies
dependencies: [
{ src: 'reveal.js-3.8.0/plugin/markdown/marked.js' },
{ src: 'reveal.js-3.8.0/plugin/markdown/markdown.js' },
{ src: 'reveal.js-3.8.0/plugin/notes/notes.js', async: true },
{ src: 'reveal.js-3.8.0/plugin/tagcloud/tagcloud.js', async: true },
{ src: 'reveal.js-3.8.0/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }
]
});
</script>
</body>
</html>