Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable/node-problem-detector] Refactoring labels #513

Closed
wants to merge 2 commits into from
Closed
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
42 changes: 7 additions & 35 deletions stable/node-problem-detector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,11 @@ This chart installs a [node-problem-detector](https://github.com/kubernetes/node

**Homepage:** <https://github.com/kubernetes/node-problem-detector>

## How to install this chart

Add Delivery Hero public chart repo:

```console
helm repo add deliveryhero https://charts.deliveryhero.io/
```

A simple install with default values:

```console
helm install deliveryhero/node-problem-detector
```

To install the chart with the release name `my-release`:

```console
helm install my-release deliveryhero/node-problem-detector
```

To install with some set values:

```console
helm install my-release deliveryhero/node-problem-detector --set values_key1=value1 --set values_key2=value2
```

To install with custom values file:
## Maintainers

```console
helm install my-release deliveryhero/node-problem-detector -f values.yaml
```
| Name | Email | Url |
| ---- | ------ | --- |
| max-rocket-internet | <no-reply@deliveryhero.com> | |

## Source Code

Expand All @@ -47,6 +21,7 @@ helm install my-release deliveryhero/node-problem-detector -f values.yaml

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| additionalLabels | object | `{}` | Labels to be added to all other resources. |
| affinity | object | `{}` | |
| annotations | object | `{}` | |
| env | string | `nil` | |
Expand Down Expand Up @@ -95,8 +70,5 @@ helm install my-release deliveryhero/node-problem-detector -f values.yaml
| updateStrategy | string | `"RollingUpdate"` | Manage the daemonset update strategy |
| volume.localtime.type | string | `"FileOrCreate"` | |

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| max-rocket-internet | <no-reply@deliveryhero.com> | |
----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
24 changes: 24 additions & 0 deletions stable/node-problem-detector/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,30 @@ Create chart name and version as used by the chart label.
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Common labels
*/}}
{{- define "node-problem-detector.labels" -}}
helm.sh/chart: {{ include "node-problem-detector.chart" . }}
{{ include "node-problem-detector.selectorLabels" . }}
app.kubernetes.io/component: detector
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.additionalLabels }}
{{ toYaml .Values.additionalLabels }}
{{- end }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "node-problem-detector.selectorLabels" -}}
app.kubernetes.io/name: {{ include "node-problem-detector.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/* Create the name of the service account to use */}}
{{- define "node-problem-detector.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
Expand Down
5 changes: 1 addition & 4 deletions stable/node-problem-detector/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ template "node-problem-detector.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "node-problem-detector.name" . }}
helm.sh/chart: {{ include "node-problem-detector.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- include "node-problem-detector.labels" . | nindent 4 }}
rules:
- apiGroups:
- ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ template "node-problem-detector.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "node-problem-detector.name" . }}
helm.sh/chart: {{ include "node-problem-detector.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- include "node-problem-detector.labels" . | nindent 4 }}
subjects:
- kind: ServiceAccount
name: {{ template "node-problem-detector.serviceAccountName" . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@ kind: ConfigMap
metadata:
name: {{ include "node-problem-detector.customConfig" . }}
labels:
app.kubernetes.io/name: {{ include "node-problem-detector.name" . }}
helm.sh/chart: {{ include "node-problem-detector.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- include "node-problem-detector.labels" . | nindent 4 }}
namespace: {{ .Release.Namespace }}
11 changes: 3 additions & 8 deletions stable/node-problem-detector/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ kind: DaemonSet
metadata:
name: {{ include "node-problem-detector.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "node-problem-detector.name" . }}
helm.sh/chart: {{ include "node-problem-detector.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- include "node-problem-detector.labels" . | nindent 4 }}
{{- range $key, $val := .Values.labels }}
{{ $key }}: {{ $val | quote }}
{{- end}}
Expand All @@ -20,14 +17,12 @@ spec:
{{- end}}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "node-problem-detector.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- include "node-problem-detector.selectorLabels" . | nindent 6 }}
app: {{ include "node-problem-detector.name" . }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "node-problem-detector.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- include "node-problem-detector.labels" . | nindent 8 }}
app: {{ include "node-problem-detector.name" . }}
{{- range $key, $val := .Values.labels }}
{{ $key }}: {{ $val | quote }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ kind: PrometheusRule
metadata:
name: {{ template "node-problem-detector.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "node-problem-detector.name" . }}
helm.sh/chart: {{ include "node-problem-detector.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- include "node-problem-detector.labels" . | nindent 4 }}
{{- if .Values.metrics.prometheusRule.additionalLabels }}
{{- toYaml .Values.metrics.prometheusRule.additionalLabels | nindent 4 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ template "node-problem-detector.fullname" . }}-psp
labels:
app.kubernetes.io/name: {{ include "node-problem-detector.name" . }}
helm.sh/chart: {{ include "node-problem-detector.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- include "node-problem-detector.labels" . | nindent 4 }}
rules:
- apiGroups: ['extensions']
resources: ['podsecuritypolicies']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ kind: ClusterRoleBinding
metadata:
name: {{ template "node-problem-detector.fullname" . }}-psp
labels:
app.kubernetes.io/name: {{ include "node-problem-detector.name" . }}
helm.sh/chart: {{ include "node-problem-detector.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- include "node-problem-detector.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand Down
5 changes: 1 addition & 4 deletions stable/node-problem-detector/templates/psp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ kind: PodSecurityPolicy
metadata:
name: {{ template "node-problem-detector.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "node-problem-detector.name" . }}
helm.sh/chart: {{ include "node-problem-detector.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- include "node-problem-detector.labels" . | nindent 4 }}
spec:
privileged: true
allowPrivilegeEscalation: true
Expand Down
5 changes: 1 addition & 4 deletions stable/node-problem-detector/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ kind: Service
metadata:
name: {{ template "node-problem-detector.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "node-problem-detector.name" . }}
helm.sh/chart: {{ include "node-problem-detector.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- include "node-problem-detector.labels" . | nindent 4 }}
app: {{ include "node-problem-detector.name" . }}
annotations:
{{- if .Values.metrics.annotations }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ kind: ServiceAccount
metadata:
name: {{ template "node-problem-detector.serviceAccountName" . }}
labels:
app.kubernetes.io/name: {{ include "node-problem-detector.name" . }}
helm.sh/chart: {{ include "node-problem-detector.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- include "node-problem-detector.labels" . | nindent 4 }}
namespace: {{ .Release.Namespace }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ kind: ServiceMonitor
metadata:
name: {{ template "node-problem-detector.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "node-problem-detector.name" . }}
helm.sh/chart: {{ include "node-problem-detector.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- include "node-problem-detector.labels" . | nindent 4 }}
{{- if .Values.metrics.serviceMonitor.additionalLabels }}
{{- toYaml .Values.metrics.serviceMonitor.additionalLabels | nindent 4 }}
{{- end }}
Expand Down
3 changes: 3 additions & 0 deletions stable/node-problem-detector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ priorityClassName: system-node-critical
securityContext:
privileged: true

# -- Labels to be added to all other resources.
additionalLabels: {}

resources: {}

annotations: {}
Expand Down
Loading