diff --git a/inventory/hosts b/inventory/hosts index ade87f2..d2cab72 100644 --- a/inventory/hosts +++ b/inventory/hosts @@ -1,7 +1,7 @@ -vps-host ansible_connection=ssh ansible_host=51.222.107.37 ansible_port=2424 ansible_user=valentin +vps-host ansible_connection=ssh ansible_host=51.222.107.37 ansible_port=2424 ansible_user=valentin valentin-nas ansible_connection=ssh ansible_host=151.80.37.38 ansible_port=2424 ansible_user=valentin drone-host ansible_connection=ssh ansible_host=151.80.37.38 ansible_port=2424 ansible_user=valentin -localhost ansible_host=127.0.0.1 +localhost ansible_host=127.0.0.1 ansible_python_interpreter=/usr/bin/python3.10 [vps] vps-host diff --git a/scaleway-k8s/tasks/deploy-backend.yml b/scaleway-k8s/tasks/deploy-backend.yml index 418723a..034fe6d 100644 --- a/scaleway-k8s/tasks/deploy-backend.yml +++ b/scaleway-k8s/tasks/deploy-backend.yml @@ -12,4 +12,37 @@ dest: "{{ project_backend }}/{{ item }}.yaml" with_items: "{{ backend_yaml }}" +- name: Create a k8s namespace + kubernetes.core.k8s: + name: testing + api_version: v1 + kind: Namespace + state: present + + +- name: Apply deployment + kubernetes.core.k8s: + src: "{{ project_backend }}/backend-deployment.yaml" + state: present + +- name: Apply services + kubernetes.core.k8s: + src: "{{ project_backend }}/backend-service.yaml" + state: present + +- name: Apply configmap + kubernetes.core.k8s: + src: "{{ project_backend }}/env-configmap.yaml" + state: present + + +- name: Apply secret + kubernetes.core.k8s: + src: "{{ project_backend }}/secret.yaml" + state: present + + + + + diff --git a/scaleway-k8s/templates/backend-deployment.yaml.j2 b/scaleway-k8s/templates/backend-deployment.yaml.j2 index 050bc99..b01033e 100644 --- a/scaleway-k8s/templates/backend-deployment.yaml.j2 +++ b/scaleway-k8s/templates/backend-deployment.yaml.j2 @@ -8,6 +8,7 @@ metadata: labels: io.kompose.service: backend name: backend + namespace: testing spec: replicas: 1 selector: diff --git a/scaleway-k8s/templates/backend-service.yaml.j2 b/scaleway-k8s/templates/backend-service.yaml.j2 index 20a0172..79ee8f5 100644 --- a/scaleway-k8s/templates/backend-service.yaml.j2 +++ b/scaleway-k8s/templates/backend-service.yaml.j2 @@ -8,6 +8,7 @@ metadata: labels: io.kompose.service: backend name: backend + namespace: testing spec: ports: - name: "{{ port }}" diff --git a/scaleway-k8s/templates/env-configmap.yaml.j2 b/scaleway-k8s/templates/env-configmap.yaml.j2 index 12afb27..ee8c114 100644 --- a/scaleway-k8s/templates/env-configmap.yaml.j2 +++ b/scaleway-k8s/templates/env-configmap.yaml.j2 @@ -18,3 +18,5 @@ metadata: labels: io.kompose.service: backend-env name: env + namespace: testing + diff --git a/scaleway-k8s/templates/secret.yaml.j2 b/scaleway-k8s/templates/secret.yaml.j2 index f0ff086..686913e 100644 --- a/scaleway-k8s/templates/secret.yaml.j2 +++ b/scaleway-k8s/templates/secret.yaml.j2 @@ -5,7 +5,6 @@ kind: Secret metadata: creationTimestamp: "2022-11-26T19:19:41Z" name: regcred - namespace: default - resourceVersion: "17345802593" + namespace: testing uid: {{ uid_secret }} type: kubernetes.io/dockerconfigjson