Skip to content

Commit

Permalink
Merge pull request #22 from WyriHaximusNet/port-nameRevsion-based-pod…
Browse files Browse the repository at this point in the history
…AntiAffinity-to-redirect-and-docker-hub-exporter

Port name + helm revision based podAntiAffinity to redirect and docker-hub-exporter
  • Loading branch information
WyriHaximus authored Jul 13, 2020
2 parents 2a04db2 + 20a02bf commit 67f871b
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 23 deletions.
4 changes: 2 additions & 2 deletions charts/docker-hub-exporter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apiVersion: v2
name: docker-hub-exporter
description: Docker Hub exporter
description: Docker Hub Exporter
home: https://github.com/jessestuart/docker-hub-exporter
icon: https://helm.wyrihaximus.net/images/charts/docker-hub-exporter.png
type: application
version: 0.4.0
version: 0.5.0
appVersion: d05df48
maintainers:
- name: WyriHaximus
Expand Down
4 changes: 4 additions & 0 deletions charts/docker-hub-exporter/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Expand the name of the chart.
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define ".helm.nameRevision" -}}
{{ template ".helm.name" . }}___{{ .Release.Revision }}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
Expand Down
4 changes: 3 additions & 1 deletion charts/docker-hub-exporter/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ metadata:
name: {{ include ".helm.fullname" . }}
labels:
app: {{ include ".helm.fullname" . }}
appRevision: {{ template ".helm.nameRevision" . }}
release: {{ include ".helm.fullname" . }}
releaseRevision: {{ .Release.Revision | quote }}
{{- include ".helm.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicas }}
Expand Down Expand Up @@ -62,5 +64,5 @@ spec:
- key: app
operator: In
values:
- {{ include ".helm.fullname" . }}
- {{ template ".helm.nameRevision" . }}
topologyKey: "kubernetes.io/hostname"
22 changes: 3 additions & 19 deletions charts/redirect/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
apiVersion: v2
name: redirect
description: Redirect Delpoyment
description: Redirect
home: https://github.com/wyrihaximusnet/docker-redirect
icon: https://avatars0.githubusercontent.com/u/19738034?s=200&v=4

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
icon: https://helm.wyrihaximus.net/images/charts/redirect.png
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 0.4.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
version: 0.5.0
appVersion: random

maintainers:
- name: WyriHaximus
email: [email protected]
4 changes: 4 additions & 0 deletions charts/redirect/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ app.kubernetes.io/name: {{ include ".helm.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}

{{- define ".helm.nameRevision" -}}
{{ template ".helm.name" . }}___{{ .Release.Revision }}
{{- end -}}

{{/*
Create the name of the service account to use
*/}}
Expand Down
4 changes: 3 additions & 1 deletion charts/redirect/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ metadata:
name: {{ include ".helm.fullname" . }}
labels:
app: {{ include ".helm.fullname" . }}
appRevision: {{ template ".helm.nameRevision" . }}
release: {{ include ".helm.fullname" . }}
releaseRevision: {{ .Release.Revision | quote }}
{{- include ".helm.labels" . | nindent 4 }}
{{- toYaml .Values.labels | nindent 4 }}
spec:
Expand Down Expand Up @@ -74,5 +76,5 @@ spec:
- key: app
operator: In
values:
- {{ include ".helm.fullname" . }}
- {{ template ".helm.nameRevision" . }}
topologyKey: "kubernetes.io/hostname"

0 comments on commit 67f871b

Please sign in to comment.