-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b962755
commit 5ad7399
Showing
9 changed files
with
300 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
deployment: | ||
image: | ||
name: "nginx" | ||
tag: "latest" | ||
pullPolicy: IfNotPresent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
You have deployed the following release: {{ .Release.Name }}. | ||
To get further information, you can run the commands: | ||
$ helm status {{ .Release.Name }} | ||
$ helm get all {{ .Release.Name }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
|
||
{{/* | ||
Return the target Kubernetes version | ||
*/}} | ||
{{- define "microservice.capabilities.kubeVersion" -}} | ||
{{- default (default .Capabilities.KubeVersion.Version .Values.kubeVersion) ((.Values.global).kubeVersion) -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Return the appropriate apiVersion for Horizontal Pod Autoscaler. | ||
*/}} | ||
{{- define "microservice.capabilities.hpa.apiVersion" -}} | ||
{{- $kubeVersion := include "microservice.capabilities.kubeVersion" .context -}} | ||
{{- if and (not (empty $kubeVersion)) (semverCompare "<1.23-0" $kubeVersion) -}} | ||
{{- if .beta2 -}} | ||
{{- print "autoscaling/v2beta2" -}} | ||
{{- else -}} | ||
{{- print "autoscaling/v2beta1" -}} | ||
{{- end -}} | ||
{{- else -}} | ||
{{- print "autoscaling/v2" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#ConfigMap mounted as volumes | ||
{{- if .Values.deployment.volumes.configMaps }} | ||
{{- if .Values.deployment.volumes.enabled }} | ||
{{ $header := .Values.deployment.volumes.configFileCommonHeader | default "" }} | ||
{{ $root := . }} | ||
{{ range $cm := .Values.deployment.volumes.configMaps}} | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "microservice.fullname" $root }}-{{ $cm.name }}-cm | ||
namespace: {{ .Values.global.namespace }} | ||
data: | ||
{{- if $cm.data }} | ||
{{- range $filename, $content := $cm.data }} | ||
# property-like keys; each key maps to a simple value | ||
{{ $filename }}: |- | ||
{{ $content | toString | indent 4}} | ||
{{- end }} | ||
{{- end }} | ||
{{- if $cm.files }} | ||
{{- range $file := $cm.files }} | ||
{{ $file.destination }}: | | ||
{{ $header | toString | indent 4 }} | ||
{{ $root.Files.Get $file.source }} | ||
{{- end}} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,28 @@ | ||
{{- if .Values.hpa }} | ||
apiVersion: autoscaling/v2beta1 | ||
{{- if .Values.hpa.enabled }} | ||
apiVersion: {{ include "microservice.capabilities.hpa.apiVersion" ( dict "context" $ ) }} | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: {{ include "microservice.HorizontalScalingName" . }} | ||
name: {{ include "microservice.fullname" . }}-hpa | ||
namespace: {{ .Values.global.namespace }} | ||
labels: | ||
{{- include "microservice.labels" . | nindent 4 }} | ||
spec: | ||
scaleTargetRef: | ||
kind: Deployment | ||
name: {{ include "microservice.fullname" . }} | ||
minReplicas: {{ default 1 .Values.hpa.minReplicas }} | ||
maxReplicas: {{ default 1 .Values.hpa.maxReplicas }} | ||
minReplicas: {{ .Values.hpa.minReplicas }} | ||
maxReplicas: {{ .Values.hpa.maxReplicas }} | ||
metrics: | ||
{{- if .Values.hpa.targetAverageCPUUtilization }} | ||
{{- if .Values.hpa.targetCPUUtilizationPercentage }} | ||
- type: Resource | ||
resource: | ||
name: cpu | ||
targetAverageUtilization: {{ default 50 .Values.hpa.targetAverageCPUUtilization }} | ||
targetAverageUtilization: {{ .Values.hpa.targetCPUUtilizationPercentage }} | ||
{{- end }} | ||
{{- if .Values.hpa.targetAverageMemoryUtilization }} | ||
{{- if .Values.hpa.targetMemoryUtilizationPercentage }} | ||
- type: Resource | ||
resource: | ||
name: memory | ||
targetAverageUtilization: {{ default 50 .Values.hpa.targetAverageMemoryUtilization }} | ||
targetAverageUtilization: {{ .Values.hpa.targetMemoryUtilizationPercentage }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,34 @@ | ||
{{- $root:= . }} | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "microservice.servicename" . }} | ||
name: {{ include "microservice.fullname" . }}-svc | ||
namespace: {{ .Values.global.namespace }} | ||
{{- if .Values.service.annotations }} | ||
annotations: | ||
{{- range $key, $value := .Values.service.annotations }} | ||
{{ $key }}: {{ $value }} | ||
{{- end }} | ||
{{- end }} | ||
labels: | ||
{{- include "microservice.labels" . | nindent 4 }} | ||
spec: | ||
type: {{ .Values.service.type }} | ||
ports: | ||
- port: {{ .Values.service.port }} | ||
targetPort: http | ||
protocol: TCP | ||
name: http | ||
selector: | ||
{{- include "microservice.selectorLabels" . | nindent 4 }} | ||
ports: | ||
{{- range $spec := .Values.service.specs }} | ||
- name: {{ $spec.name }} | ||
port: {{ $spec.port }} | ||
protocol: {{ $spec.protocol | default "TCP" }} | ||
{{- if $spec.targetPort }} | ||
targetPort: {{ $spec.targetPort }} | ||
{{- else }} | ||
targetPort: {{ $spec.name }} | ||
{{- end}} | ||
{{- if $spec.nodePort }} | ||
nodePort: {{ $spec.nodePort }} | ||
{{- end }} | ||
{{- end -}} | ||
|
Oops, something went wrong.