OSH-infra: move charts to use ingress manifest in htk

This moves all relevant charts in osh-infra to use the htk manifest
template for ingresses, bringing them in line with the charts in
openstack-helm

Change-Id: Ic9c3cc6f0051fa66b6f88ec2b2725698b36ce824
This commit is contained in:
Steve Wilkerson 2018-04-13 13:43:51 -05:00
parent 9dd81954fd
commit 7757400edc
17 changed files with 61 additions and 304 deletions

View File

@ -14,45 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.ingress }} {{- if and .Values.manifests.ingress .Values.network.grafana.ingress.public }}
{{- $envAll := . }} {{- $ingressOpts := dict "envAll" . "backendService" "grafana" "backendServiceType" "grafana" "backendPort" "dashboard" -}}
{{- if .Values.network.grafana.ingress.public }} {{ $ingressOpts | include "helm-toolkit.manifests.ingress" }}
{{- $backendServiceType := "grafana" }}
{{- $backendPort := "dashboard" }}
{{- $ingressName := tuple $backendServiceType "public" $envAll | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
{{- $backendName := tuple $backendServiceType "internal" $envAll | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
{{- $hostName := tuple $backendServiceType "public" $envAll | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
{{- $hostNameNamespaced := tuple $backendServiceType "public" $envAll | include "helm-toolkit.endpoints.hostname_namespaced_endpoint_lookup" }}
{{- $hostNameFull := tuple $backendServiceType "public" $envAll | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup" }}
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $ingressName }}
annotations:
{{ toYaml .Values.network.grafana.ingress.annotations | indent 4 }}
spec:
rules:
{{ if ne $hostNameNamespaced $hostNameFull }}
{{- range $key1, $vHost := tuple $hostName $hostNameNamespaced $hostNameFull }}
- host: {{ $vHost }}
http:
paths:
- path: /
backend:
serviceName: {{ $backendName }}
servicePort: {{ $backendPort }}
{{- end }}
{{- else }}
{{- range $key1, $vHost := tuple $hostName $hostNameNamespaced }}
- host: {{ $vHost }}
http:
paths:
- path: /
backend:
serviceName: {{ $backendName }}
servicePort: {{ $backendPort }}
{{- end }}
{{- 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.grafana.ingress.public }}
{{- $envAll := . }} {{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "grafana" -}}
{{- if .Values.network.grafana.ingress.public }} {{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ tuple "grafana" "public" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec:
ports:
- name: http
port: 80
selector:
app: ingress-api
{{- end }}
{{- end }} {{- end }}

View File

@ -162,6 +162,7 @@ endpoints:
port: port:
grafana: grafana:
default: 3000 default: 3000
public: 80
monitoring: monitoring:
name: prometheus name: prometheus
namespace: null namespace: null
@ -226,9 +227,11 @@ network:
port: 30902 port: 30902
ingress: ingress:
public: true public: true
classes:
namespace: "nginx"
cluster: "nginx-cluster"
annotations: annotations:
kubernetes.io/ingress.class: "nginx" nginx.ingress.kubernetes.io/rewrite-target: /
ingress.kubernetes.io/rewrite-target: /
secrets: secrets:
oslo_db: oslo_db:

View File

@ -1,12 +1,9 @@
{{/* {{/*
Copyright 2017 The Openstack-Helm Authors. Copyright 2017 The Openstack-Helm Authors.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
You may obtain a copy of the License at You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

View File

@ -1,12 +1,9 @@
{{/* {{/*
Copyright 2017 The Openstack-Helm Authors. Copyright 2017 The Openstack-Helm Authors.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
You may obtain a copy of the License at You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

View File

@ -14,47 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.ingress_kibana }} {{- if and .Values.manifests.ingress .Values.network.kibana.ingress.public }}
{{- $envAll := . }} {{- $ingressOpts := dict "envAll" . "backendService" "kibana" "backendServiceType" "kibana" "backendPort" "http" -}}
{{- if .Values.network.kibana.ingress.public }} {{ $ingressOpts | include "helm-toolkit.manifests.ingress" }}
{{- $backendServiceType := "kibana" }}
{{- $backendPort := "http" }}
{{- $ingressName := tuple $backendServiceType "public" $envAll | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
{{- $backendName := tuple $backendServiceType "internal" $envAll | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
{{- $hostName := tuple $backendServiceType "public" $envAll | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
{{- $hostNameNamespaced := tuple $backendServiceType "public" $envAll | include "helm-toolkit.endpoints.hostname_namespaced_endpoint_lookup" }}
{{- $hostNameFull := tuple $backendServiceType "public" $envAll | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup" }}
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $ingressName }}
annotations:
kubernetes.io/ingress.class: "nginx"
ingress.kubernetes.io/rewrite-target: /
ingress.kubernetes.io/proxy-body-size: {{ .Values.network.kibana.ingress.proxy_body_size }}
spec:
rules:
{{ if ne $hostNameNamespaced $hostNameFull }}
{{- range $key1, $vHost := tuple $hostName $hostNameNamespaced $hostNameFull }}
- host: {{ $vHost }}
http:
paths:
- path: /
backend:
serviceName: {{ $backendName }}
servicePort: {{ $backendPort }}
{{- end }}
{{- else }}
{{- range $key1, $vHost := tuple $hostName $hostNameNamespaced }}
- host: {{ $vHost }}
http:
paths:
- path: /
backend:
serviceName: {{ $backendName }}
servicePort: {{ $backendPort }}
{{- end }}
{{- 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_kibana }} {{- if and .Values.manifests.service_ingress .Values.network.kibana.ingress.public }}
{{- if .Values.network.kibana.ingress.public }} {{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "kibana" -}}
{{- $envAll := . }} {{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ tuple "kibana" "public" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec:
ports:
- name: http
port: 80
selector:
app: ingress-api
{{- end }}
{{- end }} {{- end }}

View File

@ -176,7 +176,11 @@ network:
kibana: kibana:
ingress: ingress:
public: true public: true
proxy_body_size: 1024M classes:
namespace: "nginx"
cluster: "nginx-cluster"
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
node_port: node_port:
enabled: false enabled: false
port: 30905 port: 30905
@ -186,9 +190,9 @@ manifests:
configmap_bin: true configmap_bin: true
configmap_etc: true configmap_etc: true
deployment: true deployment: true
ingress_kibana: true ingress: true
job_image_repo_sync: true job_image_repo_sync: true
secret_elasticsearch: true secret_elasticsearch: true
secret_admin: true secret_admin: true
service: true service: true
service_ingress_kibana: true service_ingress: true

View File

@ -14,47 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.ingress }} {{- if and .Values.manifests.ingress .Values.network.nagios.ingress.public }}
{{- $envAll := . }} {{- $ingressOpts := dict "envAll" . "backendService" "nagios" "backendServiceType" "nagios" "backendPort" "metrics" -}}
{{- if .Values.network.nagios.ingress.public }} {{ $ingressOpts | include "helm-toolkit.manifests.ingress" }}
{{- $backendServiceType := "nagios" }}
{{- $backendPort := "n-metrics" }}
{{- $ingressName := tuple $backendServiceType "public" $envAll | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
{{- $backendName := tuple $backendServiceType "internal" $envAll | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
{{- $hostName := tuple $backendServiceType "public" $envAll | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
{{- $hostNameNamespaced := tuple $backendServiceType "public" $envAll | include "helm-toolkit.endpoints.hostname_namespaced_endpoint_lookup" }}
{{- $hostNameFull := tuple $backendServiceType "public" $envAll | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup" }}
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $ingressName }}
annotations:
kubernetes.io/ingress.class: "nginx"
ingress.kubernetes.io/rewrite-target: /
ingress.kubernetes.io/proxy-body-size: {{ .Values.network.prometheus.ingress.proxy_body_size }}
spec:
rules:
{{ if ne $hostNameNamespaced $hostNameFull }}
{{- range $key1, $vHost := tuple $hostName $hostNameNamespaced $hostNameFull }}
- host: {{ $vHost }}
http:
paths:
- path: /
backend:
serviceName: {{ $backendName }}
servicePort: {{ $backendPort }}
{{- end }}
{{- else }}
{{- range $key1, $vHost := tuple $hostName $hostNameNamespaced }}
- host: {{ $vHost }}
http:
paths:
- path: /
backend:
serviceName: {{ $backendName }}
servicePort: {{ $backendPort }}
{{- end }}
{{- 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.nagios.ingress.public }}
{{- if .Values.network.nagios.ingress.public }} {{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "nagios" -}}
{{- $envAll := . }} {{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ tuple "nagios" "public" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec:
ports:
- name: http
port: 80
selector:
app: ingress-api
{{- end }}
{{- end }} {{- end }}

View File

@ -95,7 +95,11 @@ network:
nagios: nagios:
ingress: ingress:
public: true public: true
proxy_body_size: 1024M classes:
namespace: "nginx"
cluster: "nginx-cluster"
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
node_port: node_port:
enabled: false enabled: false
port: 30925 port: 30925
@ -135,8 +139,10 @@ manifests:
configmap_bin: true configmap_bin: true
configmap_etc: true configmap_etc: true
deployment: true deployment: true
ingress: true
job_image_repo_sync: true job_image_repo_sync: true
service: true service: true
service_ingress: true
conf: conf:
nagios: nagios:

View File

@ -14,47 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.ingress }} {{- if and .Values.manifests.ingress .Values.network.alertmanager.ingress.public }}
{{- $envAll := . }} {{- $ingressOpts := dict "envAll" . "backendService" "alertmanager" "backendServiceType" "alerts" "backendPort" "alerts-api" -}}
{{- if .Values.network.alertmanager.ingress.public }} {{ $ingressOpts | include "helm-toolkit.manifests.ingress" }}
{{- $backendServiceType := "alerts" }}
{{- $backendPort := "alerts-api" }}
{{- $ingressName := tuple $backendServiceType "public" $envAll | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
{{- $backendName := tuple $backendServiceType "internal" $envAll | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
{{- $hostName := tuple $backendServiceType "public" $envAll | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
{{- $hostNameNamespaced := tuple $backendServiceType "public" $envAll | include "helm-toolkit.endpoints.hostname_namespaced_endpoint_lookup" }}
{{- $hostNameFull := tuple $backendServiceType "public" $envAll | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup" }}
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $ingressName }}
annotations:
kubernetes.io/ingress.class: "nginx"
ingress.kubernetes.io/rewrite-target: /
ingress.kubernetes.io/proxy-body-size: {{ .Values.network.alertmanager.ingress.proxy_body_size }}
spec:
rules:
{{ if ne $hostNameNamespaced $hostNameFull }}
{{- range $key1, $vHost := tuple $hostName $hostNameNamespaced $hostNameFull }}
- host: {{ $vHost }}
http:
paths:
- path: /
backend:
serviceName: {{ $backendName }}
servicePort: {{ $backendPort }}
{{- end }}
{{- else }}
{{- range $key1, $vHost := tuple $hostName $hostNameNamespaced }}
- host: {{ $vHost }}
http:
paths:
- path: /
backend:
serviceName: {{ $backendName }}
servicePort: {{ $backendPort }}
{{- end }}
{{- 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.alertmanager.ingress.public }}
{{- $envAll := . }} {{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "alerts" -}}
{{- if .Values.network.alertmanager.ingress.public }} {{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ tuple "alerts" "public" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec:
ports:
- name: http
port: 80
selector:
app: ingress-api
{{- end }}
{{- end }} {{- end }}

View File

@ -129,7 +129,11 @@ network:
alertmanager: alertmanager:
ingress: ingress:
public: true public: true
proxy_body_size: 1024M classes:
namespace: "nginx"
cluster: "nginx-cluster"
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
node_port: node_port:
enabled: false enabled: false
port: 30903 port: 30903

View File

@ -14,47 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.ingress_prometheus }} {{- if and .Values.manifests.ingress .Values.network.prometheus.ingress.public }}
{{- $envAll := . }} {{- $ingressOpts := dict "envAll" . "backendService" "prometheus" "backendServiceType" "monitoring" "backendPort" "prom-metrics" -}}
{{- if .Values.network.prometheus.ingress.public }} {{ $ingressOpts | include "helm-toolkit.manifests.ingress" }}
{{- $backendServiceType := "monitoring" }}
{{- $backendPort := "prom-metrics" }}
{{- $ingressName := tuple $backendServiceType "public" $envAll | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
{{- $backendName := tuple $backendServiceType "internal" $envAll | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
{{- $hostName := tuple $backendServiceType "public" $envAll | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
{{- $hostNameNamespaced := tuple $backendServiceType "public" $envAll | include "helm-toolkit.endpoints.hostname_namespaced_endpoint_lookup" }}
{{- $hostNameFull := tuple $backendServiceType "public" $envAll | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup" }}
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $ingressName }}
annotations:
kubernetes.io/ingress.class: "nginx"
ingress.kubernetes.io/rewrite-target: /
ingress.kubernetes.io/proxy-body-size: {{ .Values.network.prometheus.ingress.proxy_body_size }}
spec:
rules:
{{ if ne $hostNameNamespaced $hostNameFull }}
{{- range $key1, $vHost := tuple $hostName $hostNameNamespaced $hostNameFull }}
- host: {{ $vHost }}
http:
paths:
- path: /
backend:
serviceName: {{ $backendName }}
servicePort: {{ $backendPort }}
{{- end }}
{{- else }}
{{- range $key1, $vHost := tuple $hostName $hostNameNamespaced }}
- host: {{ $vHost }}
http:
paths:
- path: /
backend:
serviceName: {{ $backendName }}
servicePort: {{ $backendPort }}
{{- end }}
{{- 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_prometheus }} {{- if and .Values.manifests.service_ingress .Values.network.prometheus.ingress.public }}
{{- if .Values.network.prometheus.ingress.public }} {{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "monitoring" -}}
{{- $envAll := . }} {{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ tuple "monitoring" "public" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec:
ports:
- name: http
port: 80
selector:
app: ingress-api
{{- end }}
{{- end }} {{- end }}

View File

@ -156,7 +156,11 @@ network:
prometheus: prometheus:
ingress: ingress:
public: true public: true
proxy_body_size: 1024M classes:
namespace: "nginx"
cluster: "nginx-cluster"
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
node_port: node_port:
enabled: false enabled: false
port: 30900 port: 30900
@ -173,10 +177,10 @@ storage:
manifests: manifests:
configmap_bin: true configmap_bin: true
configmap_etc: true configmap_etc: true
ingress_prometheus: true ingress: true
helm_tests: true helm_tests: true
job_image_repo_sync: true job_image_repo_sync: true
service_ingress_prometheus: true service_ingress: true
service: true service: true
statefulset_prometheus: true statefulset_prometheus: true