WIP Update cinder Endpoint and service creation to support multiple versions
This commmit addresses issues with the endpoint layout in the values.yaml As a result it does for now not use the common functions for some tasks.
This commit is contained in:
parent
4479a0d93f
commit
1e94b125bf
45
cinder/templates/_helpers.tpl
Normal file
45
cinder/templates/_helpers.tpl
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
# This file is required because we use a slightly different endpoint layout in
|
||||||
|
# the values yaml, until we can make this change for all services.
|
||||||
|
|
||||||
|
|
||||||
|
# this function returns the endpoint uri for a service, it takes an tuple
|
||||||
|
# input in the form: service-type, endpoint-class, port-name. eg:
|
||||||
|
# { tuple "orchestration" "public" "api" . | include "endpoint_type_lookup_addr" }
|
||||||
|
# will return the appropriate URI. Once merged this should phase out the above.
|
||||||
|
|
||||||
|
{{- define "endpoint_type_lookup_addr" -}}
|
||||||
|
{{- $type := index . 0 -}}
|
||||||
|
{{- $endpoint := index . 1 -}}
|
||||||
|
{{- $port := index . 2 -}}
|
||||||
|
{{- $context := index . 3 -}}
|
||||||
|
{{- $endpointMap := index $context.Values.endpoints $type }}
|
||||||
|
{{- $fqdn := $context.Release.Namespace -}}
|
||||||
|
{{- if $context.Values.endpoints.fqdn -}}
|
||||||
|
{{- $fqdn := $context.Values.endpoints.fqdn -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- with $endpointMap -}}
|
||||||
|
{{- $endpointScheme := .scheme }}
|
||||||
|
{{- $endpointHost := index .hosts $endpoint | default .hosts.default}}
|
||||||
|
{{- $endpointPort := index .port $port }}
|
||||||
|
{{- $endpointPath := .path }}
|
||||||
|
{{- printf "%s://%s.%s:%1.f%s" $endpointScheme $endpointHost $fqdn $endpointPort $endpointPath | quote -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
|
||||||
|
#-------------------------------
|
||||||
|
# endpoint name lookup
|
||||||
|
#-------------------------------
|
||||||
|
|
||||||
|
# this function is used in endpoint management templates
|
||||||
|
# it returns the service type for an openstack service eg:
|
||||||
|
# { tuple orchestration . | include "ks_endpoint_type" }
|
||||||
|
# will return "heat"
|
||||||
|
|
||||||
|
{{- define "endpoint_name_lookup" -}}
|
||||||
|
{{- $type := index . 0 -}}
|
||||||
|
{{- $context := index . 1 -}}
|
||||||
|
{{- $endpointMap := index $context.Values.endpoints $type }}
|
||||||
|
{{- $endpointName := index $endpointMap "name" }}
|
||||||
|
{{- $endpointName | quote -}}
|
||||||
|
{{- end -}}
|
@ -32,9 +32,9 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
restartPolicy: OnFailure
|
restartPolicy: OnFailure
|
||||||
containers:
|
containers:
|
||||||
{{- range $key1, $osServiceName := tuple "cinder" "cinderv2" "cinderv3" }}
|
{{- range $key1, $osServiceType := tuple "volume" "volumev2" "volumev3" }}
|
||||||
{{- range $key2, $osServiceEndPoint := tuple "admin" "internal" "public" }}
|
{{- range $key2, $osServiceEndPoint := tuple "admin" "internal" "public" }}
|
||||||
- name: {{ $osServiceName }}-ks-endpoints-{{ $osServiceEndPoint }}
|
- name: {{ $osServiceType }}-ks-endpoints-{{ $osServiceEndPoint }}
|
||||||
image: {{ $envAll.Values.images.ks_endpoints }}
|
image: {{ $envAll.Values.images.ks_endpoints }}
|
||||||
imagePullPolicy: {{ $envAll.Values.images.pull_policy }}
|
imagePullPolicy: {{ $envAll.Values.images.pull_policy }}
|
||||||
command:
|
command:
|
||||||
@ -52,11 +52,11 @@ spec:
|
|||||||
- name: OS_SVC_ENDPOINT
|
- name: OS_SVC_ENDPOINT
|
||||||
value: {{ $osServiceEndPoint }}
|
value: {{ $osServiceEndPoint }}
|
||||||
- name: OS_SERVICE_NAME
|
- name: OS_SERVICE_NAME
|
||||||
value: {{ $osServiceName }}
|
value: {{ tuple $osServiceType $envAll | include "endpoint_name_lookup" }}
|
||||||
- name: OS_SERVICE_TYPE
|
- name: OS_SERVICE_TYPE
|
||||||
value: {{ tuple $osServiceName $envAll | include "endpoint_type_lookup" }}
|
value: {{ $osServiceType }}
|
||||||
- name: OS_SERVICE_ENDPOINT
|
- name: OS_SERVICE_ENDPOINT
|
||||||
value: {{ tuple $osServiceName $osServiceEndPoint "api" $envAll | include "endpoint_addr_lookup" }}
|
value: {{ tuple $osServiceType $osServiceEndPoint "api" $envAll | include "endpoint_type_lookup_addr" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -32,8 +32,8 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
restartPolicy: OnFailure
|
restartPolicy: OnFailure
|
||||||
containers:
|
containers:
|
||||||
{{- range $key1, $osServiceName := tuple "cinder" "cinderv2" "cinderv3" }}
|
{{- range $key1, $osServiceType := tuple "volume" "volumev2" "volumev3" }}
|
||||||
- name: {{ $osServiceName }}-ks-service-registration
|
- name: {{ $osServiceType }}-ks-service-registration
|
||||||
image: {{ $envAll.Values.images.ks_service }}
|
image: {{ $envAll.Values.images.ks_service }}
|
||||||
imagePullPolicy: {{ $envAll.Values.images.pull_policy }}
|
imagePullPolicy: {{ $envAll.Values.images.pull_policy }}
|
||||||
command:
|
command:
|
||||||
@ -49,9 +49,9 @@ spec:
|
|||||||
{{- include "env_ks_openrc_tpl" $env | indent 12 }}
|
{{- include "env_ks_openrc_tpl" $env | indent 12 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
- name: OS_SERVICE_NAME
|
- name: OS_SERVICE_NAME
|
||||||
value: {{ $osServiceName }}
|
value: {{ tuple $osServiceType $envAll | include "endpoint_name_lookup" }}
|
||||||
- name: OS_SERVICE_TYPE
|
- name: OS_SERVICE_TYPE
|
||||||
value: {{ tuple $osServiceName $envAll | include "endpoint_type_lookup" }}
|
value: {{ $osServiceType }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
volumes:
|
volumes:
|
||||||
- name: ks-service-sh
|
- name: ks-service-sh
|
||||||
|
@ -52,6 +52,16 @@ database:
|
|||||||
cinder_password: password
|
cinder_password: password
|
||||||
cinder_user: cinder
|
cinder_user: cinder
|
||||||
|
|
||||||
|
ceph:
|
||||||
|
enabled: true
|
||||||
|
monitors: []
|
||||||
|
cinder_user: "admin"
|
||||||
|
cinder_pool: "volumes"
|
||||||
|
# a null value for the keyring will
|
||||||
|
# attempt to use the key from
|
||||||
|
# common/secrets/ceph-client-key
|
||||||
|
cinder_keyring: null
|
||||||
|
|
||||||
backends:
|
backends:
|
||||||
enabled:
|
enabled:
|
||||||
- rbd1
|
- rbd1
|
||||||
@ -108,40 +118,45 @@ dependencies:
|
|||||||
service:
|
service:
|
||||||
- mariadb
|
- mariadb
|
||||||
- keystone-api
|
- keystone-api
|
||||||
|
volume:
|
||||||
|
service:
|
||||||
|
- keystone-api
|
||||||
|
- cinder-api
|
||||||
|
|
||||||
|
# We use a different layout of the endpoints here to account for versioning
|
||||||
|
# this swaps the service name and type, and should be rolled out to other
|
||||||
|
# services.
|
||||||
endpoints:
|
endpoints:
|
||||||
keystone:
|
identity:
|
||||||
|
name: keystone
|
||||||
hosts:
|
hosts:
|
||||||
default: keystone-api
|
default: keystone-api
|
||||||
path: /v3
|
path: /v3
|
||||||
type: identity
|
|
||||||
scheme: 'http'
|
scheme: 'http'
|
||||||
port:
|
port:
|
||||||
admin: 35357
|
admin: 35357
|
||||||
public: 5000
|
public: 5000
|
||||||
cinder:
|
volume:
|
||||||
|
name: cinder
|
||||||
hosts:
|
hosts:
|
||||||
default: cinder-api
|
default: cinder-api
|
||||||
path: '/v1/%(tenant_id)s'
|
path: '/v1/%(tenant_id)s'
|
||||||
type: volume
|
|
||||||
scheme: 'http'
|
scheme: 'http'
|
||||||
port:
|
port:
|
||||||
api: 8776
|
api: 8776
|
||||||
cinderv2:
|
volumev2:
|
||||||
name: cinder
|
name: cinder
|
||||||
hosts:
|
hosts:
|
||||||
default: cinder-api
|
default: cinder-api
|
||||||
path: '/v2/%(tenant_id)s'
|
path: '/v2/%(tenant_id)s'
|
||||||
type: volumev2
|
|
||||||
scheme: 'http'
|
scheme: 'http'
|
||||||
port:
|
port:
|
||||||
api: 8776
|
api: 8776
|
||||||
cinderv3:
|
volumev3:
|
||||||
name: cinder
|
name: cinder
|
||||||
hosts:
|
hosts:
|
||||||
default: cinder-api
|
default: cinder-api
|
||||||
path: '/v3/%(tenant_id)s'
|
path: '/v3/%(tenant_id)s'
|
||||||
type: volumev3
|
|
||||||
scheme: 'http'
|
scheme: 'http'
|
||||||
port:
|
port:
|
||||||
api: 8776
|
api: 8776
|
||||||
|
Loading…
Reference in New Issue
Block a user