Compare commits
2 Commits
main
...
feat/old-w
| Author | SHA1 | Date | |
|---|---|---|---|
|
9e90135b00
|
|||
|
ac8b6d8f9a
|
@@ -232,13 +232,14 @@
|
||||
gather_facts: false
|
||||
hosts: control
|
||||
tasks:
|
||||
- name: Remove schedule taint to nodes.
|
||||
# This makes sure Hetzer gives the nodes a proper Provider ID.
|
||||
- name: Add schedule taint to nodes.
|
||||
kubernetes.core.k8s_taint:
|
||||
state: absent
|
||||
state: present
|
||||
name: "{{ item }}"
|
||||
taints:
|
||||
- key: node.cloudprovider.kubernetes.io/uninitialized
|
||||
value: true
|
||||
value: "true"
|
||||
effect: NoSchedule
|
||||
loop: [node-a, node-b]
|
||||
|
||||
@@ -264,3 +265,28 @@
|
||||
state: present
|
||||
update_repo_cache: true
|
||||
values_files: [IngressValues.yml]
|
||||
|
||||
- name: Connect DNS to the Load Balancer.
|
||||
gather_facts: false
|
||||
vars_files:
|
||||
- ../vault.yml
|
||||
hosts: localhost
|
||||
tasks:
|
||||
- name: Get the IP address of the LB.
|
||||
hetzner.hcloud.load_balancer_info:
|
||||
api_token: "{{ secrets.hcloud_token }}"
|
||||
name: "hetzner-lb"
|
||||
register: hetzner_lb_info
|
||||
|
||||
- name: Connect DNS.
|
||||
vars:
|
||||
ip_address: "{{ hetzner_lb_info.hcloud_load_balancer_info[0].ipv4_address }}"
|
||||
hetzner.hcloud.zone_rrset:
|
||||
api_token: "{{ secrets.hcloud_token }}"
|
||||
zone: "{{ secrets.zone_name }}"
|
||||
name: "{{ item }}"
|
||||
type: A
|
||||
records:
|
||||
- value: "{{ ip_address }}"
|
||||
state: present
|
||||
loop: ["*", "@"]
|
||||
|
||||
51
templates/HelloService.yml.jinja2
Normal file
51
templates/HelloService.yml.jinja2
Normal file
@@ -0,0 +1,51 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: hello-app
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: hello
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: hello
|
||||
spec:
|
||||
containers:
|
||||
- name: hello
|
||||
image: hashicorp/http-echo
|
||||
args: ["-text=Hello from Kubernetes!"]
|
||||
ports:
|
||||
- containerPort: 5678
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: hello-service
|
||||
spec:
|
||||
selector:
|
||||
app: hello
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 5678
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: hello-ingress
|
||||
annotations:
|
||||
nginx.ingress.kubernetes.io/rewrite-target: /
|
||||
spec:
|
||||
ingressClassName: nginx
|
||||
rules:
|
||||
- host: hello.maximhutz.com
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: hello-service
|
||||
port:
|
||||
number: 80
|
||||
@@ -11,7 +11,7 @@ controller:
|
||||
load-balancer.hetzner.cloud/use-private-ip: "true"
|
||||
load-balancer.hetzner.cloud/protocol: "https"
|
||||
load-balancer.hetzner.cloud/network-zone: "eu-central"
|
||||
load-balancer.hetzner.cloud/http-certificates: "managed_cert"
|
||||
load-balancer.hetzner.cloud/http-certificates: "Main Certificate"
|
||||
load-balancer.hetzner.cloud/http-redirect-http: "true"
|
||||
enableHttp: false
|
||||
targetPorts:
|
||||
|
||||
@@ -22,6 +22,6 @@ resource "hcloud_network_route" "gateway" {
|
||||
|
||||
// A managed certificate for the domain, to be used by the load balancer.
|
||||
resource "hcloud_managed_certificate" "managed_cert" {
|
||||
name = "managed_cert"
|
||||
name = "Main Certificate"
|
||||
domain_names = ["*.${local.domain}", "${local.domain}"]
|
||||
}
|
||||
|
||||
72
vault.yml
72
vault.yml
@@ -1,36 +1,38 @@
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
66346130316130363833656139333733306135303061323864643937636639326333316235303262
|
||||
3236323131623963633431333334663933653665376635360a383561366230666365323732383032
|
||||
32643731613032616362313561633337336266633161326636366363346638613638643830316438
|
||||
6130653230323362330a316231346462323366386539316566653139633937326364363030663631
|
||||
31343239663464363366363261616631383935323161636630646132316230646332613461323366
|
||||
31393235623932636366373961313538663733363565663363346534363063396632336261356265
|
||||
34633064383364393664336639653461636666393662633031616165396537396466643461393862
|
||||
64613862616663343565393836333834393463623335643139373966366236363262646461666365
|
||||
38373331613461376431343934333761333436373664623831366261363835323437363033386363
|
||||
36633862343134323130656465386462646235393833376563343161313130333536333733636636
|
||||
66353162393639343765396464666130306530333030386564363361356364616338363865636565
|
||||
33393233636631643563316336653461343733313266653433316265383661653264626666393830
|
||||
39666239333965383464653766333263306439653231653163323130333437336432353666366531
|
||||
64613737346336643263306538353131343030356164323237623937633238666336306165646231
|
||||
38383837313963626531653236376530313563363333313330653439393733396136333937313061
|
||||
36386131396337313131333730326639366439373933626130626537353265306434666265373063
|
||||
32313832613632346563346565656366336430663762316437376461656639346634306663326165
|
||||
34653534623031396564326563303132626562326131666337643839633366306462643436323635
|
||||
66666665383332336636356639373863663237303064386533653837636466313461376438383238
|
||||
39616434363263646235336432323139326139346364616431626532313861666266373836396363
|
||||
33356137363130396237353931316137653066303930353733356432356664636431306165646136
|
||||
37643666373532393936333064306661363331666332336363623430366435313962646563616261
|
||||
34613166393764343830303733333033643563333032303536326131323461383535353134643036
|
||||
38306531383135633431633863346465613333663433343433363633636439326636643938373265
|
||||
65643066646364613230396536623537663961356531653164303134383736323064363637353738
|
||||
31356630376635633930353239306633326432383031373632346234373536666431653963653566
|
||||
35353163373938383736396135386266653636383066636637376238316139346239653234363830
|
||||
64663432663339346634323366366138306133326562643736373964326265393537326663386364
|
||||
61373039313739343031623134613435656461616165386430366333346161666530376338663961
|
||||
32353231656162393138653837663863653562626236393630316635363537306130346238313161
|
||||
64613566363163363966653533333664643633656533613939616533336136376635333336333233
|
||||
39373638363538636632656133363864653136613231613532313531643565396237306338353263
|
||||
33616132666364663036643437326463633265316236323835323039336361393739653361373632
|
||||
37336162353635643333373937346333373433346333613133633936616430666637613235623937
|
||||
636334616134303130303561633437353736
|
||||
33653833333639353437316264356533353739383838306564656334653238636239633366393665
|
||||
6239383662613562396562326238663733633962303365630a663235633337613137636563353932
|
||||
31626533303532613566356638346663643337393839653536613866386339666537643435396133
|
||||
3030373532333061300a323835623262626531663666386130333034316237626635306536303764
|
||||
33343338333234383937363064616364623864353338653366623333356336333939656433373663
|
||||
65653433386435313634653037623462636333303535373432306463353833663466653236363630
|
||||
32646664656634643331616331396230346263363838373133383737396461623434333837633832
|
||||
34653333373364396438376130383265373534383936373131646437333535306631386662626439
|
||||
31336634343466333732343639353239656632356632663333663464303965656563343737376630
|
||||
61343337353561386139653739313562643738306535636264623430396365323531373133663063
|
||||
37393330313461613865313633363136383663643331356461633662626232613937393761393561
|
||||
32663437393332643334356330386536663965303634646261393137316662653637623064353263
|
||||
66366234303664373861343766363563303539646239366637303666323062616339653234306438
|
||||
32636237346563646365393636383964663336653833323566316135373463383933623037653563
|
||||
32626263323136333330393735363839333062303963316364626363323330363735356266653834
|
||||
61303339373965653964383331646664353130363131303664313433303131386138646236663966
|
||||
63353463393538303939383566396264623739633331383834323334626635636231353930313838
|
||||
32346134643830613365613337613331386533356633386630616562653264326531383632646463
|
||||
66373465393336643538373935373738376665656561316162386238393433613465643132373032
|
||||
36393665643166336265643730383833343064306432626233356639303832326463613164643361
|
||||
65633336613130643330633062373865303763616132643337333261643438323662626261313237
|
||||
30663963633364353933623134363062643565393766323465643130613234646535386462333763
|
||||
31653737613334653231356634316532626530376530363562363439373831663065623830663739
|
||||
37613165626630323262306335306136376639623238633635613430373065303766386131616235
|
||||
62323739363564386138336330373930333462306231323238613363623233326164623130383338
|
||||
31303733663165346532323839353364643833646633333562303932373161613263323930363963
|
||||
34623732613465386563376433656330663039346162643130333866333431313733646263623234
|
||||
36646662646630666436633862643161393561646236333437323231646134376338633664356664
|
||||
39346434636262636663313232633733396464383666633730363438356638636533633937396236
|
||||
39623739383239636365353364373438383334363636613864663932303863326266373666623130
|
||||
39643833323637393837363365343363396534326461656433646562323765356339346437383262
|
||||
31353636316530393935666266383834376236316633643630306462666531396263643261643833
|
||||
64326530316636376230306234336233373361333933613233643937306333306361323938636264
|
||||
66306565316663623862616331656532626165363732646137366338653561626261653763356166
|
||||
63356336623761613731306464636438346462623535306431646666623061376565353132303765
|
||||
64353265396137663264626264333439376538373634636533383338376134306561636339623437
|
||||
6466
|
||||
|
||||
Reference in New Issue
Block a user