Skip to content

Commit

Permalink
Fix helm chart for gitlab ci
Browse files Browse the repository at this point in the history
  • Loading branch information
elnappo committed Mar 6, 2019
1 parent 0163079 commit 79ca349
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ rollout 100%:
chart/
fi

kubectl rollout status -n "$KUBE_NAMESPACE" -w "deployment/$name"
kubectl rollout status -n "$KUBE_NAMESPACE" -w "deployment/${name}-project-novis" || true
}

function scale() {
Expand Down
6 changes: 1 addition & 5 deletions chart/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range $.Values.ingress.paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host }}{{ . }}
{{- end }}
{{- end }}
http://{{ .Values.ingress.host }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "project-novis.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
Expand Down
5 changes: 5 additions & 0 deletions chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ Create chart name and version as used by the chart label.
{{- define "project-novis.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "project-novis.appname" -}}
{{- $releaseName := default .Release.Name .Values.releaseOverride -}}
{{- printf "%s" $releaseName | trunc 63 | trimSuffix "-" -}}
{{- end -}}
4 changes: 3 additions & 1 deletion chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ metadata:
helm.sh/chart: {{ include "project-novis.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
track: "{{ .Values.application.track }}"
track: {{ .Values.application.track }}
app: {{ template "project-novis.appname" . }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
Expand All @@ -21,6 +22,7 @@ spec:
app.kubernetes.io/name: {{ include "project-novis.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
track: "{{ .Values.application.track }}"
app: {{ template "project-novis.appname" . }}
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "8001"
Expand Down
2 changes: 2 additions & 0 deletions chart/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ metadata:
helm.sh/chart: {{ include "project-novis.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
track: {{ .Values.application.track }}
app: {{ template "project-novis.appname" . }}

{{- with .Values.ingress.annotations }}
annotations:
Expand Down
2 changes: 2 additions & 0 deletions chart/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ metadata:
helm.sh/chart: {{ include "project-novis.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
track: {{ .Values.application.track }}
app: {{ template "project-novis.appname" . }}
spec:
type: {{ .Values.service.type }}
ports:
Expand Down
1 change: 1 addition & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ image:

nameOverride: ""
fullnameOverride: ""
releaseOverride: ""

application:
track: "development"
Expand Down

0 comments on commit 79ca349

Please sign in to comment.