Update Labels - Application/Component

1) Kubernetes Template (Bootstrap)
2) Other charts within Promenade Repo

Change-Id: I872802112587bdff84d3630a5b2542dc4b3f77f8
This commit is contained in:
anthony.lin 2018-05-18 23:07:43 +08:00
parent a48dcacecc
commit 6e81ed7b40
13 changed files with 37 additions and 4 deletions

View File

@ -13,6 +13,9 @@ 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.
*/}}
{{- if .Values.manifests.pod_test }}
{{- $envAll := . }}
---
apiVersion: v1
kind: Pod
@ -20,6 +23,8 @@ metadata:
name: {{ print .Release.Name "-test" }}
annotations:
"helm.sh/hook": test-success
labels:
{{ tuple $envAll "coredns" "test" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
spec:
restartPolicy: Never
containers:
@ -44,3 +49,4 @@ spec:
echo "Test failed to resolve all names."
exit 1
fi
{{- end }}

View File

@ -60,3 +60,6 @@ monitoring:
coredns:
scrape: true
port: 9253
manifests:
pod_test: true

View File

@ -17,6 +17,10 @@ limitations under the License.
{{- if .Values.manifests.daemonset_anchor }}
{{- $envAll := . }}
{{- $mounts_daemonset_anchor := .Values.pod.mounts.daemonset_anchor.daemonset_anchor }}
# Strip off "etcd" from service name to get the application name
# Note that application can either be kubernetes or calico for now
# and may expand in scope in the future
{{- $applicationName := .Values.service.name | replace "-etcd" "" }}
---
apiVersion: extensions/v1beta1
kind: DaemonSet
@ -29,7 +33,7 @@ spec:
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
labels:
{{ tuple $envAll "kubernetes" "anchor" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
{{ tuple $envAll $applicationName "etcd-anchor" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
spec:
hostNetwork: true
{{- if .Values.anchor.dns_policy }}

View File

@ -14,8 +14,11 @@
# limitations under the License.
*/}}
{{- if .Values.manifests.service }}
{{- $envAll := . }}
# Strip off "etcd" from service name to get the application name
# Note that application can either be kubernetes or calico for now
# and may expand in scope in the future
{{- $applicationName := .Values.service.name | replace "-etcd" "" }}
---
apiVersion: v1
kind: Pod
@ -24,6 +27,7 @@ metadata:
namespace: {{ .Release.Namespace }}
labels:
{{ .Values.service.name }}-service: enabled
{{ tuple $envAll $applicationName "etcd" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
spec:
hostNetwork: true
containers:
@ -104,4 +108,3 @@ spec:
- name: etc
hostPath:
path: {{ .Values.etcd.host_etc_path }}
{{- end }}

View File

@ -16,6 +16,8 @@
{{/*
Test etcdctl endpoint health */}}
{{- if .Values.manifests.test_etcd_health }}
{{- $envAll := . }}
{{- $applicationName := .Release.Name }}
---
apiVersion: v1
kind: Pod
@ -23,6 +25,8 @@ metadata:
name: "{{ .Release.Name }}-etcd-test"
annotations:
"helm.sh/hook": "test-success"
labels:
{{ tuple $envAll $applicationName "etcd-test" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
spec:
nodeSelector:
{{ .Values.labels.anchor.node_selector_key }}: {{ .Values.labels.anchor.node_selector_value }}

View File

@ -13,12 +13,16 @@ 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.
*/}}
{{- $envAll := . }}
---
apiVersion: v1
kind: Pod
metadata:
name: haproxy
namespace: {{ .Release.Namespace }}
labels:
{{ tuple $envAll "haproxy" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
spec:
hostNetwork: true
containers:

View File

@ -25,6 +25,8 @@ metadata:
name: "{{ .Release.Name }}-api-test"
annotations:
"helm.sh/hook": "test-success"
labels:
{{ tuple $envAll "promenade" "api-test" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
spec:
restartPolicy: Never
initContainers:

View File

@ -5,6 +5,7 @@ metadata:
name: auxiliary-etcd
namespace: kube-system
labels:
application: kubernetes
component: auxiliary-etcd
promenade: genesis
spec:

View File

@ -5,7 +5,7 @@ metadata:
name: bootstrap-armada
namespace: kube-system
labels:
app: promenade
application: promenade
component: genesis-tiller
spec:
dnsPolicy: Default

View File

@ -5,6 +5,8 @@ metadata:
name: kubernetes-apiserver
namespace: kube-system
labels:
application: kubernetes
component: apiserver
kubernetes-apiserver-service: enabled
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''

View File

@ -6,6 +6,7 @@ metadata:
namespace: kube-system
labels:
tier: control-plane
application: kubernetes
component: kube-controller-manager
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''

View File

@ -5,6 +5,8 @@ metadata:
name: kubernetes-etcd
namespace: kube-system
labels:
application: kubernetes
component: etcd
# NOTE: This label needs coordination with the etcd deployed via chart.
kubernetes-etcd-service: enabled
spec:

View File

@ -6,6 +6,7 @@ metadata:
namespace: kube-system
labels:
tier: control-plane
application: kubernetes
component: kube-scheduler
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''