From 8a3b35449326bbf6ff8434bbfab4e02972184b20 Mon Sep 17 00:00:00 2001 From: YustinaKvr Date: Tue, 17 Dec 2024 13:24:40 +0100 Subject: [PATCH 1/5] Add new overlay for Zuul test instance --- .../zuul_ci_test/configs/kube.config.hcl | 24 +++ .../configs/openstack/clouds.yaml.hcl | 52 +++++ .../zuul_ci_test/configs/site-vars.yaml | 3 + .../configs/vault-agent/config-nodepool.hcl | 31 +++ .../configs/vault-agent/config-zuul.hcl | 55 ++++++ .../vault-agent/executor-base-vault-agent.hcl | 29 +++ .../zuul_ci_test/configs/zuul.conf.hcl | 109 +++++++++++ .../zuul/overlays/zuul_ci_test/crb.yaml | 13 ++ .../zuul/overlays/zuul_ci_test/crb_admin.yaml | 13 ++ .../overlays/zuul_ci_test/kustomization.yaml | 184 ++++++++++++++++++ .../overlays/zuul_ci_test/patch-nodepool.yaml | 143 ++++++++++++++ .../zuul_ci_test/patch-zuul-executor.yaml | 59 ++++++ .../overlays/zuul_ci_test/patch-zuul.yaml | 138 +++++++++++++ 13 files changed, 853 insertions(+) create mode 100644 kubernetes/zuul/overlays/zuul_ci_test/configs/kube.config.hcl create mode 100644 kubernetes/zuul/overlays/zuul_ci_test/configs/openstack/clouds.yaml.hcl create mode 100644 kubernetes/zuul/overlays/zuul_ci_test/configs/site-vars.yaml create mode 100644 kubernetes/zuul/overlays/zuul_ci_test/configs/vault-agent/config-nodepool.hcl create mode 100644 kubernetes/zuul/overlays/zuul_ci_test/configs/vault-agent/config-zuul.hcl create mode 100644 kubernetes/zuul/overlays/zuul_ci_test/configs/vault-agent/executor-base-vault-agent.hcl create mode 100644 kubernetes/zuul/overlays/zuul_ci_test/configs/zuul.conf.hcl create mode 100644 kubernetes/zuul/overlays/zuul_ci_test/crb.yaml create mode 100644 kubernetes/zuul/overlays/zuul_ci_test/crb_admin.yaml create mode 100644 kubernetes/zuul/overlays/zuul_ci_test/kustomization.yaml create mode 100644 kubernetes/zuul/overlays/zuul_ci_test/patch-nodepool.yaml create mode 100644 kubernetes/zuul/overlays/zuul_ci_test/patch-zuul-executor.yaml create mode 100644 kubernetes/zuul/overlays/zuul_ci_test/patch-zuul.yaml diff --git a/kubernetes/zuul/overlays/zuul_ci_test/configs/kube.config.hcl b/kubernetes/zuul/overlays/zuul_ci_test/configs/kube.config.hcl new file mode 100644 index 00000000..5521118d --- /dev/null +++ b/kubernetes/zuul/overlays/zuul_ci_test/configs/kube.config.hcl @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: Config +current-context: otcci +preferences: {} + +clusters: + - name: otcci + cluster: + server: "https://192.168.21.182:5443" + insecure-skip-tls-verify: true + +contexts: + - name: otcci + context: + cluster: otcci + user: otcci-admin + +users: + - name: otcci-admin + user: +{{- with secret "secret/kubernetes/otcci_k8s" }} + client-certificate-data: "{{ base64Encode .Data.data.client_crt }}" + client-key-data: "{{ base64Encode .Data.data.client_key }}" +{{- end }} diff --git a/kubernetes/zuul/overlays/zuul_ci_test/configs/openstack/clouds.yaml.hcl b/kubernetes/zuul/overlays/zuul_ci_test/configs/openstack/clouds.yaml.hcl new file mode 100644 index 00000000..51be5cc6 --- /dev/null +++ b/kubernetes/zuul/overlays/zuul_ci_test/configs/openstack/clouds.yaml.hcl @@ -0,0 +1,52 @@ +--- +# Nodepool openstacksdk configuration +# +# This file is deployed to nodepool launcher and builder hosts +# and is used there to authenticate nodepool operations to clouds. +# This file only contains projects we are launching test nodes in, and +# the naming should correspond that used in nodepool configuration +# files. +# +# Generated automatically, please do not edit directly! +cache: + expiration: + server: 5 + port: 5 + floating-ip: 5 +clouds: + otcci-pool1: + auth: +{{- with secret "secret/clouds/otcci_nodepool_pool1" }} +{{- with secret (printf "secret/%s" .Data.data.user_secret_name) }} + auth_url: "{{ .Data.data.auth_url }}" + user_domain_name: "{{ .Data.data.user_domain_name }}" + username: "{{ .Data.data.username }}" + password: "{{ .Data.data.password }}" +{{- end }} + project_name: "{{ .Data.data.project_name }}" +{{- end }} + private: true + otcci-pool2: + auth: +{{- with secret "secret/clouds/otcci_nodepool_pool2" }} +{{- with secret (printf "secret/%s" .Data.data.user_secret_name) }} + auth_url: "{{ .Data.data.auth_url }}" + user_domain_name: "{{ .Data.data.user_domain_name }}" + username: "{{ .Data.data.username }}" + password: "{{ .Data.data.password }}" +{{- end }} + project_name: "{{ .Data.data.project_name }}" +{{- end }} + private: true + otcci-pool3: + auth: +{{- with secret "secret/clouds/otcci_nodepool_pool3" }} +{{- with secret (printf "secret/%s" .Data.data.user_secret_name) }} + auth_url: "{{ .Data.data.auth_url }}" + user_domain_name: "{{ .Data.data.user_domain_name }}" + username: "{{ .Data.data.username }}" + password: "{{ .Data.data.password }}" +{{- end }} + project_name: "{{ .Data.data.project_name }}" +{{- end }} + private: true diff --git a/kubernetes/zuul/overlays/zuul_ci_test/configs/site-vars.yaml b/kubernetes/zuul/overlays/zuul_ci_test/configs/site-vars.yaml new file mode 100644 index 00000000..aacc7e8b --- /dev/null +++ b/kubernetes/zuul/overlays/zuul_ci_test/configs/site-vars.yaml @@ -0,0 +1,3 @@ +--- +zuul_base_vault_token_path: /var/run/zuul/trusted-ro/zuul-base-vault-token +zuul_vault_addr: https://vault-lb.eco.tsi-dev.otc-service.com:8200 diff --git a/kubernetes/zuul/overlays/zuul_ci_test/configs/vault-agent/config-nodepool.hcl b/kubernetes/zuul/overlays/zuul_ci_test/configs/vault-agent/config-nodepool.hcl new file mode 100644 index 00000000..a39b754b --- /dev/null +++ b/kubernetes/zuul/overlays/zuul_ci_test/configs/vault-agent/config-nodepool.hcl @@ -0,0 +1,31 @@ +pid_file = "/home/vault/.pid" +"auto_auth" = { + "method" = { + "mount_path" = "auth/kubernetes_otcci" + "config" = { + "role" = "zuul" + } + "type" = "kubernetes" + } + sink "file" { + config = { + path = "/home/vault/.token" + } + } +} + +cache { + use_auto_auth_token = true +} + +template { + destination = "/vault/secrets/openstack/clouds.yaml" + source = "/vault/custom/clouds.yaml.hcl" + perms = "0640" +} + +template { + destination = "/vault/secrets/.kube/config" + source = "/vault/custom/kube.config.hcl" + perms = "0640" +} diff --git a/kubernetes/zuul/overlays/zuul_ci_test/configs/vault-agent/config-zuul.hcl b/kubernetes/zuul/overlays/zuul_ci_test/configs/vault-agent/config-zuul.hcl new file mode 100644 index 00000000..b7315220 --- /dev/null +++ b/kubernetes/zuul/overlays/zuul_ci_test/configs/vault-agent/config-zuul.hcl @@ -0,0 +1,55 @@ +pid_file = "/home/vault/.pid" +"auto_auth" = { + "method" = { + "mount_path" = "auth/kubernetes_otcci" + "config" = { + "role" = "zuul" + } + "type" = "kubernetes" + } + sink "file" { + config = { + path = "/home/vault/.token" + } + } +} + +cache { + use_auto_auth_token = true +} + +template { + destination = "/vault/secrets/connections/github.key" + contents = < Date: Tue, 17 Dec 2024 19:41:02 +0100 Subject: [PATCH 2/5] fix image name --- kubernetes/zuul/overlays/zuul_ci_test/kustomization.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kubernetes/zuul/overlays/zuul_ci_test/kustomization.yaml b/kubernetes/zuul/overlays/zuul_ci_test/kustomization.yaml index c22be20f..46775b0e 100644 --- a/kubernetes/zuul/overlays/zuul_ci_test/kustomization.yaml +++ b/kubernetes/zuul/overlays/zuul_ci_test/kustomization.yaml @@ -54,11 +54,11 @@ images: newTag: "change_1157_change_859940" - name: "zuul/nodepool-builder" - newName: "quay.io/opentelekomcloud/nodepool-builder" + newName: "quay.io/zuul-ci/nodepool-launcher" newTag: "11.0.0" - name: "zuul/nodepool-launcher" - newName: "quay.io/opentelekomcloud/nodepool-launcher" + newName: "quay.io/zuul-ci/nodepool-launcher" newTag: "11.0.0" patches: From ba649fc29006eadd00c2b967437ac348d4c3307d Mon Sep 17 00:00:00 2001 From: YustinaKvr Date: Wed, 18 Dec 2024 11:46:19 +0100 Subject: [PATCH 3/5] fix builder image name --- kubernetes/zuul/overlays/zuul_ci_test/kustomization.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/zuul/overlays/zuul_ci_test/kustomization.yaml b/kubernetes/zuul/overlays/zuul_ci_test/kustomization.yaml index 46775b0e..b944a870 100644 --- a/kubernetes/zuul/overlays/zuul_ci_test/kustomization.yaml +++ b/kubernetes/zuul/overlays/zuul_ci_test/kustomization.yaml @@ -54,7 +54,7 @@ images: newTag: "change_1157_change_859940" - name: "zuul/nodepool-builder" - newName: "quay.io/zuul-ci/nodepool-launcher" + newName: "quay.io/zuul-ci/nodepool-builder" newTag: "11.0.0" - name: "zuul/nodepool-launcher" From 4bf20093ba7ef5ac8806707117bb1f192980f2ce Mon Sep 17 00:00:00 2001 From: Yustina Kvrivishvili <62885041+YustinaKvr@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:55:55 +0100 Subject: [PATCH 4/5] Update zuul.conf.hcl --- kubernetes/zuul/overlays/zuul_ci_test/configs/zuul.conf.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/zuul/overlays/zuul_ci_test/configs/zuul.conf.hcl b/kubernetes/zuul/overlays/zuul_ci_test/configs/zuul.conf.hcl index 0c7f45b7..86de715d 100644 --- a/kubernetes/zuul/overlays/zuul_ci_test/configs/zuul.conf.hcl +++ b/kubernetes/zuul/overlays/zuul_ci_test/configs/zuul.conf.hcl @@ -46,7 +46,7 @@ variables=/var/run/zuul/vars/site-vars.yaml prometheus_port=9091 [database] -{{- with secret "database/static-creds/zuul-static" }} +{{- with secret "database/static-creds/zuul-static-test" }} dburi=postgresql://{{ .Data.username }}:{{ .Data.password }}@192.168.21.196:5432/zuul?sslmode=require {{- end }} From 4dfecfa2d13d8da8797b42fbaad138f18c6c247a Mon Sep 17 00:00:00 2001 From: YustinaKvr Date: Thu, 19 Dec 2024 16:23:03 +0100 Subject: [PATCH 5/5] change cert --- kubernetes/zuul/components/zookeeper/cert.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kubernetes/zuul/components/zookeeper/cert.yaml b/kubernetes/zuul/components/zookeeper/cert.yaml index da205e90..5ee27e47 100644 --- a/kubernetes/zuul/components/zookeeper/cert.yaml +++ b/kubernetes/zuul/components/zookeeper/cert.yaml @@ -14,11 +14,11 @@ spec: - server auth - client auth dnsNames: - - zookeeper-0.zookeeper-headless.zuul-ci.svc.cluster.local + - zookeeper-0.zookeeper-headless.zuul-ci-test.svc.cluster.local - zookeeper-0 - - zookeeper-1.zookeeper-headless.zuul-ci.svc.cluster.local + - zookeeper-1.zookeeper-headless.zuul-ci-test.svc.cluster.local - zookeeper-1 - - zookeeper-2.zookeeper-headless.zuul-ci.svc.cluster.local + - zookeeper-2.zookeeper-headless.zuul-ci-test.svc.cluster.local - zookeeper-2 issuerRef: name: ca-issuer