From ba0cc0cffd6fd0c8fbd82beee484f577b1a977c9 Mon Sep 17 00:00:00 2001 From: Nicolas Marcq Date: Mon, 11 Dec 2023 17:21:45 +0100 Subject: [PATCH] code review --- docs/installation/kubernetes.md | 4 ++-- k8s/backup.yml | 4 ++-- k8s/deploy.yml | 1 - k8s/requirements.txt | 1 + k8s/requirements.yml | 3 +++ 5 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 k8s/requirements.txt create mode 100644 k8s/requirements.yml diff --git a/docs/installation/kubernetes.md b/docs/installation/kubernetes.md index a54f8d1f8..1680d0261 100644 --- a/docs/installation/kubernetes.md +++ b/docs/installation/kubernetes.md @@ -11,12 +11,12 @@ The Kubernetes deployment is wrapped by Ansible. The code has been tested with A Install Ansible dependencies: ```bash -ansible-galaxy collection install kubernetes.core +ansible-galaxy install -r k8s/requirements.yml ``` Install Python dependencies: ```bash -pip3 install kubernetes +pip3 install -r k8s/requirements.txt ``` ## Ansible inventory diff --git a/k8s/backup.yml b/k8s/backup.yml index f01c1cfe1..d8f822b06 100644 --- a/k8s/backup.yml +++ b/k8s/backup.yml @@ -13,7 +13,7 @@ tasks: - name: Generate job name ansible.builtin.set_fact: - job_name: backup-{{ ansible_date_time.date }} + job_name: "backup-{{ ansible_date_time.iso8601 }}" - name: Create Job from backup cronjob shell: "kubectl --namespace {{ squest_namespace }} create job --from=cronjob/squest-backup {{ job_name }}" @@ -42,7 +42,7 @@ block: - name: Generate job name ansible.builtin.set_fact: - job_name: rsync-backup-{{ ansible_date_time.date }} + job_name: "rsync-backup-{{ ansible_date_time.iso8601 }}" - name: Create Job from rsync backup cronjob shell: "kubectl --namespace {{ squest_namespace }} create job --from=cronjob/squest-rsync-backup {{ job_name }}" diff --git a/k8s/deploy.yml b/k8s/deploy.yml index 9f18cb0a5..162ede13b 100644 --- a/k8s/deploy.yml +++ b/k8s/deploy.yml @@ -2,6 +2,5 @@ hosts: localhost gather_facts: False - roles: - role: squest_k8s diff --git a/k8s/requirements.txt b/k8s/requirements.txt new file mode 100644 index 000000000..2860d7e21 --- /dev/null +++ b/k8s/requirements.txt @@ -0,0 +1 @@ +kubernetes==24.2.0 diff --git a/k8s/requirements.yml b/k8s/requirements.yml new file mode 100644 index 000000000..59fe50a98 --- /dev/null +++ b/k8s/requirements.yml @@ -0,0 +1,3 @@ +collections: + - name: kubernetes.core + version: 2.3.2