-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhope.yaml
1358 lines (1358 loc) · 42.2 KB
/
hope.yaml
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
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Pile of anchors to use just so configurable values are all kept in one spot.
# Could eventually be replaced with something like a constants/variables key
# that could live here, but this does what it needs to.
_:
- &log_level trace
- &metallb_address_range ADDRESS_RANGE=192.168.200.32-192.168.200.224
- &ingress_controller_service_ip LOAD_BALANCER_IP=192.168.200.64
- &ingress_controller_external_service_ip LOAD_BALANCER_IP=192.168.200.129
- &plex_load_balancer_service_ip LOAD_BALANCER_IP=192.168.200.69
- &gitea_load_balancer_service_ip LOAD_BALANCER_IP=192.168.200.126
- &wireguard_load_balancer_service_ip LOAD_BALANCER_IP=192.168.200.123
- &pihole_ingress_controller_ip INGRESS_IP=192.168.200.64
- &unifi_controller_service_ip LOAD_BALANCER_IP=192.168.200.82
- &unifi_controller_inform_url http://192.168.200.82:8080
- &devbox_service_ip LOAD_BALANCER_IP=192.168.200.224
- &vm_builder_service_ip LOAD_BALANCER_IP=192.168.200.222
- &pihole_load_balancer_service_ip LOAD_BALANCER_IP=192.168.200.217
- &docker_hub_upstream_pull if-not-present
- &local_upstream_pull always
access_point_controller: *unifi_controller_inform_url
access_points:
vms:
root: vms
cache: /var/lib/packer/cache
output: /var/lib/packer/images
images:
- name: load-balancer
hypervisors: [beast1]
parameters:
- ESXI_USERNAME=root
- ESXI_ROOT_PASSWORD
- SERVER_SSH_KEYS_DIR=/var/lib/packer/etc/ssh
- ESXI_NETWORK=VM Network
- VM_ROOT_PASSWORD
- VM_MANAGEMENT_PASSWORD
- LOAD_BALANCER_IP
- name: kubernetes-node-12.6.0-1.22.17
hypervisors: [beast1]
parameters:
- ESXI_USERNAME=root
- ESXI_ROOT_PASSWORD
- SERVER_SSH_KEYS_DIR=/var/lib/packer/etc/ssh
- ESXI_NETWORK=VM Network
- VM_ROOT_PASSWORD
- VM_MANAGEMENT_PASSWORD
- LOAD_BALANCER_IP
- name: kubernetes-node-12.6.0-1.23.17
hypervisors: [beast1]
parameters:
- ESXI_USERNAME=root
- ESXI_ROOT_PASSWORD
- SERVER_SSH_KEYS_DIR=/var/lib/packer/etc/ssh
- ESXI_NETWORK=VM Network
- VM_ROOT_PASSWORD
- VM_MANAGEMENT_PASSWORD
- LOAD_BALANCER_IP
- DEBIAN_VERSION=12.6.0
- DEBIAN_SHA512=712cf43c5c9d60dbd5190144373c18b910c89051193c47534a68b0cd137c99bd8274902f59b25aba3b6ba3e5bca51d7c433c06522f40adb93aacc5e21acf57eb
- KUBERNETES_VERSION=1.23.17
load_balancer_host: api.internal.aleemhaji.com
nodes:
- name: beast1
role: hypervisor
engine: esxi
host: 192.168.10.40
user: root
datastore: Main
network: Kubernetes Network
- name: beast2
role: hypervisor
engine: esxi
host: 192.168.10.41
user: root
datastore: Main
network: Kubernetes Network
- name: home-load-balancer
role: load-balancer
hypervisor: beast1
cpu: 1
memory: 256
user: packer
- name: home-master-01
role: master
hypervisor: beast1
cpu: 2
memory: 4096
user: packer
- name: home-master-02
role: master
hypervisor: beast1
cpu: 2
memory: 4096
user: packer
- name: home-master-03
role: master
hypervisor: beast1
cpu: 2
memory: 4096
user: packer
- name: home-node-01
role: node
hypervisor: beast1
cpu: 2
memory: 8192
user: packer
- name: home-node-02
role: node
hypervisor: beast1
cpu: 2
memory: 8192
user: packer
- name: home-node-03
role: node
hypervisor: beast1
cpu: 2
memory: 8192
user: packer
- name: home-node-04
role: node
hypervisor: beast1
cpu: 2
memory: 8192
user: packer
- name: home-node-05
role: node
hypervisor: beast1
cpu: 2
memory: 8192
user: packer
- name: home-node-06
role: node
hypervisor: beast1
cpu: 2
memory: 8192
user: packer
# Provide extra capacity while cycling other nodes.
- name: home-node-temp
role: node
hypervisor: beast1
cpu: 2
memory: 8192
user: packer
- name: home-master-temp
role: master
hypervisor: beast1
cpu: 2
memory: 4096
user: packer
loglevel: *log_level
pod_network_cidr: 10.244.0.0/16
resources:
# region: Namespaces
- name: default-namespace
file: infra/namespace.yaml
parameters:
- NAMESPACE=default
- DOCKER_REGISTRY_HOSTNAME
- DOCKER_CONFIG_JSON_FILE_CONTENTS_BASE64
- SLACK_BOT_ALERTING_CHANNEL
- INCLUDE_EXTERNAL_CERTS=true
- INCLUDE_BARE_DOMAIN=true
- POD_KILLER_CONTAINER_RESTART_LIMIT=10
- JOB_RETENTION_WINDOW=1 month
fileParameters:
- UPDATE_SECRETS_SCRIPT=infra/certbot-copy-script.sh
- POD_KILLER_SCRIPT=infra/pod-killer-script.sh
- JOBS_SHELL_MONITOR_SCRIPT=infra/delete-manual-jobs-script.sh
tags: [namespaces]
- name: dev-namespace
file: infra/namespace.yaml
parameters:
- NAMESPACE=dev
- DOCKER_REGISTRY_HOSTNAME
- DOCKER_CONFIG_JSON_FILE_CONTENTS_BASE64
- SLACK_BOT_ALERTING_CHANNEL
- INCLUDE_EXTERNAL_CERTS=false
- INCLUDE_BARE_DOMAIN=false
- POD_KILLER_CONTAINER_RESTART_LIMIT=10
- JOB_RETENTION_WINDOW=1 month
fileParameters:
- UPDATE_SECRETS_SCRIPT=infra/certbot-copy-script.sh
- POD_KILLER_SCRIPT=infra/pod-killer-script.sh
- JOBS_SHELL_MONITOR_SCRIPT=infra/delete-manual-jobs-script.sh
tags: [namespaces, rotate-node]
- name: monitoring-namespace
file: infra/namespace.yaml
parameters:
- NAMESPACE=monitoring
- DOCKER_REGISTRY_HOSTNAME
- DOCKER_CONFIG_JSON_FILE_CONTENTS_BASE64
- SLACK_BOT_ALERTING_CHANNEL
- INCLUDE_EXTERNAL_CERTS=false
- INCLUDE_BARE_DOMAIN=false
- POD_KILLER_CONTAINER_RESTART_LIMIT=10
- JOB_RETENTION_WINDOW=1 month
fileParameters:
- UPDATE_SECRETS_SCRIPT=infra/certbot-copy-script.sh
- POD_KILLER_SCRIPT=infra/pod-killer-script.sh
- JOBS_SHELL_MONITOR_SCRIPT=infra/delete-manual-jobs-script.sh
tags: [namespaces, monitoring]
- name: kube-system-namespace
file: infra/namespace.yaml
parameters:
- NAMESPACE=kube-system
- DOCKER_REGISTRY_HOSTNAME
- DOCKER_CONFIG_JSON_FILE_CONTENTS_BASE64
- SLACK_BOT_ALERTING_CHANNEL
- INCLUDE_EXTERNAL_CERTS=false
- INCLUDE_BARE_DOMAIN=false
- POD_KILLER_CONTAINER_RESTART_LIMIT=10
- JOB_RETENTION_WINDOW=1 month
fileParameters:
- UPDATE_SECRETS_SCRIPT=infra/certbot-copy-script.sh
- POD_KILLER_SCRIPT=infra/pod-killer-script.sh
- JOBS_SHELL_MONITOR_SCRIPT=infra/delete-manual-jobs-script.sh
tags: [namespaces]
- name: kubernetes-dashboard-namespace
file: infra/namespace.yaml
parameters:
- NAMESPACE=kubernetes-dashboard
- DOCKER_REGISTRY_HOSTNAME
- DOCKER_CONFIG_JSON_FILE_CONTENTS_BASE64
- SLACK_BOT_ALERTING_CHANNEL
- INCLUDE_EXTERNAL_CERTS=false
- INCLUDE_BARE_DOMAIN=false
- POD_KILLER_CONTAINER_RESTART_LIMIT=10
- JOB_RETENTION_WINDOW=1 month
fileParameters:
- UPDATE_SECRETS_SCRIPT=infra/certbot-copy-script.sh
- POD_KILLER_SCRIPT=infra/pod-killer-script.sh
- JOBS_SHELL_MONITOR_SCRIPT=infra/delete-manual-jobs-script.sh
tags: [namespaces]
- name: tasks-namespace
file: infra/namespace.yaml
parameters:
- NAMESPACE=tasks
- DOCKER_REGISTRY_HOSTNAME
- DOCKER_CONFIG_JSON_FILE_CONTENTS_BASE64
- SLACK_BOT_ALERTING_CHANNEL
- INCLUDE_EXTERNAL_CERTS=false
- INCLUDE_BARE_DOMAIN=false
- POD_KILLER_CONTAINER_RESTART_LIMIT=10
- JOB_RETENTION_WINDOW=1 month
fileParameters:
- UPDATE_SECRETS_SCRIPT=infra/certbot-copy-script.sh
- POD_KILLER_SCRIPT=infra/pod-killer-script.sh
- JOBS_SHELL_MONITOR_SCRIPT=infra/delete-manual-jobs-script.sh
tags: [namespaces, rmq, tasks]
# endregion
- name: node-setup
file: infra/cluster/node-setup.yaml
- name: calico
file: infra/cluster/calico.yaml
tags: [network]
- name: dashboard
file: ./kubernetes-dashboard.yaml
tags: [apps, dashboard]
- name: metrics-server
file: metrics-server.yaml
- name: personal-service-account
inline: |
apiVersion: v1
kind: ServiceAccount
metadata:
name: aleem
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: aleem
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: aleem
namespace: kube-system
tags: [users]
- name: load-balancer
file: infra/cluster/metallb.yaml
tags: [network, load-balancer]
- name: load-balancer-config
inline: |
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: service-pool
namespace: metallb-system
spec:
addresses:
- ${ADDRESS_RANGE}
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: service-advertisement
namespace: metallb-system
---
apiVersion: v1
data:
secretkey: "${METALLB_SYSTEM_MEMBERLIST_SECRET_KEY_BASE64}"
kind: Secret
metadata:
name: memberlist
namespace: metallb-system
parameters:
- METALLB_SYSTEM_MEMBERLIST_SECRET_KEY_BASE64
- *metallb_address_range
tags: [network, load-balancer]
- name: ingress-controller
file: infra/cluster/nginx-ingress-daemonset-plus-tcp-udp-proxy.yaml
tags: [network, ingress, ingress-internal]
- name: ingress-controller-external
file: infra/cluster/nginx-ingress-daemonset-external.yaml
tags: [network, ingress, ingress-external]
- name: ingress-controller-configs
inline: |
apiVersion: v1
kind: ConfigMap
metadata:
name: tcp-services
data:
22: "default/gitea:22"
53: "default/pihole-tcp:53"
3306: "default/mysql:3306"
5432: "default/postgres:5432"
27017: "default/mongodb:27017"
---
apiVersion: v1
kind: ConfigMap
metadata:
name: udp-services
data:
53: "default/pihole-udp:53"
---
apiVersion: v1
kind: ConfigMap
metadata:
name: ingress-nginx-controller
namespace: ingress-nginx
data:
http-redirect-code: "302"
enable-real-ip: "true"
tags: [network, ingress, ingress-internal]
- name: ingress-controller-configs-external
inline: |
apiVersion: v1
kind: ConfigMap
metadata:
name: ingress-nginx-controller
namespace: ingress-nginx-external
data:
http-redirect-code: "302"
enable-real-ip: "true"
tags: [network, ingress, ingress-external]
- name: ingress-controller-service
inline: |
apiVersion: v1
kind: Service
metadata:
name: nginx-ingress-tcp
labels:
app: nginx-ingress
namespace: ingress-nginx
annotations:
metallb.universe.tf/allow-shared-ip: ingress
spec:
externalTrafficPolicy: Local
ports:
- port: 53
name: dns
protocol: TCP
- port: 80
name: http
protocol: TCP
- port: 443
name: https
protocol: TCP
- port: 3306
name: mysql
protocol: TCP
- port: 5432
name: postgres
protocol: TCP
- port: 27017
name: mongodb
protocol: TCP
- port: 51413
name: osstransmission
protocol: TCP
type: LoadBalancer
loadBalancerIP: ${LOAD_BALANCER_IP}
selector:
app.kubernetes.io/name: ingress-nginx
---
apiVersion: v1
kind: Service
metadata:
name: nginx-ingress-udp
labels:
app: nginx-ingress
namespace: ingress-nginx
annotations:
metallb.universe.tf/allow-shared-ip: ingress
spec:
externalTrafficPolicy: Local
ports:
- port: 53
name: dns
protocol: UDP
type: LoadBalancer
loadBalancerIP: ${LOAD_BALANCER_IP}
selector:
app.kubernetes.io/name: ingress-nginx
tags: [network, ingress, ingress-internal]
parameters:
- *ingress_controller_service_ip
- name: ingress-controller-service-external
inline: |
apiVersion: v1
kind: Service
metadata:
name: nginx-ingress-tcp
labels:
app: nginx-ingress
namespace: ingress-nginx-external
annotations:
metallb.universe.tf/allow-shared-ip: ingress-external
spec:
externalTrafficPolicy: Local
ports:
- port: 80
name: http
protocol: TCP
- port: 443
name: https
protocol: TCP
type: LoadBalancer
loadBalancerIP: ${LOAD_BALANCER_IP}
selector:
app.kubernetes.io/name: ingress-nginx
# ---
# apiVersion: v1
# kind: Service
# metadata:
# name: nginx-ingress-udp
# labels:
# app: nginx-ingress
# namespace: ingress-nginx-external
# annotations:
# metallb.universe.tf/allow-shared-ip: ingress-external
# spec:
# externalTrafficPolicy: Local
# ports:
# type: LoadBalancer
# loadBalancerIP: ${LOAD_BALANCER_IP}
# selector:
# app.kubernetes.io/name: ingress-nginx
tags: [network, ingress, ingress-external]
parameters:
- *ingress_controller_external_service_ip
- name: kubernetes-dashboard-ingress
inline: |
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
namespace: kubernetes-dashboard
name: dashboard-ingress-redirect
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/temporal-redirect: https://dashboard.internal.aleemhaji.com
spec:
rules:
- host: dashboard
- host: dashboard.home
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
namespace: kubernetes-dashboard
name: dashboard-ingress
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/backend-protocol: "https"
spec:
tls:
- hosts:
- dashboard.internal.aleemhaji.com
secretName: internal-certificate-files
rules:
- host: dashboard.internal.aleemhaji.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: kubernetes-dashboard
port:
number: 443
tags: [apps, dashboard]
- name: docker-registry-htpasswd-secrets
inline: |
apiVersion: v1
data:
htpasswd: ${DOCKER_HTPASSWD_FILE_CONTENTS_BASE64}
kind: Secret
metadata:
name: ${DOCKER_REGISTRY_HOSTNAME}-htpasswd
parameters:
- DOCKER_REGISTRY_HOSTNAME
- DOCKER_HTPASSWD_FILE_CONTENTS_BASE64
tags: [apps, registry]
- name: docker-registry
file: registry/registry.yaml
tags: [apps, registry]
# region: Docker Image Caching
# At this point, the registry has been pushed, and all the appropriate
# ingress configurations should be set to allow for images to be cached.
# Cache a bunch of images from Docker Hub to the local registry to prevent
# being rate limited during standard operations within the cluster.
# The main contributor to Docker Hub pulls may just be the crons, but if the
# cluster has tried enough pulls within the last 6 hours, just doing
# rudimentary dev work gets blocked.
# Rehosting the images on the cluster also helps steer things towards images
# being built from same base image any time the same tag appears, rather
# it being based on what base image the build host had at the time.
# Similar issues are possible, but are a little more controlled.
- name: ubuntu-1604-image-cache
build:
source: ubuntu:16.04
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/ubuntu:16.04
tags: [docker-cache, crons]
- name: ubuntu-2004-image-cache
build:
source: ubuntu:20.04
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/ubuntu:20.04
tags: [docker-cache, transmission]
- name: certbot-image-cache
build:
source: certbot/certbot:v1.32.2
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/certbot/certbot:v1.32.2
tags: [docker-cache, certbot]
- name: mongo-37-image-cache
build:
source: mongo:3.7
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/mongo:3.7
tags: [docker-cache, mongodb]
- name: mongo-36-image-cache
build:
source: mongo:3.6
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/mongo:3.6
tags: [docker-cache, mongodb, unifi]
- name: busybox-image-cache
build:
source: busybox:1.37.0
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/busybox:1.37.0
tags: [docker-cache, mysql, pihole]
- name: mysql-57-image-cache
build:
source: mysql:5.7.43
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/mysql:5.7.43
tags: [docker-cache, mysql]
- name: pihole-image-cache
build:
source: pihole/pihole:v5.8
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/pihole:v5.8
tags: [docker-cache, pihole]
- name: browser-image-cache
build:
source: klausmeyer/docker-registry-browser:1.7.0
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/docker-registry-browser:1.7.0
tags: [docker-cache, browser]
- name: postgres-image-cache
build:
source: postgres:9
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/postgres:9
tags: [docker-cache, postgres]
# This image has been pulled from dockerhub, so it has to be pulled from the
# local registry, and then re-tagged with the original tag for now.
- name: firefly-image-cache
build:
source: fireflyiii/core:version-5.7.15
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/fireflyiii-core:version-5.7.15
tags: [docker-cache, firefly]
- name: firefly-importer-image-cache
build:
source: fireflyiii/data-importer:version-0.9.17
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/fireflyiii-data-importer:version-0.9.17
tags: [docker-cache, firefly]
- name: heimdall-image-cache
build:
source: linuxserver/heimdall:2.6.1
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/heimdall:2.6.1
tags: [docker-cache, heimdall]
- name: plex-image-cache
build:
source: plexinc/pms-docker:1.40.5.8921-836b34c27
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/pms-docker:1.40.5.8921-836b34c27
tags: [docker-cache, plex]
- name: jellyfin-image-cache
build:
source: jellyfin/jellyfin:10.10.1
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/jellyfin/jellyfin:10.10.1
tags: [docker-cache, jellyfin]
- name: guacamole-image-cache
build:
source: guacamole/guacamole:1.5.5
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/guacamole:1.5.5
tags: [docker-cache, guacamole]
- name: guacd-image-cache
build:
source: guacamole/guacd:1.5.5
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/guacd:1.5.5
tags: [docker-cache, guacamole]
- name: gitea-image-cache
build:
source: gitea/gitea:1.22.3-rootless
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/gitea:1.22.3-rootless
tags: [docker-cache, gitea]
- name: kubectl-image-cache
build:
source: bitnami/kubectl:1.21.0
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/kubectl:1.21.0
tags: [docker-cache, kubectl, uptime-kuma]
- name: bitwarden-image-cache
build:
source: vaultwarden/server:1.32.0
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/vaultwarden/server:1.32.0
tags: [docker-cache, bitwarden, vaultwarden]
- name: syncthing-image-cache
build:
source: syncthing/syncthing:1.27.10
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/syncthing:1.27.10
tags: [docker-cache, syncthing]
- name: drone-image-cache
build:
source: drone/drone:2.24.0
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/drone/drone:2.24.0
tags: [docker-cache, drone]
- name: drone-agent-image-cache
build:
source: drone/drone-runner-kube:1.0.0-rc.3
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/drone/drone-runner-kube:1.0.0-rc.3
tags: [docker-cache, drone]
- name: wireguard-image-cache
build:
source: masipcat/wireguard-go:0.0.20230223
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/wireguard-go:0.0.20230223
tags: [docker-cache, wireguard]
- name: unifi-controller-image-cache
build:
source: linuxserver/unifi-controller:7.4.162
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/unifi-controller:7.4.162
tags: [docker-cache, unifi]
- name: uptime-kuma-image-cache
build:
source: louislam/uptime-kuma:1.23.15-alpine
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/louislam/uptime-kuma:1.23.15-alpine
tags: [docker-cache, uptime-kuma]
- name: nginx-image-cache
build:
source: nginx:1.27.1-alpine
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/nginx:1.27.1-alpine
tags: [docker-cache, knowledge]
- name: rabbitmq-image-cache
build:
source: rabbitmq:3.13.7-management-alpine
pull: *docker_hub_upstream_pull
tag: registry.internal.aleemhaji.com/rabbitmq:3.13.7-management-alpine
tags: [docker-cache, rmq]
# endregion
- name: pihole
file: pihole/pihole.yaml
parameters:
- *pihole_ingress_controller_ip
- *pihole_load_balancer_service_ip
tags: [apps, pihole]
# https://github.com/prometheus-operator/kube-prometheus#quickstart
- name: prometheus
file: opsbox.yaml
parameters:
- JOB_NAME=deploy-prometheus
- SCRIPT=cd /tmp; curl -fsSL https://github.com/prometheus-operator/kube-prometheus/archive/v0.10.0.tar.gz | tar xvz; cd kube-prometheus-0.10.0; kubectl create -f manifests/setup; until kubectl get servicemonitors --all-namespaces ; do date; sleep 1; echo ""; done; kubectl create -f manifests;
tags: [monitoring]
- name: prometheus-wait
job: kube-system/ops-deploy-prometheus
tags: [monitoring]
- name: grafana
file: grafana/grafana.yaml
tags: [monitoring]
# region: Stateless Services
# The set of services in this block are services that don't rely on storing
# any state on disk.
# These are grouped together so that they can be easily be pushed out to
# parallel clusters first without having any concern for services fighting
# over shares/volumes.
# They should each have the stateless tag applied to them.
- name: image-monitor-image
build:
path: image-monitor
pull: *local_upstream_pull
tag: registry.internal.aleemhaji.com/image-monitor:latest
tags: [apps, stateless, image-monitor]
- name: image-monitor-config
inline: |
apiVersion: v1
binaryData:
image-monitor.sh: ${IMAGE_MONITOR_SCRIPT}
image-monitor-ignore.json: ${IMAGE_MONITOR_IGNORE_JSON}
kind: ConfigMap
metadata:
name: image-monitor-config
fileParameters:
- IMAGE_MONITOR_SCRIPT=./image-monitor/image-monitor.sh
- IMAGE_MONITOR_IGNORE_JSON=./image-monitor/image-monitor-ignore.json
tags: [crons, image-monitor, stateless]
- name: image-monitor
file: image-monitor/image-monitor.yaml
parameters:
- SLACK_BOT_ALERTING_CHANNEL
tags: [crons, image-monitor, stateless]
- name: browser-secrets
inline: |
apiVersion: v1
data:
key_base: ${DOCKER_REGISTRY_BROWSER_SECRET_KEY_BASE_BASE64}
kind: Secret
metadata:
name: registry-browser-secrets
parameters:
- DOCKER_REGISTRY_BROWSER_SECRET_KEY_BASE_BASE64
- name: browser
file: browser/browser.yaml
tags: [apps, browser, stateless]
- name: slackbot-image
build:
path: slackbot
pull: *local_upstream_pull
tag: registry.internal.aleemhaji.com/slackbot:latest
tags: [apps, slackbot, stateless]
- name: slackbot-config
inline: |
apiVersion: v1
data:
alerting_channel: ${SLACK_BOT_ALERTING_CHANNEL}
default_channel: ${SLACK_BOT_DEFAULT_CHANNEL}
kind: ConfigMap
metadata:
name: slack-bot-config
---
apiVersion: v1
data:
api_key: ${SLACK_BOT_API_KEY_BASE64}
kind: Secret
metadata:
name: slack-bot-secrets
parameters:
- SLACK_BOT_ALERTING_CHANNEL
- SLACK_BOT_DEFAULT_CHANNEL
- SLACK_BOT_API_KEY_BASE64
tags: [apps, slackbot, stateless]
- name: slackbot
file: slackbot/slackbot.yaml
tags: [apps, slackbot, stateless]
- name: dns-update-secrets
inline: |
apiVersion: v1
data:
value: ${NAMESILO_API_KEY_BASE64}
kind: Secret
metadata:
name: namesilo-api-key
parameters:
- NAMESILO_API_KEY_BASE64
tags: [crons, dns, certbot, stateless]
- name: dns-manager
file: dns-operator.yaml
tags: [dns, stateless]
- name: latex-image
build:
path: latex
pull: *local_upstream_pull
tag: registry.internal.aleemhaji.com/latex-server:latest
tags: [apps, latex, stateless]
- name: latex-server
file: latex/latex.yaml
tags: [apps, latex, stateless]
# endregion
# region: NFS-Share Only Services
# These services are grouped because they have a pretty small number of
# dependencies outside the cluster itself.
# These can easily be stopped in one cluster, and started in another without
# the need to coordinate ordering with other services in the cluster.
# Disks management is also entirely outside the responsibility of these
# pods, so they're a bit lower maintenance.
# This block should only list services that are internally-accessible.
# Anything that's exposed publicly shouldn't be considered NFS-share only.
- name: heimdall
file: heimdall/heimdall.yaml
tags: [apps, heimdall]
- name: tedbot-config
inline: |
apiVersion: v1
data:
slack_webhook_url: ${SLACK_TEDBOT_APP_WEBHOOK_BASE64}
kind: Secret
metadata:
name: tedbot-secrets
parameters:
- SLACK_TEDBOT_APP_WEBHOOK_BASE64
tags: [crons, tedbot]
- name: tedbot
file: tedbot/tedbot.yaml
tags: [crons, tedbot]
- name: gitea
file: gitea/gitea.yaml
parameters:
- *gitea_load_balancer_service_ip
tags: [apps, gitea]
- name: bitwarden-config
inline: |
apiVersion: v1
data:
admin_token: ${BITWARDEN_ADMIN_TOKEN_BASE64}
kind: Secret
metadata:
name: bitwarden-secrets
parameters:
- BITWARDEN_ADMIN_TOKEN_BASE64
tags: [apps, bitwarden, vaultwarden]
- name: bitwarden
file: bitwarden/bitwarden.yaml
tags: [apps, bitwarden, vaultwarden]
- name: uptime-kuma
file: uptime-kuma/uptime-kuma.yaml
tags: [apps, uptime-kuma]
- name: uptime-kuma-backup
file: uptime-kuma/uptime-kuma-backup.yaml
fileParameters:
- BACKUP_SCRIPT=uptime-kuma/backup.js
tags: [apps, uptime-kuma]
- name: knowledge-service
file: barebones-nginx/service.yaml
parameters:
- NAME=knowledge
tags: [apps, web, knowledge]
- name: knowledge-ingress
file: barebones-nginx/internal-ingress.yaml
parameters:
- NAME=knowledge
tags: [apps, web, knowledge]
# endregion
# region: NFS-Share + Port Forwarded Services
# This block of services include resources that need access to shared
# storage, but also have a port forward configured for them.
# Deploying these resources will require a little bit of extra care, as they
# will be temporarily unreachable on whatever port they're talking
# externally through.
# These shouldn't have any database dependencies, but can have NFS and
# ingress.
- name: transmission-image
build:
path: transmission
pull: *local_upstream_pull
tag: registry.internal.aleemhaji.com/transmission:2004
tags: [apps, transmission]
- name: osstransmission
file: transmission/transmission.yaml
tags: [apps, transmission]
- name: plex
file: plex/plex.yaml
parameters:
- *plex_load_balancer_service_ip
tags: [apps, plex]
- name: jellyfin
file: jellyfin/jellyfin.yaml
tags: [apps, jellyfin]
- name: wireguard
file: wireguard/wireguard.yaml
parameters:
- *wireguard_load_balancer_service_ip
- WIREGUARD_SERVER_IP=172.27.224.1
- WIREGUARD_CLIENT_IP_CIDR=172.27.224.0/24
- WIREGUARD_SERVER_PRIVATE_KEY
- WIREGUARD_PEER_1_PUBLIC_KEY
- WIREGUARD_PEER_1_IP=172.27.224.32/32
tags: [apps, wireguard]
# endregion
# region: Databases
# This section contains definitions for databases.
# These resources will typically need to refer to block storage that's been
# exposed via another piece of hardware that's outside the scope of hope,
# for now.
# These resources will be consumed by others, so they appear in this file
# before any of the services that consume them.
# The number of dependencies they have may make migrations a bit more of a
# challenge.
- name: postgres-config
inline: |
apiVersion: v1
data:
root_password: ${POSTGRES_ROOT_PASSWORD_BASE64}
kind: Secret
metadata:
name: postgres-secrets
parameters:
- POSTGRES_ROOT_PASSWORD_BASE64
tags: [apps, postgres]
- name: postgres
file: postgres/postgres.yaml
tags: [apps, postgres]
- name: mysql-config
inline: |
apiVersion: v1
data:
root_password: ${MYSQL_ROOT_PASSWORD_BASE64}
kind: Secret
metadata:
name: mysql-secrets
parameters:
- MYSQL_ROOT_PASSWORD_BASE64
tags: [apps, mysql]
- name: mysql-backup
inline: |
apiVersion: v1
kind: ConfigMap
metadata:
name: mysql-backup
binaryData:
mysql-backup.sh: ${MYSQL_BACKUP_SCRIPT}
fileParameters:
- MYSQL_BACKUP_SCRIPT=mysql/mysql-backup.sh
tags: [apps, mysql, backups]
- name: mysql
file: mysql/mysql.yaml
tags: [apps, mysql]
- name: mongodb-backup
inline: |
apiVersion: v1
kind: ConfigMap
metadata:
name: mongodb-backup
binaryData:
mongodb-backup.sh: ${MONGODB_BACKUP_SCRIPT}
tags: [apps, mongodb, backups]
fileParameters:
- MONGODB_BACKUP_SCRIPT=mongodb/mongodb-backup.sh
- name: mongodb
file: mongodb/mongodb.yaml
tags: [apps, mongodb]
- name: rabbitmq-config
inline: |
apiVersion: v1
kind: Secret
metadata:
name: rabbitmq-secrets
namespace: tasks
data:
username: ${RMQ_USERNAME_BASE64}
password: ${RMQ_PASSWORD_BASE64}
.erlang-cookie: ${RMQ_PASSWORD_BASE64}
connection_string: ${RMQ_CONNECTION_STRING_BASE64}
management_connection_string: ${RMQ_MANAGEMENT_CONNECTION_STRING_BASE64}
---
apiVersion: v1
kind: ConfigMap
metadata: