feat: got it all working
This commit is contained in:
@@ -38,7 +38,7 @@
|
|||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
state: present
|
state: present
|
||||||
update_cache: true
|
update_cache: true
|
||||||
name: [cri-o, kubelet, kubeadm, kubectl, python3-pip, helm]
|
name: [cri-o, kubelet, kubeadm, kubectl, python3-pip, helm, git]
|
||||||
|
|
||||||
- name: Install Kubernetes Python packages.
|
- name: Install Kubernetes Python packages.
|
||||||
ansible.builtin.pip:
|
ansible.builtin.pip:
|
||||||
@@ -122,6 +122,15 @@
|
|||||||
kubeadm join --config JoinConfiguration.yml
|
kubeadm join --config JoinConfiguration.yml
|
||||||
changed_when: true
|
changed_when: true
|
||||||
|
|
||||||
|
- name: Install Helm Diff.
|
||||||
|
gather_facts: false
|
||||||
|
hosts: control
|
||||||
|
tasks:
|
||||||
|
- name: Install it.
|
||||||
|
kubernetes.core.helm_plugin:
|
||||||
|
plugin_path: https://github.com/databus23/helm-diff
|
||||||
|
state: present
|
||||||
|
|
||||||
- name: Install CNI.
|
- name: Install CNI.
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
hosts: control
|
hosts: control
|
||||||
@@ -200,6 +209,14 @@
|
|||||||
url: https://charts.hetzner.cloud
|
url: https://charts.hetzner.cloud
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
|
- name: Copy over values file.
|
||||||
|
vars:
|
||||||
|
values_template: ../templates/HCCMValues.yml.jinja2
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: "{{ values_template }}"
|
||||||
|
dest: HCCMValues.yml
|
||||||
|
mode: preserve
|
||||||
|
|
||||||
- name: Install it.
|
- name: Install it.
|
||||||
kubernetes.core.helm:
|
kubernetes.core.helm:
|
||||||
name: hccm
|
name: hccm
|
||||||
@@ -207,3 +224,43 @@
|
|||||||
namespace: kube-system
|
namespace: kube-system
|
||||||
state: present
|
state: present
|
||||||
update_repo_cache: true
|
update_repo_cache: true
|
||||||
|
force: true
|
||||||
|
values_files: [HCCMValues.yml]
|
||||||
|
|
||||||
|
|
||||||
|
- name: Install `nginx` Controller.
|
||||||
|
gather_facts: false
|
||||||
|
hosts: control
|
||||||
|
tasks:
|
||||||
|
- name: Remove schedule taint to nodes.
|
||||||
|
kubernetes.core.k8s_taint:
|
||||||
|
state: absent
|
||||||
|
name: "{{ item }}"
|
||||||
|
taints:
|
||||||
|
- key: node.cloudprovider.kubernetes.io/uninitialized
|
||||||
|
value: true
|
||||||
|
effect: NoSchedule
|
||||||
|
loop: [node-a, node-b]
|
||||||
|
|
||||||
|
- name: Add `ingress-nginx` repository.
|
||||||
|
kubernetes.core.helm_repository:
|
||||||
|
name: ingress-nginx
|
||||||
|
url: https://kubernetes.github.io/ingress-nginx
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Copy over values file.
|
||||||
|
vars:
|
||||||
|
values_template: ../templates/IngressValues.yml.jinja2
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: "{{ values_template }}"
|
||||||
|
dest: IngressValues.yml
|
||||||
|
mode: preserve
|
||||||
|
|
||||||
|
- name: Install it.
|
||||||
|
kubernetes.core.helm:
|
||||||
|
name: ingress-nginx-controller
|
||||||
|
chart_ref: ingress-nginx/ingress-nginx
|
||||||
|
namespace: kube-system
|
||||||
|
state: present
|
||||||
|
update_repo_cache: true
|
||||||
|
values_files: [IngressValues.yml]
|
||||||
|
|||||||
3
templates/HCCMValues.yml.jinja2
Normal file
3
templates/HCCMValues.yml.jinja2
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
networking:
|
||||||
|
enabled: "true"
|
||||||
|
clusterCIDR: "10.244.0.0/16"
|
||||||
18
templates/IngressValues.yml.jinja2
Normal file
18
templates/IngressValues.yml.jinja2
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
controller:
|
||||||
|
dnsPolicy: ClusterFirstWithHostNet
|
||||||
|
hostNetwork: true
|
||||||
|
kind: DaemonSet
|
||||||
|
service:
|
||||||
|
annotations:
|
||||||
|
load-balancer.hetzner.cloud/name: "hetzner-lb"
|
||||||
|
load-balancer.hetzner.cloud/location: "fsn1"
|
||||||
|
load-balancer.hetzner.cloud/type: "lb11"
|
||||||
|
load-balancer.hetzner.cloud/ipv6-disabled: "true"
|
||||||
|
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-redirect-http: "true"
|
||||||
|
enableHttp: false
|
||||||
|
targetPorts:
|
||||||
|
https: http
|
||||||
Reference in New Issue
Block a user