summaryrefslogtreecommitdiff
path: root/roles/kubernetes/addons
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2023-03-12 02:58:32 +0100
committerChristian Pointner <equinox@spreadspace.org>2023-03-12 02:58:32 +0100
commit37d0d885a46dd2af84f451ff6ca60cf5a727a775 (patch)
treef3e4aaf7d1234f78c05fb8d09e9cf5190f0d3e8d /roles/kubernetes/addons
parentkubernetes/addons: add ingress-nginx (diff)
kubernetes/addon/cert-amanger: convert to kustomize
Diffstat (limited to 'roles/kubernetes/addons')
-rw-r--r--roles/kubernetes/addons/cert-manager/files/cert-manager.1.9.1.yml (renamed from roles/kubernetes/addons/cert-manager/templates/config.1.9.1.yml.j2)0
-rw-r--r--roles/kubernetes/addons/cert-manager/files/cert-manager.1.9.2.yml (renamed from roles/kubernetes/addons/cert-manager/templates/config.1.9.2.yml.j2)0
-rw-r--r--roles/kubernetes/addons/cert-manager/tasks/main.yml17
-rw-r--r--roles/kubernetes/addons/cert-manager/templates/kustomization.yml.j25
4 files changed, 17 insertions, 5 deletions
diff --git a/roles/kubernetes/addons/cert-manager/templates/config.1.9.1.yml.j2 b/roles/kubernetes/addons/cert-manager/files/cert-manager.1.9.1.yml
index e11ba878..e11ba878 100644
--- a/roles/kubernetes/addons/cert-manager/templates/config.1.9.1.yml.j2
+++ b/roles/kubernetes/addons/cert-manager/files/cert-manager.1.9.1.yml
diff --git a/roles/kubernetes/addons/cert-manager/templates/config.1.9.2.yml.j2 b/roles/kubernetes/addons/cert-manager/files/cert-manager.1.9.2.yml
index 82320114..82320114 100644
--- a/roles/kubernetes/addons/cert-manager/templates/config.1.9.2.yml.j2
+++ b/roles/kubernetes/addons/cert-manager/files/cert-manager.1.9.2.yml
diff --git a/roles/kubernetes/addons/cert-manager/tasks/main.yml b/roles/kubernetes/addons/cert-manager/tasks/main.yml
index bc653e01..adac0548 100644
--- a/roles/kubernetes/addons/cert-manager/tasks/main.yml
+++ b/roles/kubernetes/addons/cert-manager/tasks/main.yml
@@ -8,18 +8,25 @@
path: /etc/kubernetes/addons/cert-manager
state: directory
- - name: copy config for cert-manager
+ ## you may download these using the following command:
+ # wget -O cert-manager.{{ kubernetes_cert_manager_version }}.yml https://github.com/cert-manager/cert-manager/releases/download/v{{ kubernetes_cert_manager_version }}/cert-manager.yaml
+ - name: copy base config for cert-manager
+ copy:
+ src: "cert-manager.{{ kubernetes_cert_manager_version }}.yml"
+ dest: /etc/kubernetes/addons/cert-manager/upstream.yml
+
+ - name: generate kustomization for cert-manager
template:
- src: "config.{{ kubernetes_cert_manager_version }}.yml.j2"
- dest: /etc/kubernetes/addons/cert-manager/config.yml
+ src: "kustomization.yml.j2"
+ dest: /etc/kubernetes/addons/cert-manager/kustomization.yml
- name: check if cert-manager is already installed
check_mode: no
- command: kubectl --kubeconfig /etc/kubernetes/admin.conf diff -f /etc/kubernetes/addons/cert-manager/config.yml
+ command: kubectl --kubeconfig /etc/kubernetes/admin.conf diff -k /etc/kubernetes/addons/cert-manager
failed_when: false
changed_when: false
register: kube_cert_manager_diff_result
- name: install cert-manager onto the cluster
when: kube_cert_manager_diff_result.rc != 0
- command: kubectl --kubeconfig /etc/kubernetes/admin.conf apply -f /etc/kubernetes/addons/cert-manager/config.yml
+ command: kubectl --kubeconfig /etc/kubernetes/admin.conf apply -k /etc/kubernetes/addons/cert-manager
diff --git a/roles/kubernetes/addons/cert-manager/templates/kustomization.yml.j2 b/roles/kubernetes/addons/cert-manager/templates/kustomization.yml.j2
new file mode 100644
index 00000000..90c60f07
--- /dev/null
+++ b/roles/kubernetes/addons/cert-manager/templates/kustomization.yml.j2
@@ -0,0 +1,5 @@
+apiVersion: kustomize.config.k8s.io/v1beta1
+kind: Kustomization
+
+resources:
+ - upstream.yml