From ff0d8ca2679903c1e8b78d78764d6f9a05c24786 Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Thu, 2 Mar 2017 01:55:48 +0000 Subject: [PATCH] Finalise Cinder endpoint type lookup implementation --- cinder/templates/deployment-api.yaml | 5 ++-- cinder/templates/etc/_cinder.conf.tpl | 10 ++++--- .../templates/secret-keystone-admin.env.yaml | 2 +- .../templates/secret-keystone-user.env.yaml | 2 +- cinder/templates/service-api.yaml | 4 +-- cinder/values.yaml | 27 ++++++++++--------- 6 files changed, 27 insertions(+), 23 deletions(-) diff --git a/cinder/templates/deployment-api.yaml b/cinder/templates/deployment-api.yaml index b9d09c57a3..52705f8ad5 100644 --- a/cinder/templates/deployment-api.yaml +++ b/cinder/templates/deployment-api.yaml @@ -59,10 +59,11 @@ spec: - --config-dir - /etc/cinder/conf ports: - - containerPort: {{ .Values.service.api.port }} + - name: c-api + containerPort: {{ .Values.network.port.api }} readinessProbe: tcpSocket: - port: {{ .Values.service.api.port }} + port: {{ .Values.network.port.api }} volumeMounts: - name: pod-etc-cinder mountPath: /etc/cinder diff --git a/cinder/templates/etc/_cinder.conf.tpl b/cinder/templates/etc/_cinder.conf.tpl index b03a594774..cc42466ec2 100644 --- a/cinder/templates/etc/_cinder.conf.tpl +++ b/cinder/templates/etc/_cinder.conf.tpl @@ -22,11 +22,11 @@ volume_name_template = %s osapi_volume_workers = {{ .Values.api.workers }} osapi_volume_listen = 0.0.0.0 -osapi_volume_listen_port = {{ .Values.service.api.port }} +osapi_volume_listen_port = {{ .Values.network.port.api }} api_paste_config = /etc/cinder/api-paste.ini -glance_api_servers = "{{ .Values.glance.proto }}://{{ .Values.glance.host }}:{{ .Values.glance.port }}" +glance_api_servers = {{ tuple "image" "internal" "api" . | include "helm-toolkit.endpoint_type_lookup_addr" }} glance_api_version = {{ .Values.glance.version }} enabled_backends = {{ include "helm-toolkit.joinListWithComma" .Values.backends.enabled }} @@ -44,11 +44,13 @@ connection = mysql+pymysql://{{ .Values.database.cinder_user }}:{{ .Values.datab max_retries = -1 [keystone_authtoken] -auth_url = {{ .Values.keystone.auth_url }} +auth_version = v3 +auth_url = {{ tuple "identity" "internal" "api" . | include "helm-toolkit.endpoint_type_lookup_addr" }} auth_type = password +region_name = {{ .Values.keystone.cinder_region_name }} project_domain_name = {{ .Values.keystone.cinder_project_domain }} -user_domain_name = {{ .Values.keystone.cinder_user_domain }} project_name = {{ .Values.keystone.cinder_project_name }} +user_domain_name = {{ .Values.keystone.cinder_user_domain }} username = {{ .Values.keystone.cinder_user }} password = {{ .Values.keystone.cinder_password }} diff --git a/cinder/templates/secret-keystone-admin.env.yaml b/cinder/templates/secret-keystone-admin.env.yaml index 845b87d388..2bb76c347c 100644 --- a/cinder/templates/secret-keystone-admin.env.yaml +++ b/cinder/templates/secret-keystone-admin.env.yaml @@ -19,7 +19,7 @@ metadata: type: Opaque data: OS_AUTH_URL: | -{{ .Values.keystone.auth_url | b64enc | indent 4 }} +{{ tuple "identity" "admin" "admin" . | include "helm-toolkit.endpoint_type_lookup_addr" | b64enc | indent 4 }} OS_REGION_NAME: | {{ .Values.keystone.admin_region_name | b64enc | indent 4 }} OS_PROJECT_DOMAIN_NAME: | diff --git a/cinder/templates/secret-keystone-user.env.yaml b/cinder/templates/secret-keystone-user.env.yaml index 3fa0464ed2..ffaeca04a9 100644 --- a/cinder/templates/secret-keystone-user.env.yaml +++ b/cinder/templates/secret-keystone-user.env.yaml @@ -19,7 +19,7 @@ metadata: type: Opaque data: OS_AUTH_URL: | -{{ .Values.keystone.auth_url | b64enc | indent 4 }} +{{ tuple "identity" "internal" "api" . | include "helm-toolkit.endpoint_type_lookup_addr" | b64enc | indent 4 }} OS_REGION_NAME: | {{ .Values.keystone.cinder_region_name | b64enc | indent 4 }} OS_PROJECT_DOMAIN_NAME: | diff --git a/cinder/templates/service-api.yaml b/cinder/templates/service-api.yaml index e6ec8e6ac8..4347d8e95d 100644 --- a/cinder/templates/service-api.yaml +++ b/cinder/templates/service-api.yaml @@ -15,9 +15,9 @@ apiVersion: v1 kind: Service metadata: - name: {{ .Values.service.api.name }} + name: cinder-api spec: ports: - - port: {{ .Values.service.api.port }} + - port: {{ .Values.network.port.api }} selector: app: cinder-api diff --git a/cinder/values.yaml b/cinder/values.yaml index a0d5e2b9a6..22e656036b 100644 --- a/cinder/values.yaml +++ b/cinder/values.yaml @@ -46,8 +46,6 @@ upgrades: max_surge: 3 keystone: - auth_uri: "http://keystone-api:5000" - auth_url: "http://keystone-api:35357" admin_user: "admin" admin_user_domain: "default" admin_password: "password" @@ -63,11 +61,9 @@ keystone: cinder_project_domain: "default" cinder_region_name: "RegionOne" -service: - api: - name: "cinder-api" - port: 8776 - proto: "http" +network: + port: + api: 8776 database: address: mariadb @@ -96,9 +92,6 @@ backends: pool: "volumes" glance: - proto: "http" - host: "glance-api" - port: 9292 version: 2 messaging: @@ -171,8 +164,17 @@ endpoints: path: /v3 scheme: 'http' port: - admin: 35357 - public: 5000 + admin: 35357 + api: 5000 + image: + name: glance + hosts: + default: glance-api + path: null + scheme: 'http' + port: + api: 9292 + registry: 9191 volume: name: cinder hosts: @@ -256,4 +258,3 @@ resources: limits: memory: "1024Mi" cpu: "2000m" -