Use hcloud-csi to provision volumes

This commit is contained in:
Paul-Henri Froidmont 2019-08-26 02:40:27 +02:00
parent 43dd47e761
commit c4c6c2ff79
3 changed files with 89 additions and 60 deletions

View file

@ -0,0 +1,22 @@
- name: Create secret with token for CSI driver
k8s:
definition:
apiVersion: v1
kind: Secret
metadata:
name: hcloud-csi
namespace: kube-system
stringData:
token: "{{ hcloud_token_csi }}"
- name: Download the CSI driver manifest
get_url:
url: https://raw.githubusercontent.com/hetznercloud/csi-driver/master/deploy/kubernetes/hcloud-csi.yml
dest: /tmp/hcloud-csi.yml
mode: 0600
delegate_to: localhost
- name: Apply CSI driver manifest
k8s:
state: present
definition: "{{ lookup('file', '/tmp/hcloud-csi.yml') }}"

View file

@ -2,6 +2,9 @@
- import_tasks: prerequisites.yml
tags: prerequisites
- import_tasks: hcloud-csi.yml
tags: hcloud-csi
- import_tasks: cert-manager.yml
tags: cert-manager