infrastructure/k8s/roles/hcloud/tasks/main.yml
Peter Kurfer 831a85436f
All checks were successful
continuous-integration/drone/push Build is passing
feat: add skooner, upgrade a few things
2023-07-19 18:55:17 +00:00

51 lines
1.4 KiB
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: Deploy CSI driver
kubernetes.core.k8s:
state: present
definition: "{{ item }}"
loop: "{{ lookup('ansible.builtin.template', 'hcloud-csi.yml.j2') | ansible.builtin.from_yaml_all | list }}"
- 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.17.0"
release_values: "{{ lookup('template', 'values.hccm.yml.j2') | from_yaml }}"
- name: Create CSI controller PodMonitor
kubernetes.core.k8s:
state: present
definition:
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: hcloud-csi-controller
namespace: kube-system
labels:
prometheus: default
spec:
selector:
matchLabels:
app: hcloud-csi-controller
podMetricsEndpoints:
- port: metrics
path: /