Skip to content

Commit 5358dcf

Browse files
authored
Helm chart (#5)
* Dec-4 create docker compose test locally * dec-5 adding helm chart
1 parent 0a8a26b commit 5358dcf

File tree

6 files changed

+147
-0
lines changed

6 files changed

+147
-0
lines changed

helm/charts/project-ipv6/Chart.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: project-ipv6
3+
description: Helm chart for Kubernetes deployment
4+
version: 0.1.0
5+
appVersion: 1.0.0
6+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{{- define "project-ipv6.labels" -}}
2+
app: {{ .Chart.Name }}
3+
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
4+
release: {{ .Release.Name }}
5+
{{- end -}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ .Release.Name }}-deployment
5+
namespace: {{ .Values.namespace.name }}
6+
labels:
7+
app: {{ .Release.Name }}
8+
spec:
9+
replicas: {{ .Values.replicaCount }}
10+
selector:
11+
matchLabels:
12+
app: {{ .Release.Name }}
13+
template:
14+
metadata:
15+
labels:
16+
app: {{ .Release.Name }}
17+
spec:
18+
securityContext:
19+
runAsUser: {{ .Values.securityContext.runAsUser | default 999 }}
20+
runAsGroup: {{ .Values.securityContext.runAsGroup | default 999 }}
21+
automountServiceAccountToken: {{ .Values.automountServiceAccountToken | default false }}
22+
containers:
23+
- name: {{ .Chart.Name }}
24+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
25+
imagePullPolicy: Always
26+
ports:
27+
- containerPort: {{ .Values.service.targetPort }}
28+
{{- if .Values.env.enabled }}
29+
env:
30+
- name: APP_ENV
31+
value: "{{ .Values.env.value }}"
32+
{{- end }}
33+
securityContext:
34+
runAsUser: {{ .Values.securityContext.runAsUser | default 999 }}
35+
runAsGroup: {{ .Values.securityContext.runAsGroup | default 999 }}
36+
allowPrivilegeEscalation: {{ .Values.securityContext.allowPrivilegeEscalation | default false }}
37+
readOnlyRootFilesystem: {{ .Values.securityContext.readOnlyRootFilesystem | default true }}
38+
capabilities:
39+
drop:
40+
{{- range .Values.securityContext.capabilities.drop }}
41+
- {{ . }}
42+
{{- end }}
43+
seccompProfile:
44+
type: RuntimeDefault
45+
{{- toYaml .Values.securityContext | nindent 12 }}
46+
resources:
47+
{{- toYaml .Values.resources | nindent 12 }}
48+
{{- if .Values.probes.enabled }}
49+
livenessProbe:
50+
httpGet:
51+
path: {{ .Values.probes.path }}
52+
port: {{ .Values.service.targetPort }}
53+
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
54+
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
55+
failureThreshold: {{ .Values.probes.liveness.failureThreshold }}
56+
readinessProbe:
57+
httpGet:
58+
path: {{ .Values.probes.path }}
59+
port: {{ .Values.service.targetPort }}
60+
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
61+
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
62+
failureThreshold: {{ .Values.probes.readiness.failureThreshold }}
63+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{{- if .Values.networkPolicy.enabled }}
2+
apiVersion: networking.k8s.io/v1
3+
kind: NetworkPolicy
4+
metadata:
5+
name: restrict-application-01-to-application-02
6+
namespace: project-ipv6
7+
spec:
8+
podSelector:
9+
matchLabels:
10+
app: application-02
11+
ingress:
12+
- from:
13+
- podSelector:
14+
matchLabels:
15+
app: application-02
16+
- podSelector:
17+
matchExpressions:
18+
- key: app
19+
operator: NotIn
20+
values:
21+
- application-01
22+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ .Release.Name }}-service
5+
namespace: {{ .Values.namespace.name }}
6+
labels:
7+
app: {{ .Release.Name }}
8+
spec:
9+
type: {{ .Values.service.type }}
10+
ports:
11+
- port: {{ .Values.service.port }}
12+
targetPort: {{ .Values.service.targetPort }}
13+
selector:
14+
app: {{ .Release.Name }}

helm/charts/project-ipv6/values.yaml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
replicaCount: 1
2+
env:
3+
enabled: false
4+
automountServiceAccountToken: false
5+
resources:
6+
limits:
7+
memory: "256Mi"
8+
cpu: "500m"
9+
requests:
10+
memory: "128Mi"
11+
cpu: "250m"
12+
networkPolicy:
13+
enabled: false
14+
securityContext:
15+
runAsUser: 10000
16+
runAsGroup: 10000
17+
allowPrivilegeEscalation: false
18+
readOnlyRootFilesystem: true
19+
capabilities:
20+
drop:
21+
- ALL
22+
23+
probes:
24+
enabled: false
25+
liveness:
26+
initialDelaySeconds: 5
27+
periodSeconds: 10
28+
failureThreshold: 3
29+
path: /
30+
readiness:
31+
initialDelaySeconds: 5
32+
periodSeconds: 10
33+
failureThreshold: 3
34+
path: /
35+
36+
volumeMounts:
37+
appDataPath: /data/app

0 commit comments

Comments
 (0)