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 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 = <