Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Add recommended k8s labels in helm charts #528

Merged
merged 1 commit into from
May 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion helm/dashboard/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
name: dashboard
icon: https://tekton.dev/images/tekton-horizontal-color.png
apiVersion: v1
version: 0.6.1
version: 0.6.2
appVersion: 0.6.1
home: https://github.com/tektoncd/dashboard
keywords:
Expand Down
2 changes: 1 addition & 1 deletion helm/dashboard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ helm uninstall my-dashboard --namespace tekton

## Version

Current chart version is `0.6.1`
Current chart version is `0.6.2`

## Chart Values

Expand Down
6 changes: 4 additions & 2 deletions helm/dashboard/crds/extension.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: extensions.dashboard.tekton.dev
labels:
app.kubernetes.io/part-of: tekton-dashboard
spec:
group: dashboard.tekton.dev
names:
categories:
- tekton
- tekton-dashboard
- tekton
- tekton-dashboard
kind: Extension
plural: extensions
scope: Namespaced
Expand Down
4 changes: 2 additions & 2 deletions helm/dashboard/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Tekton dashboard have been installed successfully.
To verify that the controller has started, run:
To verify pods have started, run:

kubectl --namespace={{ .Release.Namespace }} get pods -l "app.kubernetes.io/name={{ template "dashboard.name" . }},app.kubernetes.io/component=controller,app.kubernetes.io/instance={{ .Release.Name }}"
kubectl --namespace={{ .Release.Namespace }} get pods -l "app.kubernetes.io/part-of=tekton-dashboard,app.kubernetes.io/instance={{ .Release.Name }}"
33 changes: 33 additions & 0 deletions helm/dashboard/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,36 @@ Create the name of the service account to use
{{- required "A service account name is required" .Values.rbac.serviceAccountName -}}
{{- end -}}
{{- end -}}

{{/*
Create base labels
*/}}
{{- define "dashboard.baseLabels" -}}
app.kubernetes.io/component: dashboard
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/part-of: tekton-dashboard
{{- end -}}

{{/*
Create helm labels
*/}}
{{- define "dashboard.helmLabels" -}}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ template "dashboard.chart" . }}
{{- end -}}

{{/*
Create version labels
*/}}
{{- define "dashboard.versionLabels" -}}
app.kubernetes.io/version: {{ .Values.version | quote }}
dashboard.tekton.dev/release: {{ .Values.version | quote }}
version: {{ .Values.version | quote }}
{{- end -}}

{{/*
Create name labels
*/}}
{{- define "dashboard.nameLabels" -}}
app.kubernetes.io/name: {{ . }}
{{- end -}}
3 changes: 3 additions & 0 deletions helm/dashboard/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ template "dashboard.fullname" . }}
labels:
{{- include "dashboard.baseLabels" . | nindent 4 }}
{{- include "dashboard.helmLabels" . | nindent 4 }}
rules:
{{- if not .Values.dashboard.readOnly }}
- apiGroups:
Expand Down
3 changes: 3 additions & 0 deletions helm/dashboard/templates/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: {{ template "dashboard.fullname" . }}
labels:
{{- include "dashboard.baseLabels" . | nindent 4 }}
{{- include "dashboard.helmLabels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand Down
27 changes: 10 additions & 17 deletions helm/dashboard/templates/dashboard_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,27 @@ kind: Deployment
metadata:
name: {{ template "dashboard.fullname" . }}-controller
labels:
app.kubernetes.io/name: {{ template "dashboard.name" . }}
app.kubernetes.io/component: controller
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ template "dashboard.chart" . }}
dashboard.tekton.dev/release: {{ .Values.version | quote }}
version: {{ .Values.version | quote }}
{{- include "dashboard.baseLabels" . | nindent 4 }}
{{- include "dashboard.helmLabels" . | nindent 4 }}
{{- include "dashboard.versionLabels" . | nindent 4 }}
{{- include "dashboard.nameLabels" "dashboard" | nindent 4 }}
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: {{ template "dashboard.name" . }}
app.kubernetes.io/component: controller
app.kubernetes.io/instance: {{ .Release.Name }}
{{- include "dashboard.baseLabels" . | nindent 6 }}
{{- include "dashboard.nameLabels" "dashboard" | nindent 6 }}
template:
metadata:
{{- with .Values.dashboard.annotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ template "dashboard.name" . }}
app.kubernetes.io/component: controller
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ template "dashboard.chart" . }}
dashboard.tekton.dev/release: {{ .Values.version | quote }}
version: {{ .Values.version | quote }}
{{- include "dashboard.baseLabels" . | nindent 8 }}
{{- include "dashboard.helmLabels" . | nindent 8 }}
{{- include "dashboard.versionLabels" . | nindent 8 }}
{{- include "dashboard.nameLabels" "dashboard" | nindent 8 }}
spec:
serviceAccountName: {{ template "dashboard.serviceAccountName" . }}
{{- with .Values.dashboard.securityContext }}
Expand Down
9 changes: 2 additions & 7 deletions helm/dashboard/templates/dashboard_ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,8 @@ kind: Ingress
metadata:
name: {{ template "dashboard.fullname" . }}
labels:
app.kubernetes.io/name: {{ template "dashboard.name" . }}
app.kubernetes.io/component: controller
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ template "dashboard.chart" . }}
dashboard.tekton.dev/release: {{ .Values.version | quote }}
version: {{ .Values.version | quote }}
{{- include "dashboard.baseLabels" . | nindent 4 }}
{{- include "dashboard.helmLabels" . | nindent 4 }}
{{- with .Values.dashboard.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
16 changes: 6 additions & 10 deletions helm/dashboard/templates/dashboard_service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@ kind: Service
metadata:
name: {{ template "dashboard.fullname" . }}
labels:
app.kubernetes.io/name: {{ template "dashboard.name" . }}
app.kubernetes.io/component: controller
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ template "dashboard.chart" . }}
dashboard.tekton.dev/release: {{ .Values.version | quote }}
version: {{ .Values.version | quote }}
{{- include "dashboard.baseLabels" . | nindent 4 }}
{{- include "dashboard.helmLabels" . | nindent 4 }}
{{- include "dashboard.versionLabels" . | nindent 4 }}
{{- include "dashboard.nameLabels" "dashboard" | nindent 4 }}
{{- with .Values.dashboard.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand All @@ -36,6 +33,5 @@ spec:
protocol: TCP
targetPort: 9097
selector:
app.kubernetes.io/name: {{ template "dashboard.name" . }}
app.kubernetes.io/component: controller
app.kubernetes.io/instance: {{ .Release.Name }}
{{- include "dashboard.baseLabels" . | nindent 4 }}
{{- include "dashboard.nameLabels" "dashboard" | nindent 4 }}
3 changes: 3 additions & 0 deletions helm/dashboard/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "dashboard.serviceAccountName" . }}
labels:
{{- include "dashboard.baseLabels" . | nindent 4 }}
{{- include "dashboard.helmLabels" . | nindent 4 }}
{{- end }}
2 changes: 1 addition & 1 deletion helm/pipeline/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
name: pipeline
icon: https://tekton.dev/images/tekton-horizontal-color.png
apiVersion: v1
version: 0.11.3
version: 0.11.4
appVersion: 0.11.3
home: https://github.com/tektoncd/pipeline
keywords:
Expand Down
2 changes: 1 addition & 1 deletion helm/pipeline/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ helm uninstall my-pipeline --namespace tekton

## Version

Current chart version is `0.11.3`
Current chart version is `0.11.4`

## Chart Values

Expand Down
18 changes: 10 additions & 8 deletions helm/pipeline/crds/clustertask.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,23 @@ apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: clustertasks.tekton.dev
labels:
app.kubernetes.io/part-of: tekton-pipelines
spec:
group: tekton.dev
versions:
- name: v1alpha1
served: true
storage: true
- name: v1beta1
served: true
storage: false
- name: v1alpha1
served: true
storage: true
- name: v1beta1
served: true
storage: false
names:
kind: ClusterTask
plural: clustertasks
categories:
- tekton
- tekton-pipelines
- tekton
- tekton-pipelines
scope: Cluster
# Opt into the status subresource so metadata.generation
# starts to increment
Expand Down
2 changes: 2 additions & 0 deletions helm/pipeline/crds/condition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: conditions.tekton.dev
labels:
app.kubernetes.io/part-of: tekton-pipelines
spec:
group: tekton.dev
names:
Expand Down
1 change: 1 addition & 0 deletions helm/pipeline/crds/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ kind: CustomResourceDefinition
metadata:
name: images.caching.internal.knative.dev
labels:
app.kubernetes.io/part-of: tekton-pipelines
knative.dev/crd-install: "true"
spec:
group: caching.internal.knative.dev
Expand Down
18 changes: 10 additions & 8 deletions helm/pipeline/crds/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,23 @@ apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: pipelines.tekton.dev
labels:
app.kubernetes.io/part-of: tekton-pipelines
spec:
group: tekton.dev
versions:
- name: v1alpha1
served: true
storage: true
- name: v1beta1
served: true
storage: false
- name: v1alpha1
served: true
storage: true
- name: v1beta1
served: true
storage: false
names:
kind: Pipeline
plural: pipelines
categories:
- tekton
- tekton-pipelines
- tekton
- tekton-pipelines
scope: Namespaced
# Opt into the status subresource so metadata.generation
# starts to increment
Expand Down
22 changes: 12 additions & 10 deletions helm/pipeline/crds/pipelinerun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,26 @@ apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: pipelineruns.tekton.dev
labels:
app.kubernetes.io/part-of: tekton-pipelines
spec:
group: tekton.dev
versions:
- name: v1alpha1
served: true
storage: true
- name: v1beta1
served: true
storage: false
- name: v1alpha1
served: true
storage: true
- name: v1beta1
served: true
storage: false
names:
kind: PipelineRun
plural: pipelineruns
categories:
- tekton
- tekton-pipelines
- tekton
- tekton-pipelines
shortNames:
- pr
- prs
- pr
- prs
scope: Namespaced
additionalPrinterColumns:
- name: Succeeded
Expand Down
6 changes: 4 additions & 2 deletions helm/pipeline/crds/resource.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: pipelineresources.tekton.dev
labels:
app.kubernetes.io/part-of: tekton-pipelines
spec:
group: tekton.dev
names:
kind: PipelineResource
plural: pipelineresources
categories:
- tekton
- tekton-pipelines
- tekton
- tekton-pipelines
scope: Namespaced
# Opt into the status subresource so metadata.generation
# starts to increment
Expand Down
18 changes: 10 additions & 8 deletions helm/pipeline/crds/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,23 @@ apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: tasks.tekton.dev
labels:
app.kubernetes.io/part-of: tekton-pipelines
spec:
group: tekton.dev
versions:
- name: v1alpha1
served: true
storage: true
- name: v1beta1
served: true
storage: false
- name: v1alpha1
served: true
storage: true
- name: v1beta1
served: true
storage: false
names:
kind: Task
plural: tasks
categories:
- tekton
- tekton-pipelines
- tekton
- tekton-pipelines
scope: Namespaced
# Opt into the status subresource so metadata.generation
# starts to increment
Expand Down
Loading