infrastructure/k8s/roles/hcloud/tasks/main.yml

35 lines
977 B
YAML

---
- name: Create Hcloud token secret
kubernetes.core.k8s:
state: present
definition:
apiVersion: v1
kind: Secret
metadata:
name: hcloud
namespace: kube-system
data:
token: "{{ HcloudToken | b64encode }}"
network: "{{ 'k8s-net' | b64encode }}"
- name: Add Hcloud chart repo
kubernetes.core.helm_repository:
name: hcloud
repo_url: https://charts.hetzner.cloud
- name: Deploy cloud-controller-manager
kubernetes.core.helm:
name: hccm
chart_ref: hcloud/hcloud-cloud-controller-manager
release_namespace: kube-system
chart_version: "1.19.0"
release_values: "{{ lookup('template', 'values.hccm.yml.j2') | from_yaml }}"
- name: Deploy hcloud CSI driver
kubernetes.core.helm:
name: hcloud-csi-driver
chart_ref: hcloud/hcloud-csi
release_namespace: kube-system
chart_version: "2.6.0"
release_values: "{{ lookup('template', 'values.csi.yml.j2') | from_yaml }}"