-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
930 lines (525 loc) · 43.2 KB
/
index.html
File metadata and controls
930 lines (525 loc) · 43.2 KB
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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
<!DOCTYPE html>
<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
<head>
<meta charset="utf-8">
<title>Devops malarkey</title>
<meta name="author" content="Bodge and Guesswork">
<meta name="description" content="For the last yea-many months, I’ve been hacking on actual Kubernetes. It has been/is being really very interesting, and
that’s only …">
<!-- http://t.co/dKP3o1e -->
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="canonical" href="http://failcake.github.com">
<link href="/favicon.png" rel="icon">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
<link href="/atom.xml" rel="alternate" title="Devops malarkey" type="application/atom+xml">
<script src="/javascripts/modernizr-2.0.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>!window.jQuery && document.write(unescape('%3Cscript src="./javascripts/lib/jquery.min.js"%3E%3C/script%3E'))</script>
<script src="/javascripts/octopress.js" type="text/javascript"></script>
<!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
<link href="http://fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
</head>
<body >
<header role="banner"><hgroup>
<h1><a href="/">Devops malarkey</a></h1>
<h2>Success. Failure. Cake.</h2>
</hgroup>
</header>
<nav role="navigation"><ul class="subscription" data-subscription="rss">
<li><a href="/atom.xml" rel="subscribe-rss" title="subscribe via RSS">RSS</a></li>
</ul>
<form action="http://google.com/search" method="get">
<fieldset role="search">
<input type="hidden" name="q" value="site:failcake.github.com" />
<input class="search" type="text" name="q" results="0" placeholder="Search"/>
</fieldset>
</form>
<ul class="main-navigation">
<li><a href="/">Blog</a></li>
<li><a href="/blog/archives">Archives</a></li>
<li><a href="/about.html">About</a></li>
</ul>
</nav>
<div id="main">
<div id="content">
<div class="blog-index">
<article>
<header>
<h1 class="entry-title"><a href="/blog/2018/10/14/not-invented-here-kubernetes-remix/">Not Invented Here (Kubernetes Remix)</a></h1>
<p class="meta">
<time datetime="2018-10-14T21:04:00+01:00" pubdate data-updated="true">Oct 14<span>th</span>, 2018</time>
</p>
</header>
<div class="entry-content"><p>For the last yea-many months, I’ve been hacking on actual Kubernetes. It has been/is being really very interesting, and
that’s only partly the precursor to an ‘interesting times’ riff. I have learned many things.</p>
<ul>
<li><p>Anyone who says you don’t need any ops experience/people is lying through their teeth. The doc about how to make yr
site ‘production ready’ advises you to carve out your own netblock(s) from within a lump of 10/8, allocate subnets for
various systems, string them together with load balancers, consider capacity plans and redundancy, logging, monitoring,
backups, security and access control. None of these things are beyond the wit of most people, but they’re more likely to
be back-of-envelope stuff for yr average jobbing Unix admin than most other technical types.</p></li>
<li><p>Deployment tools/strategies seem, thus far at least, to consider it a job well done if they start/bounce/replace a
single container. Which, well, is really quite a lot of a Noddy job.</p></li>
<li><p>There is a thing called Helm, which is jolly handy. It’s a package-manager for Kubernetes. If you’ve come from an ops
background, then you’ll be familiar with the idea that a running (web)app is only half of the job, and generating
something versioned and deployable is a much more useful target. Yes I know containers are versioned and deployable,
but see how far you get with that attitude with K8S as a target. Just a simple matter of YAML, is it? Fine. I’ll wait
while you grovel through a pile of similar-looking files, looking for the right version tag.</p></li>
</ul>
<p>The first thing can be solved (FAVO ‘solved’) with Terrorform. The only nice thing I can say about Terrorform is that it
works, mostly as advertised. A quite startling feature of the thing is that if you want to change something about a K8S
cluster on GCloud with Terrorform, it will blow the cluster away and build you a new one. Now I guess this is probably
less of a surprise if you’ve a set of redundant clusters in multiple zones, but it’s still not the sort of behaviour
that one might hope for.</p>
<p>After that, Helm is a useful tool.</p>
<p>However, The Product is a collection of helm charts flying in close formation, and rightly so since generating a
monolith is a daft idea and being able to tinker with subsystems in isolation is a useful thing. So I found myself
typing ‘helm install thing, helm install other-thing, helm upgrade this-thing’ quite a lot, which became trivially
fat-fingerable. As I discovered when a routine upgrade toasted a beta cluster.</p>
<p>I poked around at a couple of the available things which alleged they could make this sort of malarkey go away, and they
were either complete workflows which assume their way is best (Ho ho ho. No.) or just seemed to be complicated YAML
generators. I am really very much <em>not</em> interested in generating very similar piles of inpenetrable YAML that I have to
keep in version control. The impenetrable YAML should only ever exist on the target cluster and not really be the thing
that is fiddled with by humans, unless they like stabbing themselves in the leg with a fork or something.</p>
<p>So I lashed up a thing that ran helm commands in the right order for me, made sure that the cluster I thought I was
looking at was the actual target, did some elementary access config and made sure the storage classes I expected were
where they should be. Then I could put much fewer things into the git repository that defined a given site/cluster and
repeat myself as seldom as possible.</p>
<p>Here’s a really simple example that installs Prometheus, Grafana, a cert-manager and an Ingress. Obviously you’d not do
this in an environment where you wanted Prometheus to work, since there’s nothing for it to monitor.</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
<span class='line-number'>18</span>
<span class='line-number'>19</span>
<span class='line-number'>20</span>
<span class='line-number'>21</span>
<span class='line-number'>22</span>
<span class='line-number'>23</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>---
</span><span class='line'>
</span><span class='line'>context: (your kubectl context goes here. D'you think I'd leave one of ours to look at?)
</span><span class='line'>
</span><span class='line'>secrets:
</span><span class='line'> - dockerhub
</span><span class='line'>
</span><span class='line'>logfile: notgrove.log
</span><span class='line'>debug: false
</span><span class='line'>
</span><span class='line'>charts:
</span><span class='line'> naunton:
</span><span class='line'> values: helm-values/nginx.yaml
</span><span class='line'> chart: stable/nginx-ingress
</span><span class='line'> shuthonger:
</span><span class='line'> values: helm-values/kube-lego.yaml
</span><span class='line'> chart: stable/kube-lego
</span><span class='line'> turkdean:
</span><span class='line'> values: helm-values/prometheus.yaml
</span><span class='line'> chart: stable/prometheus
</span><span class='line'> queenhill:
</span><span class='line'> values: helm-values/grafana.yaml
</span><span class='line'> chart: stable/grafana
</span></code></pre></td></tr></table></div></figure>
<p>Because I come from Puppet-land, that config file gets called a manifest.yaml.</p>
<ul>
<li>context is the name of the target cluster. The tool expects to have the right permissions to access same.</li>
<li>secrets are, er, a list of k8s secrets you may need to have configured before Helm will work.</li>
<li>logfile should be obvious.</li>
<li>debug ditto.</li>
<li>charts is a list of Helm charts, their local config values that are different from the defaults and where to find
them.</li>
</ul>
<p>That last bit implies there’s some directory structure. Here it is:</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>drwxrwxr-x 5 jhr jhr 4096 Jul 9 13:22 .
</span><span class='line'>drwxrwxr-x 22 jhr jhr 4096 Oct 2 10:39 ..
</span><span class='line'>drwxrwxr-x 2 jhr jhr 4096 Jul 9 13:22 access
</span><span class='line'>drwxrwxr-x 2 jhr jhr 4096 Jul 9 13:22 cluster-setup
</span><span class='line'>drwxrwxr-x 2 jhr jhr 4096 Jul 9 13:22 helm-values
</span><span class='line'>-rw-rw-r-- 1 jhr jhr 467 Jul 9 13:22 manifest.yaml
</span><span class='line'>-rw-rw-r-- 1 jhr jhr 1514 Jul 9 13:22 README.md</span></code></pre></td></tr></table></div></figure>
<ul>
<li>access contains cluster config to do with roles and/or pod security.</li>
<li>cluster-setup contains things like storage class config.</li>
<li>helm-values are (somewhat unsurprisingly) where the values.yaml files for the Helm charts live.</li>
</ul>
<p>As you might guess, the tool processes the contents of those directories in order, so you can be fairly sure that your
storage classes will exist before something in a Helm chart tries to allocate a PersistentVolumeClaim that you’d prefer
was SSD instead of default spinny rust.</p>
<p>And that implies there’s a tool with some options:</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>km [OPTION] ... (install|DELETE|upgrade)
</span><span class='line'>
</span><span class='line'>-h, --help:
</span><span class='line'> show help
</span><span class='line'>
</span><span class='line'>-f, --file [name]:
</span><span class='line'> filename of manifest. Usually manifest.yaml
</span><span class='line'>
</span><span class='line'>-n, --namespace [namespace]:
</span><span class='line'> k8s namespace to create and use for this installation.
</span><span class='line'>
</span><span class='line'>-j, --jfdi
</span><span class='line'> Don't stop and ask for confirmation that you're about to do something terrible.
</span><span class='line'>
</span><span class='line'>install, upgrade or delete. Actions. Yes.</span></code></pre></td></tr></table></div></figure>
<p>That’s quite enough typing for one evening. I should imagine that I’ll return to this to explain it better, show what it
looks like running and point at the relevant github repos.</p>
</div>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2018/10/14/technical-intermission/">Technical Intermission</a></h1>
<p class="meta">
<time datetime="2018-10-14T18:14:00+01:00" pubdate data-updated="true">Oct 14<span>th</span>, 2018</time>
</p>
</header>
<div class="entry-content"><p>You’ll have noticed (or not, since with any luck I am typing into a void. Or Google. Which is more or less the same thing.) that content has been somewhat sparse.</p>
<p>As you might imagine, in the intervening time entire new technical edifices have been founded, matured and then fallen. Much like the careers of minor Britpop beat combos. If I cared I would go look for some evidence of the internet version of, say, Powder or, er, Menswear for a laugh. MongoDB? Who knows.</p>
<p>What I’m failing to get at is that I’d forgotten how to drive Octopress-on-github, had failed to commit and push the last live post (the one about DNS), ruby had changed and no longer worked right because I’d forgotten how/why to drive rbenv, the way that github pages work had changed and it wasn’t obvious that ‘bundle exec rake deploy’ was even doing a damn thing.</p>
<p>I would like to present that as an example of an entirely rubbish workflow.</p>
<p>So obviously I tried the same things as before, because doing the same thing twice always works. Then I thought ‘This workflow is rubbish. I shall replace it with something I barely understand.’ because <em>obviously.</em></p>
<p>What thing do I barely understand best? Go.</p>
<p>Are there Octopress->Hugo migration tools? Yes.</p>
<p>Do they work as expected? Patches welcome!</p>
<p>This is why people who don’t have ‘git push -u origin master’ burned into their muscle memory use Wordpress. If your competition is the functional equivalent of a swift rochambeau to the trouser area, this is a warning.</p>
<p>So anyway. This is a long-arse version of a ‘Test. Please ignore.’ message. Let’s see if sarcasm works better than upgrading rbenv.</p>
</div>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2018/10/13/more-and-slash-or-different-tumbleweed/">More And/or Different Tumbleweed</a></h1>
<p class="meta">
<time datetime="2018-10-13T18:56:00+01:00" pubdate data-updated="true">Oct 13<span>th</span>, 2018</time>
</p>
</header>
<div class="entry-content"><p>… And then I left.</p>
<p>You know how they say ‘If you can’t say anything nice, then don’t say anything at all’?</p>
<p>Well then.</p>
</div>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2017/04/05/stirrings-from-the-pit-dns/">Stirrings From the Pit: DNS</a></h1>
<p class="meta">
<time datetime="2017-04-05T18:46:00+01:00" pubdate data-updated="true">Apr 5<span>th</span>, 2017</time>
</p>
</header>
<div class="entry-content"><p>So anyway. DNS. It seems that every time I opine on the FB about the state of our own DNS rig, someone or other will grouse about the rubbish state of the name services at their own place of work. If it’s not carefully hand-curated hosts tables to prop up and/or bodge around stuff that no-one can change, it’s having to keep a sheet of paper with columns of IP addresses that belong to the servers you’re expected to use. Which, oh look. It’s just rubbish and there’s no excuse.</p>
<p>Here are the things we do at Future.</p>
<ul>
<li><p>The zonefiles live in a Gitlab instance. Other source-code repositories are available. As is the old zonefile for futurenet.co.uk which has about a page of comments at the top which are instructions not to fiddle, to always log what changes you made, really don’t fiddle and if you break it you are in so much trouble. Stuff like that is rubbish. Don’t do it. The DNS is a bunch of text files which respond well to versioning. There’s no excuse not to. Even RCS is more than good enough if you don’t have git to hand, but keeping it on a different server does mean you’ve a backup if something unfortunate happens to your nameserver.</p></li>
<li><p>The zonefiles are pushed out to all the nameservers automatically, which makes it quite hard to have a zone mismatch. (It’s possible though. I shall explain below.) How you do that is best hacked up locally, because our rig (Git pulls triggered by a pubsub message bus) would be somewhat top-heavy for just this one job. Gitlab has multiple triggers. Use the sort of thing you like best.</p></li>
<li><p>The config is managed by Puppet. If you’re still managing server config by hand, please stop, have a mug of something warming and try to work out why you hate yourself so much.</p></li>
<li><p>Because Gitlab contains a CI rig that uses containers, we test the zonefiles on every commit by sparking up a container with a complete nameserver install inside and then making sure that the forward zones match the reverse ones, the zonefiles actually parse, the SOA records and NS records match and that the serial number on the zone hasn’t been fat-fingered to overflow its type. These are all things that can, will and have gone wrong for us, so having the machines rather than the customers do a spot of sanity-checking is likely a Good Thing.</p></li>
<li><p>The code that configures the container to run NSD, build its config and sanity-check the zones is the production code that runs the production nameservers.</p></li>
<li><p>This means that pretty much anyone can checkout the zones, patch them and submit a merge request, which lowers the load on the people who know DNS best (er, me) and allows the less confident to make their own changes, knowing that the machinery will flag up problems before they escape to production. See above about not fiddling. That’s a terrible way to run anything. No-one will learn a damn thing if they’re too scared to make mistakes. So all the work will be queued up for the High Priestesses, and that will breed resentment because oh god can’t you people do anything for yourselves here look it’s simple.</p></li>
<li><p>You will also have to be able to rebuild the config files automatically when you add or remove a domain. While DNS knows about secondary servers, there’s no in-band signalling to allow for that sort of thing. Our git repo contains a subdirectory of zonefiles, another containing a big list of domains, and a scripts subdir where all the testing bits live.</p></li>
<li><p>In our case, we have a pile of domains that are more or less The Same. So we have a generic zonefile that just contains some NS records and a set of A and A4 records that point to a webserver that does db-based 301 redirects. That’s the sort of thing that happens when you experiment with Nginx, embedded Ruby and Redis. Still, it’s less worse than the previous versions. Unsurprisingly, the big YAML table of redirects is also held in Gitlab and runs up a container to test itself on commit. You can probably sense a theme here.</p></li>
<li><p>A thing we’re working towards is programmatic generation of the reverse zones from the forward ones, mostly prompted by the utter impossibility of working with ip6.arpa addresses if you’re even slightly dyslexic. Obviously the logical endpoint for such thinking is a return to using the H2N(-HP) script for generating zones from hosts tables. (HHOS)</p></li>
<li><p>There’s probably a better way of doing it.</p></li>
</ul>
</div>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2015/11/20/tumbleweed/">Tumbleweed</a></h1>
<p class="meta">
<time datetime="2015-11-20T20:45:00+00:00" pubdate data-updated="true">Nov 20<span>th</span>, 2015</time>
</p>
</header>
<div class="entry-content"><p>… And then everbody left.</p>
<p>I could write a thing about burnout, but I was too fried to notice when it happened. The interesting/exciting/disturbing
thing about being properly stressed is that becomes entirely normal and you only realise something is broken when the
music stops. Then all the things in your head that you’ve been ignoring pitch up at once and are like ‘HELLO’ and waving
cartoon cricket-bats with nails and broken glass embedded.</p>
</div>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2014/02/07/re-inventing-the-wheel-square-and-on-fire/">Re-inventing the Wheel - Square and on Fire</a></h1>
<p class="meta">
<time datetime="2014-02-07T20:27:00+00:00" pubdate data-updated="true">Feb 7<span>th</span>, 2014</time>
</p>
</header>
<div class="entry-content"><p>I am incompetent and I can’t make Vagrant work.</p>
<p>At least, that’s the excuse I’ve been making for not joining in with the
rest of the floor in using that for Puppet (among other things) development. Instead, my dev-rig is a VM running as a
puppetmaster that’s tracking the changes I make to a given branch in our Git repo via the magic of post-commit hooks and
another VM in which I can run ‘puppet agent –debug –blah –server (first VM)’. Once in a while I remember to blow away
the second VM so I can make sure everything builds in the right order. However, even with snapshots it’s just slightly
too painful to happen regularly.</p>
<p>Meanwhile, quite a lot of the recent developments at Future have involved rigs of between eight and twelve boxes.
Generating a worthwhile test/dev version of one of those is rather tiresome because even if you’ve got the spare
horsepower lying about, you have to spend yea-long wiring it all together, sanitising the static and/or test data and
it all quickly gets completely <em>oh god why did i even get out of bed i should have been a farmer like my dad mind you if
i had done that i’d have been out of bed at six to go feed the sheep on long barrow bank perhaps not after all…</em></p>
<p>So when a mildly broken Dell R620 arrived back from one of the DCs coincidentally with me wanting to have a play with
this Docker business, it all seemed a bit convenient.</p>
<p>I am incompetent and I can’t make Docker work. On Debian.</p>
<p><a href="http://linuxcontainers.org/">LXC</a>, on the other hand, was slightly simpler than falling off a log.</p>
<p>Given that it’s simple to build a puppetmaster that’s the same as one of the live ones, and that all the machine config
I currently care about is in a manifest, it should be pretty easy to generate a container and have it puppet itself up
tolerably quickly.</p>
<p>This indeed turned out to be the case. However, having to hand-allocate IP addresses and fiddle about with container
naming such that they picked up the configs in use on the live rig was all a bit too hands-on and really not what I
wanted.</p>
<p><a href="http://www.thekelleys.org.uk/dnsmasq/doc.html">DNSMasq</a> fixed the first problem. It is a surprisingly useful tool.</p>
<p>A rakefile which read a list of made-up machine names, generated softlinks to the actual hiera node configs and then
instantiated the relevant containers fixed the second.</p>
<p>I also spent <em>quite some time</em> building a Wheezy ‘image’ that minimised apt-get as much as possible.</p>
<p>Result - fully puppeted containers come up in circa a minute. Somewhat longer if you have to install PHP.
If I didn’t have quite such a rational hatred of golden images and all who sail in them, it would likely be faster
still.</p>
<p>The next part is a bit fiddly.</p>
<p>The example problem I now have is that some parts of my collection of yea-many VMs want to connect to other parts. For
instance if I have a redis slave, I need to know what the master’s IP address might be during the puppet run. At Future,
we generate a location fact and use that in our hiera, er, hierarchy to configure things like message brokers,
smarthosts and DNS ordering. I could just add yet another location - testbox, or something - allocate a block of IP
space and then add some extra indirection. And then I could do that again for each person and/or project that wanted to
run up a test-rig. At which point one has just run into a behaviour pattern that should probably be named ‘It’s OK, I
can fix that for you.’</p>
<p>I first came across this in, er, 1991 when doing some NHS-related coding. One of the other chaps had written a thing
which had to deal with, oh I don’t know, ten items or something. Because he was a forward-thinking sort, he allocated
sixteen slots in his array and beetled off all smug for a coffee and a corned beef sandwich. As you might expect, a few
months later one site or other had a list of seventeen items and a bug report. ‘It’s OK, I can fix that for you!’ went
our chap and expanded the array to the clearly ludicrous value of some twenty-three slots…</p>
<p>There’s scope for an Eric Berne knockoff book of tiresome technical behaviour antipatterns, isn’t there?</p>
<p>Anyway, I’m using DHCP, and I wanted the entire edifice to work with little or no extra typing.</p>
<p>CoreOS’s <a href="https://github.com/coreos/etcd">ETCD</a> looked like a good fit. Emit salient facts to etcd database when bringing up (say) redis master, then
query same via <a href="https://github.com/garethr/hiera-etcd">Garethr’s hiera-etcd</a> when bringing up the slave. Profit!</p>
<p>That bit did take a little tinkering to get right.</p>
<p>It seems to me that the notion of a reactive puppet configuration is really rather interesting. Other people may well be
screaming in terror and jabbering about things like ‘deadly embrace’ and ‘terrible feedback loops are fine for the Jesus
and Mary Chain (Or A Place to Bury Strangers if that’s too retro for you) but have no place in a theoretically stable
configuration.’ However, just as a top-down decision process enforced by rigid hierarchy is a hateful idea for a
workplace environment, so it is for a machine environment.</p>
<p>TL;DR - code in <a href="https://github.com/FuturePublishing/model-village">Github</a>, patches welcome.</p>
</div>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2014/01/15/treating-people-like-dicks-distance-learning-edition/">Treating People Like Dicks (Distance Learning Edition)</a></h1>
<p class="meta">
<time datetime="2014-01-15T20:58:00+00:00" pubdate data-updated="true">Jan 15<span>th</span>, 2014</time>
</p>
</header>
<div class="entry-content"><p>Today one of the old Solaris boxes expired. Well, I say ‘box’ and ‘expired’. I mean ‘1U
Solaris-X86-what-were-we-thinking machine’ and ‘fell into maintenance mode while I was eating breakfast’. And, in a
truly extraordinary amount of digression and rambling, when I say ‘what were we thinking’ I probably mean ‘The kit had
actually managed to serve MySQL tolerably reliably for some 1500 days.’</p>
<p>I don’t know if you lot remember the uptime wars, but they were medium sized in the late nineties. Rather like Sleeper
or Menswear, but with fewer annoying tunes and rather more waiting around. We learned better as soon as someone equated
long uptimes with being an obvious target for some bollix with a copy of Metasploit.</p>
<p>Anyway. A machine that hadn’t been restarted since it was shoved in a rack, that was host to a pile of Solaris zones.
What could possibly have gone wrong with that?</p>
<p>It transpired that one set of binary logs or another had experienced a Jolly Interesting Time and had managed to confuse
the zpool enough that the alleged hypervisor had thrown a strop and gone into maintenance mode. Which, um, <em>okay…</em></p>
<p>Thankfully there are no beard-fondling Solaris types around to tell me that the next move was a Bad Idea, but mucking
out the disks, clearing maintenance mode and restarting the beast looked to be the least-worst option.</p>
<p>That is until we discover that the running network config had never been written back to various bits of /etc and indeed
there were no build notes or valid excuses on either the deceased wiki or the somewhat shiny new one.</p>
<p>There now followed a swearing competition.</p>
<p>I suspect that what happened in 2009 was pretty much like what happened this morning. After the eighth or twelfth reboot, the
people wanting the databases back won over ‘I would like to make this network config survive a reboot surely the
combined wit of the Sun/Oracle doc and three dozen assorted blogs and HOWTOs can’t all be missing the vital something
or other that we can’t spot either…’</p>
<p>It’s still an unpleasant trick, though.</p>
</div>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2013/10/28/short-commercial-break/">Short Commercial Break</a></h1>
<p class="meta">
<time datetime="2013-10-28T23:24:00+00:00" pubdate data-updated="true">Oct 28<span>th</span>, 2013</time>
</p>
</header>
<div class="entry-content"><p><em>Trigger warning: contains talk of horrible old Unix kit running horrible old Unix</em></p>
<p>There’s a good chance I’m probably a massive arsehole and I get paid for it. Which, I dunno, maybe I’m supposed to be
pleased with myself about it because being <em>disruptive</em> is seen as a good thing these days. The last time I came across
people being described as such, they were the hyperactive (or just sugared-up) kids at junior school who seemed to be
convinced that it was all about them and if it wasn’t they’d throw a massive strop and wander round with a lower lip
hung out like a soup-plate. I’m assuming a <em>disruptive technology</em> doesn’t have a howling fit in the middle of the
organic vegetable section of the supermarket if it doesn’t get its own way, but then I wouldn’t be surprised if it did.</p>
<p>The thing about the arseholedom isn’t malevolent in the slightest, it’s more a case of going up to someone and asking
them why they’re nailing their legs to the table. You get this very weird selection of looks when you do things like
that. As if they’re expecting you to come up with something sarcastic about using the contact adhesive on the shelf.
Then they’ll say something like ‘Well we’ve <em>always</em> nailed our legs to the table in this department because it keeps
the bees from flying to Winchcombe.’ Which, um, <em>okay…</em></p>
<p>I mean, there’s no answer to that. Especially when some manager piles out of the end office going “D’you want the bees
to go to Winchcombe? Do you? Because that’s what’s going to happen if you don’t buck your ideas up and crack on with
that hammering.”</p>
<p>But you have to try. You point to one of the chairs in the corner and suggest that using those would be much less
unpleasant. That’s when the trouble <em>really</em> starts. The manager goes pop-eyed and kicks off about ‘You smart buggers in
IT think you know everything coming down here with your <em>ideas</em> I don’t have time for <em>ideas</em> there’s barely enough time
to send Bob here down to the hardware shop for more nails, what with the bleeding and the Tetanus jabs and now you want
us to cross-train to <em>chairs</em> I’m glad you think we all sit around with glue-guns like you wasters someone should sort
you lot out once and for all.’</p>
<p>So you pull a chair over and they look at you like you just shat out a railway station.</p>
<p>What this is really about is that years ago (HP-UX 10.20 ago, in fact) I was given a HP9000 to look after. In poking
around the filesystem to see what dreadful sort of albatross I’d been handed, I found a whole pile of cron-jobs that ran
scripts to monitor sendmail and some more scripts that re-started sendmail and further scripts that tested the state of
earlier scripts. It all seemed a bit pointless because even then sendmail could more or less be left alone to generate
remote root exploits and sometimes deliver mail.</p>
<p>I asked one of the longer-serving chaps and he came over all leg-nailing. Apparently it wasn’t to be touched because
sendmail was dreadfully unreliable and crashed every half hour.</p>
<p>I nodded, smiled and went off to throw away all the junk and upgrade the sendmail install to $latest.</p>
<p>It didn’t crash.</p>
<p>The point being that writing long-lived daemon processes is really very well known science and instead of mucking about
with multiple layers of monitoring and backup, you’re much better off making the daemon work right.</p>
</div>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2013/10/27/there-are-2-hard-problems-in-computer-science-caching/">There Are Two Hard Problems in Computer Science: Caching</a></h1>
<p class="meta">
<time datetime="2013-10-27T23:18:00+00:00" pubdate data-updated="true">Oct 27<span>th</span>, 2013</time>
</p>
</header>
<div class="entry-content"><p><em>Title stolen from one of the myriad on the internet more cleverer and witty than wot I am. However, Octopress seems to
have added its own twist, so you’ll have to do the rest of the ‘joke’ yourselves…</em></p>
<p>Years ago, not long after a visit to the Anarchist Bookshop and having become mildly peeved with the names of computers at Previous Employ (The failover pair named after the (in)appropriate Southpark characters, the ones that were funny if you were twelve… Mind, we <em>were</em> all twelve; that was part of the fun. Mind also that our American management decided to call us all ‘spanners’ because of I don’t know what made up terrible morale-boosting exercise. Tip for the MBAs out there - if your entire English team has a fit of the giggles in an ‘all hands’, you have just said something hysterically inappropriate and they are <em>not</em> going to let on until you have the t-shirts printed), I started naming kit I built after anarchists. I think I got as far as kropotkin and bakunin before the option of voluntary redundancy came up and I followed my political convictions and ran pell-mell towards the £MONEY.</p>
<p>The Americans had something of a sense of humour failure (or actually maybe they didn’t in retrospect) and started naming machines nasdaq, bourse et al.</p>
<p>Last year, self & Sam(oth) start calling the notion of Devops, ‘anarcho-syndicalism in action’.</p>
<p>Actually, I think he found the reference elsewhere, but it totally struck home because a lot of the alleged problems that the modern middle class while male technocratic elite have to put up with (only decent latte halfway across town, nowhere to dry yr bike kit in the office) are best approached with an eye to Solidarity (with other teams. Don’t let ‘managers’ or ‘stakeholders’ play at divide and conquer), Direct Action (fix those problems yourselves. You know your environment best. ‘Management’ ‘control’ is bollocks) and Worker’s Self-Management (do not replicate process with code. Optimise it out. Build the environment in which you wish to work. No-one will do it for you.)</p>
<p>And, obviously, this is a debased and pitiful version of a full-on political movement. Which is generally home to misogynistic rape-apologist dickheads it seems. (Who act like the polis at the first sign of trouble because that’s the only model of dissent-management they have. There is a policeman inside all of our heads it must be stopped.)</p>
<p>You may imagine my lack of surprise at discovering a tool called ‘Serf’ which lives at ‘serfdom.io’</p>
<p>Again, that could well be irony so sufficiently advanced that it is indistinguishable from reality. However, such
Hayek-followers as I have come across didn’t hold with that sort of malarkey.</p>
<p>I guess this sort of thinking fits in well with the sort of sods who talk about being ‘disruptive’ but actually just want other people to provide free services for which they can charge rent.</p>
<p>There’s probably another ‘talk’ in this, but I think it’s the sort of thing better done by the likes of Shanley Kane.</p>
</div>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2013/06/28/giving-stuff-away-on-the-internet-is-probably-a-good-thing/">Giving Stuff Away on the Internet Is Probably a Good Thing.</a></h1>
<p class="meta">
<time datetime="2013-06-28T16:51:00+01:00" pubdate data-updated="true">Jun 28<span>th</span>, 2013</time>
</p>
</header>
<div class="entry-content"><p>For reasons that will become sadly apparent when these posts are read in the wrong order, I’ve been engaged in the job of interviewing people who’ve expressed interest in the notion of coming to work for Future. At least one of those people was keen to point out that they’d been looking at our code on Github and was keen to come along and play with it.</p>
<p>Which was nice.</p>
</div>
</article>
<div class="pagination">
<a class="prev" href="/blog/page/2/">← Older</a>
<a href="/blog/archives">Blog Archives</a>
</div>
</div>
<aside class="sidebar">
<section>
<h1>Recent Posts</h1>
<ul id="recent_posts">
<li class="post">
<a href="/blog/2018/10/14/not-invented-here-kubernetes-remix/">Not Invented Here (Kubernetes remix)</a>
</li>
<li class="post">
<a href="/blog/2018/10/14/technical-intermission/">Technical intermission</a>
</li>
<li class="post">
<a href="/blog/2018/10/13/more-and-slash-or-different-tumbleweed/">More and/or different tumbleweed</a>
</li>
<li class="post">
<a href="/blog/2017/04/05/stirrings-from-the-pit-dns/">Stirrings from the pit: DNS</a>
</li>
<li class="post">
<a href="/blog/2015/11/20/tumbleweed/">Tumbleweed</a>
</li>
</ul>
</section>
<section>
<h1>GitHub Repos</h1>
<ul id="gh_repos">
<li class="loading">Status updating…</li>
</ul>
<a href="https://github.com/hirez">@hirez</a> on GitHub
<script type="text/javascript">
$(document).ready(function(){
if (!window.jXHR){
var jxhr = document.createElement('script');
jxhr.type = 'text/javascript';
jxhr.src = '/javascripts/libs/jXHR.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(jxhr, s);
}
github.showRepos({
user: 'hirez',
count: 0,
skip_forks: true,
target: '#gh_repos'
});
});
</script>
<script src="/javascripts/github.js" type="text/javascript"> </script>
</section>
<section>
<h1>Latest Tweets</h1>
<ul id="tweets">
<li class="loading">Status updating…</li>
</ul>
<script type="text/javascript">
$.domReady(function(){
getTwitterFeed("_JHR_", 4, false);
});
</script>
<script src="/javascripts/twitter.js" type="text/javascript"> </script>
<a href="http://twitter.com/_JHR_" class="twitter-follow-button" data-show-count="false">Follow @_JHR_</a>
</section>
</aside>
</div>
</div>
<footer role="contentinfo"><p>
Copyright © 2018 - Bodge and Guesswork -
<span class="credit">Powered by <a href="http://octopress.org">Octopress</a></span>
</p>
</footer>
<script type="text/javascript">
(function(){
var twitterWidgets = document.createElement('script');
twitterWidgets.type = 'text/javascript';
twitterWidgets.async = true;
twitterWidgets.src = 'http://platform.twitter.com/widgets.js';
document.getElementsByTagName('head')[0].appendChild(twitterWidgets);
})();
</script>
</body>
</html>