-
Notifications
You must be signed in to change notification settings - Fork 7
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
81bc669
commit 7464fae
Showing
5 changed files
with
223 additions
and
0 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,7 @@ | ||
apiVersion: v2 | ||
name: extended-demo | ||
description: Demo chart with more properties to chose from | ||
|
||
type: application | ||
|
||
version: 0.1.0 |
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,56 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ .Values.name }} | ||
{{- if ((.Values.general).labels) }} | ||
labels: | ||
{{- range $key, $value := (.Values.general).labels }} | ||
{{ $key }}: {{ $value | quote }} | ||
{{- end }} | ||
{{- end }} | ||
spec: | ||
replicas: {{ (.Values.scaling).replicas | default 1 }} | ||
selector: | ||
matchLabels: | ||
app: {{ .Values.name }} | ||
template: | ||
metadata: | ||
{{- if ((.Values.general).labels) }} | ||
labels: | ||
{{- range $key, $value := (.Values.general).labels }} | ||
{{ $key }}: {{ $value | quote }} | ||
{{- end }} | ||
{{- end }} | ||
spec: | ||
containers: | ||
- name: {{ .Values.name }} | ||
image: "{{ .Values.general.image }}:{{ .Values.general.version }}" | ||
{{- if ((.Values.networking).expose) }} | ||
ports: | ||
- name: http | ||
containerPort: {{ .Values.networking.port | default 80 }} | ||
protocol: TCP | ||
{{- end }} | ||
env: | ||
{{- if ((.Values.general).environment) }} | ||
{{- range $key, $value := (.Values.general).environment }} | ||
- name: {{ $key }} | ||
value: {{ $value | quote }} | ||
{{- end }} | ||
{{- end }} | ||
{{- if or ((.Values.scaling).resources).memory ((.Values.scaling).resources).cpu }} | ||
resources: | ||
{{- if ((.Values.scaling).resources).memory }} | ||
limits: | ||
memory: {{ ((.Values.scaling).resources).memory }} | ||
{{- end }} | ||
{{- if or ((.Values.scaling).resources).memory ((.Values.scaling).resources).cpu }} | ||
requests: | ||
{{- if ((.Values.scaling).resources).cpu }} | ||
cpu: {{ ((.Values.scaling).resources).cpu }} | ||
{{- end }} | ||
{{- if ((.Values.scaling).resources).memory }} | ||
memory: {{ ((.Values.scaling).resources).memory }} | ||
{{- 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{{- if ((.Values.networking).expose) }} | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ .Values.name }} | ||
{{- if ((.Values.general).labels) }} | ||
labels: | ||
{{- range $key, $value := (.Values.general).labels }} | ||
{{ $key }}: {{ $value | quote }} | ||
{{- end }} | ||
{{- end }} | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- port: {{ (.Values.networking).port }} | ||
targetPort: http | ||
protocol: TCP | ||
name: http | ||
selector: | ||
app: {{ .Values.name }} | ||
{{- 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 |
---|---|---|
@@ -0,0 +1,120 @@ | ||
{ | ||
"properties": { | ||
"name": { | ||
"title": "Name", | ||
"type": "string" | ||
}, | ||
"general": { | ||
"properties": { | ||
"image": { | ||
"title": "App image", | ||
"type": "string" | ||
}, | ||
"version": { | ||
"title": "Image version", | ||
"type": "string" | ||
}, | ||
"environment": { | ||
"title": "Environment variables", | ||
"type": "object" | ||
}, | ||
"labels": { | ||
"title": "App labels", | ||
"type": "object" | ||
} | ||
}, | ||
"required": [ | ||
"image" | ||
], | ||
"order": [ | ||
"image", | ||
"version", | ||
"environment", | ||
"labels" | ||
] | ||
}, | ||
"scaling": { | ||
"type": "object", | ||
"properties": { | ||
"replicas": { | ||
"title": "Replicas", | ||
"type": "integer", | ||
"minimum": 0 | ||
}, | ||
"resources": { | ||
"properties": { | ||
"cpu": { | ||
"title": "CPUs", | ||
"type": "integer" | ||
}, | ||
"memory": { | ||
"title": "Memory", | ||
"description": "Measured in Gi", | ||
"type": "integer" | ||
} | ||
}, | ||
"required": [ | ||
"cpu", | ||
"memory" | ||
], | ||
"order": [ | ||
"cpu", | ||
"memory" | ||
] | ||
} | ||
}, | ||
"required": [ | ||
"replicas" | ||
], | ||
"order": [ | ||
"replicas", | ||
"resources" | ||
] | ||
}, | ||
"networking": { | ||
"type": "object", | ||
"properties": { | ||
"expose": { | ||
"title": "Expose", | ||
"type": "boolean" | ||
}, | ||
"port": { | ||
"title": "Port", | ||
"type": "integer" | ||
} | ||
}, | ||
"order": [ | ||
"expose", | ||
"port" | ||
] | ||
}, | ||
|
||
"replicas": { | ||
"description": "Number of replicas", | ||
"type": "integer" | ||
}, | ||
"image": { | ||
"description": "Container Image", | ||
"type": "string" | ||
}, | ||
"version": { | ||
"description": "Container image version", | ||
"type": "string" | ||
}, | ||
"service": { | ||
"description": "Expose your application", | ||
"type": "boolean" | ||
} | ||
}, | ||
"order": [ | ||
"name", | ||
"replicas", | ||
"script", | ||
"json", | ||
"image", | ||
"version", | ||
"service" | ||
], | ||
"title": "Values", | ||
"type": "object" | ||
} |
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,19 @@ | ||
name: my-app | ||
|
||
general: | ||
image: nginx | ||
version: 1.14.2 | ||
environment: | ||
ENVIRONMENT: production | ||
labels: | ||
app: my-app | ||
team: my-team | ||
project: northstar | ||
|
||
scaling: | ||
replicas: 3 | ||
resources: | ||
|
||
networking: | ||
expose: true | ||
port: 8080 |