From 01028991c3e1091746688b5cb5d2091b402b4e37 Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Thu, 2 Mar 2017 00:51:18 +0000 Subject: [PATCH] Move Keystone to endpoint type lookups --- keystone/templates/bin/_db-sync.sh.tpl | 6 +++--- keystone/templates/deployment.yaml | 8 +++++--- keystone/templates/etc/_wsgi-keystone.conf.tpl | 4 ++-- keystone/templates/service.yaml | 2 +- keystone/values.yaml | 18 +++++------------- 5 files changed, 16 insertions(+), 22 deletions(-) diff --git a/keystone/templates/bin/_db-sync.sh.tpl b/keystone/templates/bin/_db-sync.sh.tpl index 89a7901819..b084669166 100644 --- a/keystone/templates/bin/_db-sync.sh.tpl +++ b/keystone/templates/bin/_db-sync.sh.tpl @@ -22,7 +22,7 @@ keystone-manage --config-file=/etc/keystone/keystone.conf bootstrap \ --bootstrap-username {{ .Values.keystone.admin_user }} \ --bootstrap-password {{ .Values.keystone.admin_password }} \ --bootstrap-project-name {{ .Values.keystone.admin_project_name }} \ - --bootstrap-admin-url {{ include "helm-toolkit.endpoint_keystone_admin" . }} \ - --bootstrap-public-url {{ include "helm-toolkit.endpoint_keystone_internal" . }} \ - --bootstrap-internal-url {{ include "helm-toolkit.endpoint_keystone_internal" . }} \ + --bootstrap-admin-url {{ tuple "identity" "admin" "admin" . | include "helm-toolkit.endpoint_type_lookup_addr" }} \ + --bootstrap-public-url {{ tuple "identity" "public" "api" . | include "helm-toolkit.endpoint_type_lookup_addr" }} \ + --bootstrap-internal-url {{ tuple "identity" "internal" "api" . | include "helm-toolkit.endpoint_type_lookup_addr" }} \ --bootstrap-region-id {{ .Values.keystone.admin_region_name }} diff --git a/keystone/templates/deployment.yaml b/keystone/templates/deployment.yaml index 514b3c2f44..c90e685186 100644 --- a/keystone/templates/deployment.yaml +++ b/keystone/templates/deployment.yaml @@ -58,8 +58,10 @@ spec: - bash - /tmp/start.sh ports: - - containerPort: {{ .Values.network.port.public }} - - containerPort: {{ .Values.network.port.admin }} + - name: api-public + containerPort: {{ .Values.network.port.api }} + - name: api-admin + containerPort: {{ .Values.network.port.admin }} lifecycle: preStop: exec: @@ -69,7 +71,7 @@ spec: - graceful-stop readinessProbe: tcpSocket: - port: {{ .Values.network.port.public }} + port: {{ .Values.network.port.api }} volumeMounts: - name: pod-etc-keystone mountPath: /etc/keystone diff --git a/keystone/templates/etc/_wsgi-keystone.conf.tpl b/keystone/templates/etc/_wsgi-keystone.conf.tpl index acf95af54c..d85cd8f9a1 100644 --- a/keystone/templates/etc/_wsgi-keystone.conf.tpl +++ b/keystone/templates/etc/_wsgi-keystone.conf.tpl @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -Listen {{ .Values.network.ip_address }}:{{ .Values.network.port.public }} -Listen {{ .Values.network.ip_address }}:{{ .Values.network.port.admin }} +Listen 0.0.0.0:{{ .Values.network.port.api }} +Listen 0.0.0.0:{{ .Values.network.port.admin }} LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy diff --git a/keystone/templates/service.yaml b/keystone/templates/service.yaml index 6300d21cf0..89b439fbcb 100644 --- a/keystone/templates/service.yaml +++ b/keystone/templates/service.yaml @@ -19,7 +19,7 @@ metadata: spec: ports: - name: keystone-api-public - port: {{ .Values.network.port.public }} + port: {{ .Values.network.port.api }} - name: keystone-api-admin port: {{ .Values.network.port.admin }} selector: diff --git a/keystone/values.yaml b/keystone/values.yaml index ad4be87496..05bf4a52c7 100644 --- a/keystone/values.yaml +++ b/keystone/values.yaml @@ -54,15 +54,7 @@ api: network: port: admin: 35357 - public: 5000 - # alanmeadows(TODO): I seem unable to use {{ .IP }} here - # but it does work for wsrep.conf in mariadb, I have spent - # time trying to figure this out am completely stumped - # - # helm --debug --dry-run shows me that the config map - # contains {{ .IP }} but its simply translated by K8s - # to "" - ip_address: "0.0.0.0" + api: 5000 database: port: 3306 @@ -120,12 +112,12 @@ resources: # values, but should include all endpoints # required by this chart endpoints: - keystone: + identity: + name: keystone hosts: default: keystone-api path: /v3 - type: identity scheme: 'http' port: - admin: 35357 - public: 5000 + admin: 35357 + api: 5000