Peter Kurfer
831a85436f
All checks were successful
continuous-integration/drone/push Build is passing
51 lines
1.4 KiB
YAML
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: /
|