Merge "Ingress controller service: consolidate to helm-toolkit"

This commit is contained in:
Zuul 2018-03-14 02:14:22 +00:00 committed by Gerrit Code Review
commit 32a468178b
24 changed files with 108 additions and 307 deletions

View File

@ -14,19 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.service_ingress_api }} {{- if and .Values.manifests.service_ingress_api .Values.network.api.ingress.public }}
{{- $envAll := . }} {{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "key-manager" -}}
{{- if .Values.network.api.ingress.public }} {{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ tuple "key-manager" "public" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec:
ports:
- name: http
port: 80
selector:
app: ingress-api
{{- end }}
{{- end }} {{- end }}

View File

@ -14,19 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.service_ingress_api }} {{- if and .Values.manifests.service_ingress_api .Values.network.api.ingress.public }}
{{- $envAll := . }} {{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "metering" -}}
{{- if .Values.network.api.ingress.public }} {{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ tuple "metering" "public" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec:
ports:
- name: http
port: 80
selector:
app: ingress-api
{{- end }}
{{- end }} {{- end }}

View File

@ -14,19 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.service_ingress_api }} {{- if and .Values.manifests.service_ingress_api .Values.network.api.ingress.public }}
{{- $envAll := . }} {{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "volume" -}}
{{- if .Values.network.api.ingress.public }} {{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ tuple "volume" "public" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec:
ports:
- name: http
port: 80
selector:
app: ingress-api
{{- end }}
{{- end }} {{- end }}

View File

@ -14,19 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.service_ingress_api }} {{- if and .Values.manifests.service_ingress_api .Values.network.api.ingress.public }}
{{- $envAll := . }} {{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "policy" -}}
{{- if .Values.network.api.ingress.public }} {{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ tuple "policy" "public" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec:
ports:
- name: http
port: 80
selector:
app: ingress-api
{{- end }}
{{- end }} {{- end }}

View File

@ -14,19 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.service_ingress_api }} {{- if and .Values.manifests.service_ingress_api .Values.network.api.ingress.public }}
{{- $envAll := . }} {{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "image" -}}
{{- if .Values.network.api.ingress.public }} {{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ tuple "image" "public" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec:
ports:
- name: http
port: 80
selector:
app: ingress-api
{{- end }}
{{- end }} {{- end }}

View File

@ -14,19 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.service_ingress_registry }} {{- if and .Values.manifests.service_ingress_registry .Values.network.registry.ingress.public }}
{{- $envAll := . }} {{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "image_registry" -}}
{{- if .Values.network.registry.ingress.public }} {{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ tuple "image_registry" "public" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec:
ports:
- name: http
port: 80
selector:
app: ingress-api
{{- end }}
{{- end }} {{- end }}

View File

@ -14,19 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.service_ingress_api }} {{- if and .Values.manifests.service_ingress_api .Values.network.api.ingress.public }}
{{- $envAll := . }} {{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "metric" -}}
{{- if .Values.network.api.ingress.public }} {{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ tuple "metric" "public" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec:
ports:
- name: http
port: 80
selector:
app: ingress-api
{{- end }}
{{- end }} {{- end }}

View File

@ -14,19 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.service_ingress_api }} {{- if and .Values.manifests.service_ingress_api .Values.network.api.ingress.public }}
{{- $envAll := . }} {{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "orchestration" -}}
{{- if .Values.network.api.ingress.public }} {{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ tuple "orchestration" "public" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec:
ports:
- name: http
port: 80
selector:
app: ingress-api
{{- end }}
{{- end }} {{- end }}

View File

@ -14,19 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.service_ingress_cfn }} {{- if and .Values.manifests.service_ingress_cfn .Values.network.cfn.ingress.public }}
{{- $envAll := . }} {{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "cloudformation" -}}
{{- if .Values.network.cfn.ingress.public }} {{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ tuple "cloudformation" "public" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec:
ports:
- name: http
port: 80
selector:
app: ingress-api
{{- end }}
{{- end }} {{- end }}

View File

@ -14,19 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.service_ingress_cloudwatch }} {{- if and .Values.manifests.service_ingress_cloudwatch .Values.network.cloudwatch.ingress.public }}
{{- $envAll := . }} {{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "cloudwatch" -}}
{{- if .Values.network.cloudwatch.ingress.public }} {{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ tuple "cloudwatch" "public" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec:
ports:
- name: http
port: 80
selector:
app: ingress-api
{{- end }}
{{- end }} {{- end }}

View File

@ -0,0 +1,43 @@
{{/*
Copyright 2017 The Openstack-Helm Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
# This function creates a manifest for a services ingress rules.
# It can be used in charts dict created similar to the following:
# {- $serviceIngressOpts := dict "envAll" . "backendServiceType" "key-manager" -}
# { $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }
{{- define "helm-toolkit.manifests.service_ingress" -}}
{{- $envAll := index . "envAll" -}}
{{- $backendServiceType := index . "backendServiceType" -}}
---
apiVersion: v1
kind: Service
metadata:
name: {{ tuple $backendServiceType "public" $envAll | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec:
ports:
- name: http
port: 80
selector:
app: ingress-api
{{- if index $envAll.Values.endpoints $backendServiceType }}
{{- if index $envAll.Values.endpoints $backendServiceType "ip" }}
{{- if index $envAll.Values.endpoints $backendServiceType "ip" "ingress" }}
clusterIP: {{ (index $envAll.Values.endpoints $backendServiceType "ip" "ingress") }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -14,19 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.service_ingress }} {{- if and .Values.manifests.service_ingress .Values.network.dashboard.ingress.public }}
{{- $envAll := . }} {{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "dashboard" -}}
{{- if .Values.network.dashboard.ingress.public }} {{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ tuple "dashboard" "public" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec:
ports:
- name: http
port: 80
selector:
app: ingress-api
{{- end }}
{{- end }} {{- end }}

View File

@ -15,16 +15,6 @@ limitations under the License.
*/}} */}}
{{- if and .Values.manifests.service_ingress_api .Values.network.api.ingress.public }} {{- if and .Values.manifests.service_ingress_api .Values.network.api.ingress.public }}
{{- $envAll := . }} {{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "baremetal" -}}
--- {{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }}
apiVersion: v1
kind: Service
metadata:
name: {{ tuple "baremetal" "public" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec:
ports:
- name: http
port: 80
selector:
app: ingress-api
{{- end }} {{- end }}

View File

@ -14,19 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.service_ingress_api }} {{- if and .Values.manifests.service_ingress_api .Values.network.api.ingress.public }}
{{- $envAll := . }} {{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "identity" -}}
{{- if .Values.network.api.ingress.public }} {{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ tuple "identity" "public" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec:
ports:
- name: http
port: 80
selector:
app: ingress-api
{{- end }}
{{- end }} {{- end }}

View File

@ -14,19 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.service_ingress_api }} {{- if and .Values.manifests.service_ingress_api .Values.network.api.ingress.public }}
{{- $envAll := . }} {{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "container-infra" -}}
{{- if .Values.network.api.ingress.public }} {{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ tuple "container-infra" "public" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec:
ports:
- name: http
port: 80
selector:
app: ingress-api
{{- end }}
{{- end }} {{- end }}

View File

@ -14,19 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.service_ingress_api }} {{- if and .Values.manifests.service_ingress_api .Values.network.api.ingress.public }}
{{- $envAll := . }} {{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "workflow" -}}
{{- if .Values.network.api.ingress.public }} {{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ tuple "workflow" "public" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec:
ports:
- name: http
port: 80
selector:
app: ingress-api
{{- end }}
{{- end }} {{- end }}

View File

@ -14,18 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.service_ingress_server }} {{- if and .Values.manifests.service_ingress_server .Values.network.server.ingress.public }}
{{- $envAll := . }} {{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "network" -}}
{{- if .Values.network.server.ingress.public }} {{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ tuple "network" "public" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec:
ports:
- port: 80
selector:
app: ingress-api
{{- end }}
{{- end }} {{- end }}

View File

@ -18,7 +18,7 @@ limitations under the License.
set -ex set -ex
metadata_ip="{{- .Values.network.metadata.ip -}}" metadata_ip="{{- .Values.endpoints.compute_metadata.ip.ingress -}}"
if [ -z "${metadata_ip}" ] ; then if [ -z "${metadata_ip}" ] ; then
metadata_ip=$(getent hosts metadata | awk '{print $1}') metadata_ip=$(getent hosts metadata | awk '{print $1}')
fi fi
@ -27,4 +27,3 @@ cat <<EOF>/tmp/pod-shared/nova-api-metadata.ini
[DEFAULT] [DEFAULT]
metadata_host=$metadata_ip metadata_host=$metadata_ip
EOF EOF

View File

@ -103,10 +103,8 @@ limitations under the License.
{{- tuple "oslo_cache" "internal" "memcache" . | include "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" | set .Values.conf.nova.cache "memcache_servers" | quote | trunc 0 -}} {{- tuple "oslo_cache" "internal" "memcache" . | include "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" | set .Values.conf.nova.cache "memcache_servers" | quote | trunc 0 -}}
{{- end -}} {{- end -}}
{{- if empty .Values.conf.nova.DEFAULT.metadata_host -}} {{- if and (empty .Values.conf.nova.DEFAULT.metadata_host) .Values.endpoints.compute_metadata.ip.ingress -}}
{{- if .Values.network.metadata.ip -}} {{- set .Values.conf.nova.DEFAULT "metadata_host" .Values.endpoints.compute_metadata.ip.ingress | quote | trunc 0 -}}
{{- set .Values.conf.nova.DEFAULT "metadata_host" .Values.network.metadata.ip | quote | trunc 0 -}}
{{- end -}}
{{- end -}} {{- end -}}
{{- if empty .Values.conf.nova.DEFAULT.metadata_port -}} {{- if empty .Values.conf.nova.DEFAULT.metadata_port -}}

View File

@ -14,22 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.service_ingress_metadata }} {{- if and .Values.manifests.service_ingress_metadata .Values.network.metadata.ingress.public }}
{{- $envAll := . }} {{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "compute_metadata" -}}
{{- if .Values.network.metadata.ingress.public }} {{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ tuple "compute_metadata" "public" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec:
ports:
- name: http
port: 80
{{- if .Values.network.metadata.ip }}
clusterIP: {{ .Values.network.metadata.ip }}
{{- end }}
selector:
app: ingress-api
{{- end }}
{{- end }} {{- end }}

View File

@ -14,19 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.service_ingress_osapi }} {{- if and .Values.manifests.service_ingress_osapi .Values.network.osapi.ingress.public }}
{{- $envAll := . }} {{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "compute" -}}
{{- if .Values.network.osapi.ingress.public }} {{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ tuple "compute" "public" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec:
ports:
- name: http
port: 80
selector:
app: ingress-api
{{- end }}
{{- end }} {{- end }}

View File

@ -14,19 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.service_ingress_placement }} {{- if and .Values.manifests.service_ingress_placement .Values.network.placement.ingress.public }}
{{- $envAll := . }} {{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "placement" -}}
{{- if .Values.network.placement.ingress.public }} {{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ tuple "placement" "public" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec:
ports:
- name: http
port: 80
selector:
app: ingress-api
{{- end }}
{{- end }} {{- end }}

View File

@ -138,8 +138,6 @@ network:
enabled: false enabled: false
port: 30774 port: 30774
metadata: metadata:
# IF blank, set clusterIP and metadata_host dynamically
ip:
port: 8775 port: 8775
ingress: ingress:
public: true public: true
@ -1254,6 +1252,9 @@ endpoints:
default: 6080 default: 6080
compute_metadata: compute_metadata:
name: nova name: nova
ip:
# IF blank, set clusterIP and metadata_host dynamically
ingress: null
hosts: hosts:
default: nova-metadata default: nova-metadata
public: metadata public: metadata

View File

@ -14,19 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.service_ingress_api }} {{- if and .Values.manifests.service_ingress_api .Values.network.api.ingress.public }}
{{- $envAll := . }} {{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "clustering" -}}
{{- if .Values.network.api.ingress.public }} {{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ tuple "clustering" "public" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec:
ports:
- name: http
port: 80
selector:
app: ingress-api
{{- end }}
{{- end }} {{- end }}