diff --git a/incubator/istio/Chart.yaml b/incubator/istio/Chart.yaml index 0dc0130c9a..05eb0dc6f6 100644 --- a/incubator/istio/Chart.yaml +++ b/incubator/istio/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Istio Helm chart for Kubernetes name: istio -version: 0.1.1 +version: 0.1.3 appVersion: 0.1.5 home: https://istio.io/ icon: https://github.com/istio/istio.github.io/blob/master/favicons/android-chrome-96x96.png diff --git a/incubator/istio/templates/NOTES.txt b/incubator/istio/templates/NOTES.txt index fc79acf33a..16fa134e78 100644 --- a/incubator/istio/templates/NOTES.txt +++ b/incubator/istio/templates/NOTES.txt @@ -2,17 +2,17 @@ Verify all Pods are running kubectl get pods --namespace {{ .Release.Namespace }} -{{if .Values.addons.grafana.enabled}} +{{ if .Values.addons.grafana.enabled }} Verifying the Grafana dashboard - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ $serviceName }}-grafana" -o jsonpath="{.items[0].metadata.name}") + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "component={{ $serviceName }}-{{ .Values.addons.grafana.deployment.name }}" -o jsonpath="{.items[0].metadata.name}") kubectl port-forward $POD_NAME {{ .Values.addons.grafana.service.externalPort }}:{{ .Values.addons.grafana.service.externalPort }} echo http://127.0.0.1:{{ .Values.addons.grafana.service.externalPort }}/dashboard/db/istio-dashboard {{- end }} -{{if .Values.addons.servicegraph.enabled}} +{{ if .Values.addons.servicegraph.enabled }} Verifying the ServiceGraph service - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ $serviceName }}-servicegraph" -o jsonpath="{.items[0].metadata.name}") + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "component={{ $serviceName }}-{{ .Values.addons.servicegraph.deployment.name }}" -o jsonpath="{.items[0].metadata.name}") kubectl port-forward $POD_NAME {{ .Values.addons.servicegraph.service.externalPort }}:{{ .Values.addons.servicegraph.service.externalPort }} echo http://127.0.0.1:{{ .Values.addons.servicegraph.service.externalPort }}/dotviz {{- end }} diff --git a/incubator/istio/templates/_helpers.tpl b/incubator/istio/templates/_helpers.tpl index f0d83d2edb..81b03cdf5f 100644 --- a/incubator/istio/templates/_helpers.tpl +++ b/incubator/istio/templates/_helpers.tpl @@ -14,3 +14,29 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- $name := default .Chart.Name .Values.nameOverride -}} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{- /* +Credit: @technosophos +https://github.com/technosophos/common-chart/ +labels.standard prints the standard Helm labels. +The standard labels are frequently used in metadata. +*/ -}} +{{- define "labels.standard" -}} +app: {{ template "name" . }} +heritage: {{ .Release.Service | quote }} +release: {{ .Release.Name | quote }} +chart: {{ template "chartref" . }} +{{- end -}} + +{{- /* +Credit: @technosophos +https://github.com/technosophos/common-chart/ +chartref prints a chart name and version. +It does minimal escaping for use in Kubernetes labels. +Example output: + zookeeper-1.2.3 + wordpress-3.2.1_20170219 +*/ -}} +{{- define "chartref" -}} + {{- replace "+" "_" .Chart.Version | printf "%s-%s" .Chart.Name -}} +{{- end -}} \ No newline at end of file diff --git a/incubator/istio/templates/addons-grafana-deployment.yaml b/incubator/istio/templates/addons-grafana-deployment.yaml index 3a0400b179..c5a8ce61e4 100644 --- a/incubator/istio/templates/addons-grafana-deployment.yaml +++ b/incubator/istio/templates/addons-grafana-deployment.yaml @@ -1,9 +1,12 @@ -{{if .Values.addons.grafana.enabled}} +{{ if .Values.addons.grafana.enabled }} {{- $serviceName := include "fullname" . -}} apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: {{ $serviceName }}-grafana + name: {{ $serviceName }}-{{ .Values.addons.grafana.deployment.name }} + labels: +{{ include "labels.standard" . | indent 4 }} + component: {{ $serviceName }}-{{ .Values.addons.grafana.deployment.name }} spec: replicas: {{ .Values.addons.grafana.deployment.replicas }} template: @@ -13,10 +16,11 @@ spec: {{ $key }}: {{ $value | quote }} {{- end }} labels: - app: {{ $serviceName }}-grafana +{{ include "labels.standard" . | indent 8 }} + component: {{ $serviceName }}-{{ .Values.addons.grafana.deployment.name }} spec: containers: - - name: grafana + - name: {{ .Values.addons.grafana.deployment.name }} image: "{{ .Values.addons.grafana.deployment.image }}:{{ .Values.istioRelease }}" imagePullPolicy: {{ .Values.addons.grafana.deployment.imagePullPolicy }} ports: diff --git a/incubator/istio/templates/addons-grafana-svc.yaml b/incubator/istio/templates/addons-grafana-svc.yaml index 1f98679f9b..d3851b126c 100644 --- a/incubator/istio/templates/addons-grafana-svc.yaml +++ b/incubator/istio/templates/addons-grafana-svc.yaml @@ -1,9 +1,11 @@ -{{if .Values.addons.grafana.enabled}} +{{ if .Values.addons.grafana.enabled }} {{- $serviceName := include "fullname" . -}} apiVersion: v1 kind: Service metadata: - name: {{ $serviceName }}-grafana + name: {{ $serviceName }}-{{ .Values.addons.grafana.deployment.name }} + labels: +{{ include "labels.standard" . | indent 4 }} spec: type: {{ .Values.addons.grafana.service.type }} ports: @@ -11,5 +13,7 @@ spec: protocol: TCP name: grafana selector: - app: {{ $serviceName }}-grafana + app: {{ include "name" . }} + component: {{ $serviceName }}-{{ .Values.addons.grafana.deployment.name }} + release: {{ .Release.Name }} {{end}} \ No newline at end of file diff --git a/incubator/istio/templates/addons-prometheus-configmap.yaml b/incubator/istio/templates/addons-prometheus-configmap.yaml index 19004a114b..c83bf7d5bc 100644 --- a/incubator/istio/templates/addons-prometheus-configmap.yaml +++ b/incubator/istio/templates/addons-prometheus-configmap.yaml @@ -1,9 +1,11 @@ -{{if .Values.addons.prometheus.enabled}} +{{ if .Values.addons.prometheus.enabled }} {{- $serviceName := include "fullname" . -}} apiVersion: v1 kind: ConfigMap metadata: - name: {{ $serviceName }}-prometheus + name: {{ $serviceName }}-{{ .Values.addons.prometheus.deployment.name }} + labels: +{{ include "labels.standard" . | indent 4 }} data: prometheus.yml: |- global: @@ -17,4 +19,4 @@ data: # scheme defaults to 'http'. static_configs: - targets: ['{{ template "fullname" . }}-mixer:{{ .Values.mixer.service.externalPrometheusPort }}'] -{{end}} \ No newline at end of file +{{ end }} \ No newline at end of file diff --git a/incubator/istio/templates/addons-prometheus-deployment.yaml b/incubator/istio/templates/addons-prometheus-deployment.yaml index 29b865c146..74c5f6c9eb 100644 --- a/incubator/istio/templates/addons-prometheus-deployment.yaml +++ b/incubator/istio/templates/addons-prometheus-deployment.yaml @@ -1,26 +1,31 @@ -{{if .Values.addons.prometheus.enabled}} +{{ if .Values.addons.prometheus.enabled }} {{- $serviceName := include "fullname" . -}} apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: {{ $serviceName }}-prometheus + name: {{ $serviceName }}-{{ .Values.addons.prometheus.deployment.name }} + labels: +{{ include "labels.standard" . | indent 4 }} + component: {{ $serviceName }}-{{ .Values.addons.prometheus.deployment.name }} spec: replicas: {{ .Values.addons.prometheus.deployment.replicas }} selector: matchLabels: - app: {{ $serviceName }}-prometheus +{{ include "labels.standard" . | indent 6 }} + component: {{ $serviceName }}-{{ .Values.addons.prometheus.deployment.name }} template: metadata: annotations: {{- range $key, $value := .Values.addons.prometheus.deployment.annotations }} {{ $key }}: {{ $value | quote }} {{- end }} - name: {{ $serviceName }}-prometheus + name: {{ $serviceName }}-{{ .Values.addons.prometheus.deployment.name }} labels: - app: {{ $serviceName }}-prometheus +{{ include "labels.standard" . | indent 8 }} + component: {{ $serviceName }}-{{ .Values.addons.prometheus.deployment.name }} spec: containers: - - name: prometheus + - name: {{ .Values.addons.prometheus.deployment.name }} image: "{{ .Values.addons.prometheus.deployment.image }}:{{ .Values.addons.prometheus.deployment.imageTag }}" imagePullPolicy: {{ .Values.addons.prometheus.deployment.imagePullPolicy }} args: @@ -38,5 +43,5 @@ spec: volumes: - name: config-volume configMap: - name: {{ $serviceName }}-prometheus -{{end}} \ No newline at end of file + name: {{ $serviceName }}-{{ .Values.addons.prometheus.deployment.name }} +{{ end }} \ No newline at end of file diff --git a/incubator/istio/templates/addons-prometheus-svc.yaml b/incubator/istio/templates/addons-prometheus-svc.yaml index 0415e2134c..c8ada2bd0d 100644 --- a/incubator/istio/templates/addons-prometheus-svc.yaml +++ b/incubator/istio/templates/addons-prometheus-svc.yaml @@ -1,23 +1,24 @@ -{{if .Values.addons.prometheus.enabled}} +{{ if .Values.addons.prometheus.enabled }} {{- $serviceName := include "fullname" . -}} apiVersion: v1 kind: Service metadata: + # Grafana datasource config is hardcoded to prometheus:9090 + # name: {{ $serviceName }}-prometheus + name: {{ .Values.addons.prometheus.deployment.name }} + labels: +{{ include "labels.standard" . | indent 4 }} annotations: {{- range $key, $value := .Values.addons.prometheus.service.annotations }} {{ $key }}: {{ $value | quote }} {{- end }} - labels: - name: {{ $serviceName }}-prometheus - # Grafana datasource config is hardcoded to prometheus:9090 - # name: {{ $serviceName }}-prometheus - name: prometheus spec: - selector: - app: {{ $serviceName }}-prometheus - type: {{ .Values.addons.prometheus.service.type }} ports: - - name: prometheus + - name: {{ .Values.addons.prometheus.deployment.name }} protocol: TCP port: {{ .Values.addons.prometheus.service.externalPort }} -{{end}} \ No newline at end of file + selector: + app: {{ include "name" . }} + component: {{ $serviceName }}-{{ .Values.addons.prometheus.deployment.name }} + release: {{ .Release.Name }} +{{ end }} \ No newline at end of file diff --git a/incubator/istio/templates/addons-servicegraph-deployment.yaml b/incubator/istio/templates/addons-servicegraph-deployment.yaml index bf45d6faca..7b974a2347 100644 --- a/incubator/istio/templates/addons-servicegraph-deployment.yaml +++ b/incubator/istio/templates/addons-servicegraph-deployment.yaml @@ -1,9 +1,12 @@ -{{if .Values.addons.servicegraph.enabled}} +{{ if .Values.addons.servicegraph.enabled }} {{- $serviceName := include "fullname" . -}} apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: {{ $serviceName }}-servicegraph + name: {{ $serviceName }}-{{ .Values.addons.servicegraph.deployment.name }} + labels: +{{ include "labels.standard" . | indent 4 }} + component: {{ $serviceName }}-{{ .Values.addons.servicegraph.deployment.name }} spec: replicas: {{ .Values.addons.servicegraph.deployment.replicas }} template: @@ -13,16 +16,18 @@ spec: {{ $key }}: {{ $value | quote }} {{- end }} labels: - app: {{ $serviceName }}-servicegraph +{{ include "labels.standard" . | indent 8 }} + component: {{ $serviceName }}-{{ .Values.addons.servicegraph.deployment.name }} spec: containers: - - name: servicegraph + - name: {{ .Values.addons.servicegraph.deployment.name }} image: "{{ .Values.addons.servicegraph.deployment.image }}:{{ .Values.addons.servicegraph.deployment.imageTag }}" imagePullPolicy: {{ .Values.addons.servicegraph.deployment.imagePullPolicy }} ports: - containerPort: {{ .Values.addons.servicegraph.service.externalPort }} args: - - --prometheusAddr=http://prometheus:{{ .Values.addons.prometheus.service.externalPort }} + # Currently hardcoded to prometheus as service name due to Grafana being hardcoded. + - --prometheusAddr=http://{{ .Values.addons.prometheus.deployment.name }}:{{ .Values.addons.prometheus.service.externalPort }} resources: {{ toYaml .Values.addons.servicegraph.deployment.resources | indent 10 }} -{{end}} \ No newline at end of file +{{ end }} \ No newline at end of file diff --git a/incubator/istio/templates/addons-servicegraph-svc.yaml b/incubator/istio/templates/addons-servicegraph-svc.yaml index dd6899d2c1..4465355501 100644 --- a/incubator/istio/templates/addons-servicegraph-svc.yaml +++ b/incubator/istio/templates/addons-servicegraph-svc.yaml @@ -1,14 +1,18 @@ -{{if .Values.addons.servicegraph.enabled}} +{{ if .Values.addons.servicegraph.enabled }} {{- $serviceName := include "fullname" . -}} apiVersion: v1 kind: Service metadata: - name: {{ $serviceName }}-servicegraph + name: {{ $serviceName }}-{{ .Values.addons.servicegraph.deployment.name }} + labels: +{{ include "labels.standard" . | indent 4 }} spec: type: {{ .Values.addons.servicegraph.service.type }} ports: - name: http port: {{ .Values.addons.servicegraph.service.externalPort }} selector: - app: {{ $serviceName }}-servicegraph + app: {{ include "name" . }} + component: {{ $serviceName }}-{{ .Values.addons.servicegraph.deployment.name }} + release: {{ .Release.Name }} {{end}} \ No newline at end of file diff --git a/incubator/istio/templates/addons-zipkin-deployment.yaml b/incubator/istio/templates/addons-zipkin-deployment.yaml index e6ca660fed..358522b6bb 100644 --- a/incubator/istio/templates/addons-zipkin-deployment.yaml +++ b/incubator/istio/templates/addons-zipkin-deployment.yaml @@ -1,11 +1,14 @@ -{{if .Values.addons.zipkin.enabled}} +{{ if .Values.addons.zipkin.enabled }} {{- $serviceName := include "fullname" . -}} apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: {{ $serviceName }}-zipkin + name: {{ $serviceName }}-{{ .Values.addons.zipkin.deployment.name }} + labels: +{{ include "labels.standard" . | indent 4 }} + component: {{ $serviceName }}-{{ .Values.addons.zipkin.deployment.name }} spec: - replicas: 1 + replicas: {{ .Values.addons.zipkin.deployment.replicas }} template: metadata: annotations: @@ -13,10 +16,11 @@ spec: {{ $key }}: {{ $value | quote }} {{- end }} labels: - app: {{ $serviceName }}-zipkin +{{ include "labels.standard" . | indent 8 }} + component: {{ $serviceName }}-{{ .Values.addons.zipkin.deployment.name }} spec: containers: - - name: zipkin + - name: {{ .Values.addons.zipkin.deployment.name }} image: "{{ .Values.addons.zipkin.deployment.image }}:{{ .Values.addons.zipkin.deployment.imageTag }}" imagePullPolicy: {{ .Values.addons.zipkin.deployment.imagePullPolicy }} ports: @@ -27,4 +31,4 @@ spec: fieldRef: apiVersion: v1 fieldPath: metadata.namespace -{{end}} \ No newline at end of file +{{ end }} \ No newline at end of file diff --git a/incubator/istio/templates/addons-zipkin-svc.yaml b/incubator/istio/templates/addons-zipkin-svc.yaml index 69ed3228ac..eac630ffa6 100644 --- a/incubator/istio/templates/addons-zipkin-svc.yaml +++ b/incubator/istio/templates/addons-zipkin-svc.yaml @@ -1,14 +1,18 @@ -{{if .Values.addons.zipkin.enabled}} +{{ if .Values.addons.zipkin.enabled }} {{- $serviceName := include "fullname" . -}} apiVersion: v1 kind: Service metadata: name: {{ $serviceName }}-zipkin + labels: +{{ include "labels.standard" . | indent 4 }} spec: type: {{ .Values.addons.zipkin.service.type }} ports: - name: http port: {{ .Values.addons.zipkin.service.externalPort }} selector: - app: {{ $serviceName }}-zipkin -{{end}} \ No newline at end of file + app: {{ include "name" . }} + component: {{ $serviceName }}-{{ .Values.addons.zipkin.deployment.name }} + release: {{ .Release.Name }} +{{ end }} \ No newline at end of file diff --git a/incubator/istio/templates/ca-deployment.yaml b/incubator/istio/templates/ca-deployment.yaml index 4021fb31c3..cc2a76f3cf 100644 --- a/incubator/istio/templates/ca-deployment.yaml +++ b/incubator/istio/templates/ca-deployment.yaml @@ -1,8 +1,14 @@ +{{ if .Values.auth.enabled }} +{{- $serviceName := include "fullname" . -}} apiVersion: v1 kind: Deployment apiVersion: extensions/v1beta1 metadata: - name: {{ template "fullname" . }}-ca + name: {{ $serviceName }}-{{ .Values.ca.deployment.name }} + labels: +{{ include "labels.standard" . | indent 4 }} + component: {{ $serviceName }}-{{ .Values.ca.deployment.name }} + istio: {{ $serviceName }}-{{ .Values.ca.deployment.name }} spec: replicas: {{ .Values.ca.deployment.replicas }} template: @@ -12,11 +18,13 @@ spec: {{ $key }}: {{ $value | quote }} {{- end }} labels: - istio: {{ template "fullname" . }}-ca +{{ include "labels.standard" . | indent 8 }} + component: {{ $serviceName }}-{{ .Values.ca.deployment.name }} + istio: {{ $serviceName }}-{{ .Values.ca.deployment.name }} spec: - serviceAccountName: {{ template "fullname" . }}-ca-service-account + serviceAccountName: {{ $serviceName }}-ca-service-account containers: - - name: istio-ca + - name: {{ .Values.ca.deployment.name }} image: "{{ .Values.ca.deployment.image }}:{{ .Values.istioRelease }}" imagePullPolicy: {{ .Values.ca.deployment.imagePullPolicy }} env: @@ -26,4 +34,5 @@ spec: apiVersion: v1 fieldPath: metadata.namespace resources: -{{ toYaml .Values.ca.deployment.resources | indent 10 }} \ No newline at end of file +{{ toYaml .Values.ca.deployment.resources | indent 10 }} +{{ end }} \ No newline at end of file diff --git a/incubator/istio/templates/ca-service-account.yaml b/incubator/istio/templates/ca-service-account.yaml index 20991d11f4..580b09aad5 100644 --- a/incubator/istio/templates/ca-service-account.yaml +++ b/incubator/istio/templates/ca-service-account.yaml @@ -1,6 +1,10 @@ -{{if .Values.auth.enabled }} +{{ if .Values.auth.enabled }} +{{- $serviceName := include "fullname" . -}} apiVersion: v1 kind: ServiceAccount metadata: - name: {{ template "fullname" . }}-ca-service-account -{{end}} \ No newline at end of file + name: {{ $serviceName }}-ca-service-account + labels: +{{ include "labels.standard" . | indent 4 }} + istio: {{ $serviceName }}-ca +{{ end }} \ No newline at end of file diff --git a/incubator/istio/templates/configmap.yaml b/incubator/istio/templates/configmap.yaml index 6e150018e0..497d51d8ca 100644 --- a/incubator/istio/templates/configmap.yaml +++ b/incubator/istio/templates/configmap.yaml @@ -1,12 +1,15 @@ +{{- $serviceName := include "fullname" . -}} apiVersion: v1 kind: ConfigMap metadata: name: istio + labels: +{{ include "labels.standard" . | indent 4 }} data: mesh: |- -{{if .Values.auth.enabled }} +{{ if .Values.auth.enabled }} authPolicy: MUTUAL_TLS -{{end}} +{{ end }} mixerAddress: {{ template "fullname" . }}-mixer:{{ .Values.mixer.service.externalTcpPort }} discoveryAddress: {{ template "fullname" . }}-manager:{{ .Values.manager.service.externalHttpDiscovery }} ingressService: {{ template "fullname" . }}-ingress diff --git a/incubator/istio/templates/egress-deployment.yaml b/incubator/istio/templates/egress-deployment.yaml index 094f91b464..871854ac27 100644 --- a/incubator/istio/templates/egress-deployment.yaml +++ b/incubator/istio/templates/egress-deployment.yaml @@ -2,7 +2,11 @@ apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: {{ $serviceName }}-egress + name: {{ $serviceName }}-{{ .Values.egress.deployment.name }} + labels: +{{ include "labels.standard" . | indent 4 }} + component: {{ $serviceName }}-{{ .Values.egress.deployment.name }} + istio: {{ $serviceName }}-egress spec: replicas: {{ .Values.egress.deployment.replicas }} template: @@ -12,7 +16,9 @@ spec: {{ $key }}: {{ $value | quote }} {{- end }} labels: - istio: {{ $serviceName }}-egress +{{ include "labels.standard" . | indent 8 }} + component: {{ $serviceName }}-{{ .Values.egress.deployment.name }} + istio: {{ $serviceName }}-{{ .Values.egress.deployment.name }} spec: containers: - name: proxy @@ -27,7 +33,7 @@ spec: fieldPath: metadata.namespace resources: {{ toYaml .Values.egress.deployment.resources | indent 10 }} -{{if .Values.auth.enabled }} +{{ if .Values.auth.enabled }} volumeMounts: - mountPath: /etc/certs name: istio-certs @@ -36,4 +42,4 @@ spec: - name: istio-certs secret: secretName: istio.default -{{end}} \ No newline at end of file +{{ end }} \ No newline at end of file diff --git a/incubator/istio/templates/egress-svc.yaml b/incubator/istio/templates/egress-svc.yaml index 001ec7b1f4..eadb1d5b20 100644 --- a/incubator/istio/templates/egress-svc.yaml +++ b/incubator/istio/templates/egress-svc.yaml @@ -1,12 +1,17 @@ +{{- $serviceName := include "fullname" . -}} apiVersion: v1 kind: Service metadata: - name: {{ template "fullname" . }}-egress + name: {{ $serviceName }}-egress labels: - istio: {{ template "fullname" . }}-egress +{{ include "labels.standard" . | indent 4 }} + istio: {{ $serviceName }}-egress spec: type: {{ .Values.egress.service.type }} ports: - port: {{ .Values.egress.service.externalHttpPort }} selector: - istio: {{ template "fullname" . }}-egress \ No newline at end of file + app: {{ include "name" . }} + component: {{ $serviceName }}-{{ .Values.egress.deployment.name }} + release: {{ .Release.Name }} + istio: {{ $serviceName }}-{{ .Values.egress.deployment.name }} \ No newline at end of file diff --git a/incubator/istio/templates/ingress-deployment.yaml b/incubator/istio/templates/ingress-deployment.yaml index 995c03976f..3106192e79 100644 --- a/incubator/istio/templates/ingress-deployment.yaml +++ b/incubator/istio/templates/ingress-deployment.yaml @@ -1,7 +1,12 @@ +{{- $serviceName := include "fullname" . -}} apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: {{ template "fullname" . }}-ingress + name: {{ $serviceName }}-{{ .Values.ingress.deployment.name }} + labels: +{{ include "labels.standard" . | indent 4 }} + component: {{ $serviceName }}-{{ .Values.ingress.deployment.name }} + istio: {{ $serviceName }}-{{ .Values.ingress.deployment.name }} spec: replicas: {{ .Values.ingress.deployment.replicas }} template: @@ -11,9 +16,11 @@ spec: {{ $key }}: {{ $value | quote }} {{- end }} labels: - istio: {{ template "fullname" . }}-ingress +{{ include "labels.standard" . | indent 8 }} + component: {{ $serviceName }}-{{ .Values.ingress.deployment.name }} + istio: {{ $serviceName }}-{{ .Values.ingress.deployment.name }} spec: - serviceAccountName: {{ template "fullname" . }}-ingress-service-account + serviceAccountName: {{ $serviceName }}-ingress-service-account containers: - name: istio-ingress image: "{{ .Values.ingress.deployment.image }}:{{ .Values.istioRelease }}" @@ -30,7 +37,7 @@ spec: fieldPath: metadata.namespace resources: {{ toYaml .Values.ingress.deployment.resources | indent 10 }} -{{if .Values.auth.enabled }} +{{ if .Values.auth.enabled }} volumeMounts: - mountPath: /etc/certs name: istio-certs @@ -39,4 +46,4 @@ spec: - name: istio-certs secret: secretName: istio.default -{{end}} \ No newline at end of file +{{ end }} \ No newline at end of file diff --git a/incubator/istio/templates/ingress-service-account.yaml b/incubator/istio/templates/ingress-service-account.yaml index 16a414f3e4..ea032c4b05 100644 --- a/incubator/istio/templates/ingress-service-account.yaml +++ b/incubator/istio/templates/ingress-service-account.yaml @@ -1,4 +1,8 @@ +{{- $serviceName := include "fullname" . -}} apiVersion: v1 kind: ServiceAccount metadata: - name: {{ template "fullname" . }}-ingress-service-account \ No newline at end of file + name: {{ $serviceName }}-ingress-service-account + labels: +{{ include "labels.standard" . | indent 4 }} + istio: {{ $serviceName }}-ingress \ No newline at end of file diff --git a/incubator/istio/templates/ingress-svc.yaml b/incubator/istio/templates/ingress-svc.yaml index 94ac0bcda5..67995c3127 100644 --- a/incubator/istio/templates/ingress-svc.yaml +++ b/incubator/istio/templates/ingress-svc.yaml @@ -1,9 +1,11 @@ +{{- $serviceName := include "fullname" . -}} apiVersion: v1 kind: Service metadata: - name: {{ template "fullname" . }}-ingress + name: {{ $serviceName }}-{{ .Values.ingress.deployment.name }} labels: - istio: {{ template "fullname" . }}-ingress +{{ include "labels.standard" . | indent 4 }} + istio: {{ $serviceName }}-{{ .Values.ingress.deployment.name }} spec: type: {{ .Values.ingress.service.type }} ports: @@ -12,4 +14,7 @@ spec: - port: {{ .Values.ingress.service.externalHttpsPort }} name: https selector: - istio: {{ template "fullname" . }}-ingress \ No newline at end of file + app: {{ include "name" . }} + component: {{ $serviceName }}-{{ .Values.ingress.deployment.name }} + release: {{ .Release.Name }} + istio: {{ $serviceName }}-{{ .Values.ingress.deployment.name }} \ No newline at end of file diff --git a/incubator/istio/templates/manager-deployment.yaml b/incubator/istio/templates/manager-deployment.yaml index d832ad54fb..5e3cc5326f 100644 --- a/incubator/istio/templates/manager-deployment.yaml +++ b/incubator/istio/templates/manager-deployment.yaml @@ -1,7 +1,12 @@ +{{- $serviceName := include "fullname" . -}} apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: {{ template "fullname" . }}-manager + name: {{ $serviceName }}-{{ .Values.manager.name }} + labels: +{{ include "labels.standard" . | indent 4 }} + component: {{ $serviceName }}-{{ .Values.manager.name }} + istio: {{ $serviceName }}-{{ .Values.manager.name }} spec: replicas: {{ .Values.manager.deployment.replicas }} template: @@ -11,11 +16,13 @@ spec: {{ $key }}: {{ $value | quote }} {{- end }} labels: - istio: {{ template "fullname" . }}-manager +{{ include "labels.standard" . | indent 8 }} + component: {{ $serviceName }}-{{ .Values.manager.name }} + istio: {{ $serviceName }}-{{ .Values.manager.name }} spec: - serviceAccountName: {{ template "fullname" . }}-manager-service-account + serviceAccountName: {{ $serviceName }}-manager-service-account containers: - - name: discovery + - name: {{ .Values.manager.deployment.discovery.name }} image: "{{ .Values.manager.deployment.discovery.image }}:{{ .Values.istioRelease }}" imagePullPolicy: {{ .Values.manager.deployment.discovery.imagePullPolicy }} args: ["discovery", "-v", "2"] @@ -29,7 +36,7 @@ spec: fieldPath: metadata.namespace resources: {{ toYaml .Values.manager.deployment.discovery.resources | indent 10 }} - - name: apiserver + - name: {{ .Values.manager.deployment.apiserver.name }} image: "{{ .Values.manager.deployment.apiserver.image }}:{{ .Values.istioRelease }}" imagePullPolicy: {{ .Values.manager.deployment.apiserver.imagePullPolicy }} args: ["apiserver", "-v", "2"] diff --git a/incubator/istio/templates/manager-service-account.yaml b/incubator/istio/templates/manager-service-account.yaml index 7049252a3d..1673b005e5 100644 --- a/incubator/istio/templates/manager-service-account.yaml +++ b/incubator/istio/templates/manager-service-account.yaml @@ -1,4 +1,8 @@ +{{- $serviceName := include "fullname" . -}} apiVersion: v1 kind: ServiceAccount metadata: - name: {{ template "fullname" . }}-manager-service-account \ No newline at end of file + name: {{ $serviceName }}-manager-service-account + labels: +{{ include "labels.standard" . | indent 4 }} + istio: {{ $serviceName }}-manager \ No newline at end of file diff --git a/incubator/istio/templates/manager-svc.yaml b/incubator/istio/templates/manager-svc.yaml index cc5aff5203..fe356acd33 100644 --- a/incubator/istio/templates/manager-svc.yaml +++ b/incubator/istio/templates/manager-svc.yaml @@ -1,9 +1,11 @@ +{{- $serviceName := include "fullname" . -}} apiVersion: v1 kind: Service metadata: - name: {{ template "fullname" . }}-manager + name: {{ $serviceName }}-{{ .Values.manager.name }} labels: - istio: {{ template "fullname" . }}-manager +{{ include "labels.standard" . | indent 4 }} + istio: {{ $serviceName }}-{{ .Values.manager.name }} spec: type: {{ .Values.mixer.service.type }} ports: @@ -12,4 +14,7 @@ spec: - port: {{ .Values.manager.service.externalHttpApiServer }} name: http-apiserver selector: - istio: {{ template "fullname" . }}-manager \ No newline at end of file + app: {{ include "name" . }} + component: {{ $serviceName }}-{{ .Values.manager.name }} + release: {{ .Release.Name }} + istio: {{ $serviceName }}-{{ .Values.manager.name }} \ No newline at end of file diff --git a/incubator/istio/templates/mixer-deployment.yaml b/incubator/istio/templates/mixer-deployment.yaml index 8ca12bdf26..f239fe6a76 100644 --- a/incubator/istio/templates/mixer-deployment.yaml +++ b/incubator/istio/templates/mixer-deployment.yaml @@ -1,7 +1,12 @@ +{{- $serviceName := include "fullname" . -}} apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: {{ template "fullname" . }}-mixer + name: {{ $serviceName }}-{{ .Values.mixer.deployment.name }} + labels: +{{ include "labels.standard" . | indent 4 }} + component: {{ $serviceName }}-{{ .Values.mixer.deployment.name }} + istio: {{ $serviceName }}-{{ .Values.mixer.deployment.name }} spec: replicas: {{ .Values.mixer.deployment.replicas }} template: @@ -11,10 +16,12 @@ spec: {{ $key }}: {{ $value | quote }} {{- end }} labels: - istio: {{ template "fullname" . }}-mixer +{{ include "labels.standard" . | indent 8 }} + component: {{ $serviceName }}-{{ .Values.mixer.deployment.name }} + istio: {{ $serviceName }}-{{ .Values.mixer.deployment.name }} spec: containers: - - name: {{ template "fullname" . }}-mixer + - name: {{ $serviceName }}-{{ .Values.mixer.deployment.name }} image: "{{ .Values.mixer.deployment.image }}:{{ .Values.istioRelease }}" imagePullPolicy: {{ .Values.mixer.deployment.imagePullPolicy }} ports: diff --git a/incubator/istio/templates/mixer-svc.yaml b/incubator/istio/templates/mixer-svc.yaml index 0cd75645b6..8b347602d7 100644 --- a/incubator/istio/templates/mixer-svc.yaml +++ b/incubator/istio/templates/mixer-svc.yaml @@ -1,9 +1,11 @@ +{{- $serviceName := include "fullname" . -}} apiVersion: v1 kind: Service metadata: - name: {{ template "fullname" . }}-mixer + name: {{ $serviceName }}-{{ .Values.mixer.deployment.name }} labels: - istio: {{ template "fullname" . }}-mixer +{{ include "labels.standard" . | indent 4 }} + istio: {{ $serviceName }}-{{ .Values.mixer.deployment.name }} spec: type: {{ .Values.mixer.service.type }} ports: @@ -14,4 +16,7 @@ spec: - name: prometheus port: {{ .Values.mixer.service.externalPrometheusPort }} selector: - istio: {{ template "fullname" . }}-mixer \ No newline at end of file + app: {{ include "name" . }} + component: {{ $serviceName }}-{{ .Values.mixer.deployment.name }} + release: {{ .Release.Name }} + istio: {{ $serviceName }}-{{ .Values.mixer.deployment.name }} \ No newline at end of file diff --git a/incubator/istio/templates/rbac.yaml b/incubator/istio/templates/rbac.yaml index d9fd300cc3..b6a721df1a 100644 --- a/incubator/istio/templates/rbac.yaml +++ b/incubator/istio/templates/rbac.yaml @@ -1,4 +1,4 @@ -{{if .Values.rbac.install}} +{{ if .Values.rbac.install }} {{- $serviceName := include "fullname" . -}} kind: ClusterRole apiVersion: rbac.authorization.k8s.io/{{ required "A valid .Values.rbac.apiVersion entry required!" .Values.rbac.apiVersion }} @@ -52,7 +52,7 @@ metadata: subjects: - kind: ServiceAccount name: {{ $serviceName }}-manager-service-account - namespace: {{.Release.Namespace}} + namespace: {{ .Release.Namespace }} roleRef: kind: ClusterRole name: {{ $serviceName }}-manager @@ -65,7 +65,7 @@ metadata: subjects: - kind: ServiceAccount name: {{ $serviceName }}-ca-service-account - namespace: {{.Release.Namespace}} + namespace: {{ .Release.Namespace }} roleRef: kind: ClusterRole name: {{ $serviceName }}-ca @@ -78,7 +78,7 @@ metadata: subjects: - kind: ServiceAccount name: {{ $serviceName }}-ingress-service-account - namespace: {{.Release.Namespace}} + namespace: {{ .Release.Namespace }} roleRef: kind: ClusterRole name: {{ $serviceName }}-manager @@ -91,9 +91,9 @@ metadata: subjects: - kind: ServiceAccount name: default - namespace: {{.Release.Namespace}} + namespace: {{ .Release.Namespace }} roleRef: kind: ClusterRole name: {{ $serviceName }}-sidecar apiGroup: rbac.authorization.k8s.io -{{end}} \ No newline at end of file +{{ end }} \ No newline at end of file diff --git a/incubator/istio/values.yaml b/incubator/istio/values.yaml index 273c50b6bf..97ec873354 100644 --- a/incubator/istio/values.yaml +++ b/incubator/istio/values.yaml @@ -20,6 +20,7 @@ mixer: externalPrometheusPort: 42422 deployment: + name: mixer image: docker.io/istio/mixer imagePullPolicy: Always replicas: 1 @@ -35,6 +36,7 @@ mixer: ## Manager configuration manager: + name: manager service: type: ClusterIP @@ -47,6 +49,7 @@ manager: alpha.istio.io/sidecar: ignore discovery: + name: discovery image: docker.io/istio/manager imagePullPolicy: Always resources: @@ -58,6 +61,7 @@ manager: memory: 128Mi apiserver: + name: apiserver image: docker.io/istio/manager imagePullPolicy: Always resources: @@ -77,6 +81,7 @@ ingress: externalHttpsPort: 443 deployment: + name: ingress annotations: alpha.istio.io/sidecar: ignore image: docker.io/istio/proxy_debug @@ -98,6 +103,7 @@ egress: externalHttpPort: 80 deployment: + name: egress annotations: alpha.istio.io/sidecar: ignore image: docker.io/istio/proxy_debug @@ -116,6 +122,7 @@ egress: ca: deployment: + name: ca annotations: # alpha.istio.io/sidecar: ignore image: docker.io/istio/istio-ca @@ -143,6 +150,7 @@ addons: externalPort: 9411 deployment: + name: zipkin annotations: alpha.istio.io/sidecar: ignore image: docker.io/openzipkin/zipkin @@ -168,6 +176,7 @@ addons: prometheus.io/scrape: 'true' deployment: + name: prometheus annotations: alpha.istio.io/sidecar: ignore image: quay.io/coreos/prometheus @@ -191,6 +200,7 @@ addons: externalPort: 3000 deployment: + name: grafana annotations: alpha.istio.io/sidecar: ignore image: docker.io/istio/grafana @@ -213,6 +223,7 @@ addons: externalPort: 8088 deployment: + name: servicegraph annotations: alpha.istio.io/sidecar: ignore image: gcr.io/istio-testing/servicegraph