Skip to content

Commit 1f04701

Browse files
committed
adds helm charts
1 parent 18ae367 commit 1f04701

File tree

18 files changed

+714
-0
lines changed

18 files changed

+714
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: v1
2+
description: Helm chart for Springboot Items API Webflux
3+
name: springboot-items-api-webflux
4+
version: 1.0
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "name" -}}
6+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7+
{{- end -}}
8+
9+
{{- define "releasetag" -}}
10+
{{- default .Release.Name .Values.releaseTagOverride | trunc 63 | trimSuffix "-" -}}
11+
{{- end -}}
12+
13+
14+
{{- define "host" -}}
15+
{{- printf "%s-%s.%s" .Values.ingress.appName .Release.Namespace .Values.ingress.host }}
16+
{{- end -}}
17+
18+
19+
{{/*
20+
Create a default fully qualified app name.
21+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
22+
*/}}
23+
{{- define "fullname" -}}
24+
{{- $name := default .Chart.Name .Values.nameOverride -}}
25+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
26+
{{- end -}}
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ template "name" . }}
5+
labels:
6+
app: {{ template "name" . }}
7+
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
8+
release: {{ template "releasetag" . }}
9+
heritage: {{ .Release.Service }}
10+
spec:
11+
selector:
12+
matchLabels:
13+
app: {{ template "name" . }}
14+
release: {{ .Release.Name }}
15+
replicas: {{ .Values.replicaCount }}
16+
# The number of old deployments you want to keep around
17+
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
18+
template:
19+
metadata:
20+
labels:
21+
app: {{ template "name" . }}
22+
release: {{ .Release.Name }}
23+
version: {{ .Values.subset.version }}
24+
spec:
25+
affinity:
26+
podAntiAffinity:
27+
preferredDuringSchedulingIgnoredDuringExecution:
28+
- weight: 100
29+
podAffinityTerm:
30+
labelSelector:
31+
matchExpressions:
32+
- key: app
33+
operator: In
34+
values:
35+
- {{ template "name" . }}
36+
topologyKey: kubernetes.io/hostname
37+
securityContext:
38+
runAsUser: {{ .Values.image.runAsUser }}
39+
containers:
40+
- name: {{ .Chart.Name }}
41+
image: "{{ .Values.image.repository }}/{{ .Values.image.name }}:{{ .Values.image.tag }}"
42+
resources:
43+
limits:
44+
#cpu: "2"
45+
cpu: "0.5"
46+
memory: 385Mi
47+
requests:
48+
cpu: "0.5"
49+
memory: 308Mi
50+
imagePullPolicy: {{ .Values.image.pullPolicy }}
51+
env:
52+
- name: spring_config_location
53+
value: /config/application.yaml
54+
- name: spring_profiles_active
55+
value: kubernetes
56+
- name: mysql_username
57+
valueFrom:
58+
secretKeyRef:
59+
key: username
60+
name: mysql-credentials
61+
- name: mysql_password
62+
valueFrom:
63+
secretKeyRef:
64+
key: password
65+
name: mysql-credentials
66+
ports:
67+
- name: http-app
68+
containerPort: {{ .Values.service.appPort }}
69+
protocol: TCP
70+
- name: http-liveness
71+
containerPort: {{ .Values.service.livenessPort }}
72+
protocol: TCP
73+
livenessProbe:
74+
httpGet:
75+
path: "/actuator/health"
76+
port: http-liveness
77+
scheme: HTTP
78+
initialDelaySeconds: 90
79+
periodSeconds: 10
80+
successThreshold: 1
81+
timeoutSeconds: 5
82+
readinessProbe:
83+
httpGet:
84+
path: /actuator/health
85+
port: http-liveness
86+
scheme: HTTP
87+
initialDelaySeconds: 55
88+
periodSeconds: 10
89+
successThreshold: 1
90+
timeoutSeconds: 5
91+
volumeMounts:
92+
- mountPath: /config
93+
name: application-config
94+
readOnly: true
95+
volumes:
96+
- name: application-config
97+
configMap:
98+
name: {{ template "name" . }}
99+
defaultMode: 438
100+
items:
101+
- key: application.yaml
102+
path: application.yaml
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: networking.istio.io/v1alpha3
2+
kind: DestinationRule
3+
metadata:
4+
name: {{ template "name" . }}
5+
spec:
6+
host: {{ .Values.service.name }}
7+
trafficPolicy:
8+
tls:
9+
mode: ISTIO_MUTUAL
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ .Values.service.name }}
5+
labels:
6+
app: {{ template "name" . }}
7+
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
8+
release: {{ template "releasetag" . }}
9+
heritage: {{ .Release.Service }}
10+
spec:
11+
type: {{ .Values.service.type }}
12+
ports:
13+
- name: http-app
14+
port: {{ .Values.service.appPort }}
15+
targetPort: {{ .Values.service.appPort }}
16+
protocol: TCP
17+
- name: http-liveness
18+
port: {{ .Values.service.livenessPort }}
19+
targetPort: {{ .Values.service.livenessPort }}
20+
protocol: TCP
21+
selector:
22+
app: {{ template "name" . }}
23+
release: {{ .Release.Name }}
24+
version: {{ .Values.subset.version }}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: networking.istio.io/v1alpha3
2+
kind: VirtualService
3+
metadata:
4+
name: {{ template "name" . }}
5+
spec:
6+
hosts:
7+
- {{ .Values.service.name }}
8+
- "{{ .Values.ingress.itemsPath }}"
9+
gateways:
10+
- "{{ .Values.ingress.gateway }}"
11+
http:
12+
- route:
13+
- destination:
14+
# subset: {{ .Values.subset.version }}
15+
host: {{ .Values.service.name }}
16+
port:
17+
number: {{ .Values.service.appPort }}
18+
weight: 100
19+
timeout: 10s
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
replicaCount: 2
2+
revisionHistoryLimit: 3
3+
subset:
4+
version: v1
5+
image:
6+
repository: michaelsteven
7+
name: springboot-items-api-webflux
8+
tag: 0.0.1
9+
pullSecret: regsecret
10+
pullPolicy: Always
11+
runAsUser: 1001
12+
service:
13+
name: springboot-items-api-webflux
14+
type: ClusterIP
15+
appPort: 8080
16+
livenessPort: 9001
17+
resources: {}
18+
apiRoot: '/api/v1/items'
19+
ingress:
20+
gateway: ibmgarageforcloud-com
21+
appName: springboot-items-api-webflux
22+
tlsSecretName: wildcard-ibmgarageforcloud-com
23+
itemsPath: springboot-items-api-webflux.ibmgarageforcloud.com
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: v1
2+
description: Helm chart for Springboot Items API Webflux
3+
name: springboot-items-api-webflux
4+
version: 1.0
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "name" -}}
6+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7+
{{- end -}}
8+
9+
{{- define "releasetag" -}}
10+
{{- default .Release.Name .Values.releaseTagOverride | trunc 63 | trimSuffix "-" -}}
11+
{{- end -}}
12+
13+
14+
{{- define "host" -}}
15+
{{- printf "%s-%s.%s" .Values.ingress.appName .Release.Namespace .Values.ingress.host }}
16+
{{- end -}}
17+
18+
19+
{{/*
20+
Create a default fully qualified app name.
21+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
22+
*/}}
23+
{{- define "fullname" -}}
24+
{{- $name := default .Chart.Name .Values.nameOverride -}}
25+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
26+
{{- end -}}
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ template "name" . }}
5+
labels:
6+
app: {{ template "name" . }}
7+
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
8+
release: {{ template "releasetag" . }}
9+
heritage: {{ .Release.Service }}
10+
spec:
11+
selector:
12+
matchLabels:
13+
app: {{ template "name" . }}
14+
release: {{ .Release.Name }}
15+
replicas: {{ .Values.replicaCount }}
16+
# The number of old deployments you want to keep around
17+
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
18+
template:
19+
metadata:
20+
labels:
21+
app: {{ template "name" . }}
22+
release: {{ .Release.Name }}
23+
spec:
24+
affinity:
25+
podAntiAffinity:
26+
preferredDuringSchedulingIgnoredDuringExecution:
27+
- weight: 100
28+
podAffinityTerm:
29+
labelSelector:
30+
matchExpressions:
31+
- key: app
32+
operator: In
33+
values:
34+
- {{ template "name" . }}
35+
topologyKey: kubernetes.io/hostname
36+
securityContext:
37+
runAsUser: {{ .Values.image.runAsUser }}
38+
containers:
39+
- name: {{ .Chart.Name }}
40+
image: "{{ .Values.image.repository }}/{{ .Values.image.name }}:{{ .Values.image.tag }}"
41+
resources:
42+
limits:
43+
#cpu: "2"
44+
cpu: "0.5"
45+
memory: 385Mi
46+
requests:
47+
cpu: "0.5"
48+
memory: 308Mi
49+
imagePullPolicy: {{ .Values.image.pullPolicy }}
50+
env:
51+
- name: spring_config_location
52+
value: /config/application.yaml
53+
- name: spring_profiles_active
54+
value: kubernetes
55+
- name: mysql_username
56+
valueFrom:
57+
secretKeyRef:
58+
key: username
59+
name: mysql-credentials
60+
- name: mysql_password
61+
valueFrom:
62+
secretKeyRef:
63+
key: password
64+
name: mysql-credentials
65+
ports:
66+
- name: http-app
67+
containerPort: {{ .Values.service.appPort }}
68+
protocol: TCP
69+
- name: http-liveness
70+
containerPort: {{ .Values.service.livenessPort }}
71+
protocol: TCP
72+
livenessProbe:
73+
httpGet:
74+
path: "/actuator/health"
75+
port: http-liveness
76+
scheme: HTTP
77+
initialDelaySeconds: 90
78+
periodSeconds: 10
79+
successThreshold: 1
80+
timeoutSeconds: 5
81+
readinessProbe:
82+
httpGet:
83+
path: /actuator/health
84+
port: http-liveness
85+
scheme: HTTP
86+
initialDelaySeconds: 55
87+
periodSeconds: 10
88+
successThreshold: 1
89+
timeoutSeconds: 5
90+
volumeMounts:
91+
- mountPath: /config
92+
name: application-config
93+
readOnly: true
94+
volumes:
95+
- name: application-config
96+
configMap:
97+
name: {{ template "name" . }}
98+
defaultMode: 438
99+
items:
100+
- key: application.yaml
101+
path: application.yaml

0 commit comments

Comments
 (0)