Skip to content

Commit 6398fd7

Browse files
shubhamcocarttor
authored andcommitted
fixing review comments
1 parent 5907a1b commit 6398fd7

File tree

87 files changed

+5453
-12
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+5453
-12
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: v2
2+
name: app-with-empty-nodeselector
3+
description: A Helm chart for Kubernetes
4+
# A chart can be either an 'application' or a 'library' chart.
5+
#
6+
# Application charts are a collection of templates that can be packaged into versioned archives
7+
# to be deployed.
8+
#
9+
# Library charts provide useful utilities or functions for the chart developer. They're included as
10+
# a dependency of application charts to inject those utilities and functions into the rendering
11+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
12+
type: application
13+
# This is the chart version. This version number should be incremented each time you make changes
14+
# to the chart and its templates, including the app version.
15+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
16+
version: 0.1.0
17+
# This is the version number of the application being deployed. This version number should be
18+
# incremented each time you make changes to the application. Versions are not expected to
19+
# follow Semantic Versioning. They should reflect the version the application is using.
20+
# It is recommended to use it with quotes.
21+
appVersion: "0.1.0"
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "app-with-empty-nodeselector.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "app-with-empty-nodeselector.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "app-with-empty-nodeselector.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "app-with-empty-nodeselector.labels" -}}
37+
helm.sh/chart: {{ include "app-with-empty-nodeselector.chart" . }}
38+
{{ include "app-with-empty-nodeselector.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "app-with-empty-nodeselector.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "app-with-empty-nodeselector.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "app-with-empty-nodeselector.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "app-with-empty-nodeselector.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: batch/v1
2+
kind: Job
3+
metadata:
4+
name: {{ include "app-with-empty-nodeselector.fullname" . }}-batch-job
5+
labels:
6+
{{- include "app-with-empty-nodeselector.labels" . | nindent 4 }}
7+
spec:
8+
backoffLimit: {{ .Values.batchJob.backoffLimit }}
9+
template:
10+
spec:
11+
containers:
12+
- command:
13+
- perl
14+
- -Mbignum=bpi
15+
- -wle
16+
- print bpi(2000)
17+
env:
18+
- name: KUBERNETES_CLUSTER_DOMAIN
19+
value: {{ quote .Values.kubernetesClusterDomain }}
20+
image: {{ .Values.batchJob.pi.image.repository }}:{{ .Values.batchJob.pi.image.tag
21+
| default .Chart.AppVersion }}
22+
name: pi
23+
resources: {}
24+
restartPolicy: Never
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
apiVersion: batch/v1
2+
kind: CronJob
3+
metadata:
4+
name: {{ include "app-with-empty-nodeselector.fullname" . }}-cron-job
5+
labels:
6+
{{- include "app-with-empty-nodeselector.labels" . | nindent 4 }}
7+
spec:
8+
jobTemplate:
9+
spec:
10+
template:
11+
spec:
12+
containers:
13+
- command:
14+
- /bin/sh
15+
- -c
16+
- date; echo Hello from the Kubernetes cluster
17+
env:
18+
- name: KUBERNETES_CLUSTER_DOMAIN
19+
value: {{ quote .Values.kubernetesClusterDomain }}
20+
image: {{ .Values.cronJob.hello.image.repository }}:{{ .Values.cronJob.hello.image.tag
21+
| default .Chart.AppVersion }}
22+
imagePullPolicy: {{ .Values.cronJob.hello.imagePullPolicy }}
23+
name: hello
24+
resources: {}
25+
restartPolicy: OnFailure
26+
schedule: {{ .Values.cronJob.schedule | quote }}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
apiVersion: apps/v1
2+
kind: DaemonSet
3+
metadata:
4+
name: {{ include "app-with-empty-nodeselector.fullname" . }}-fluentd-elasticsearch
5+
labels:
6+
k8s-app: fluentd-logging
7+
{{- include "app-with-empty-nodeselector.labels" . | nindent 4 }}
8+
spec:
9+
selector:
10+
matchLabels:
11+
name: fluentd-elasticsearch
12+
{{- include "app-with-empty-nodeselector.selectorLabels" . | nindent 6 }}
13+
template:
14+
metadata:
15+
labels:
16+
name: fluentd-elasticsearch
17+
{{- include "app-with-empty-nodeselector.selectorLabels" . | nindent 8 }}
18+
spec:
19+
containers:
20+
- env:
21+
- name: KUBERNETES_CLUSTER_DOMAIN
22+
value: {{ quote .Values.kubernetesClusterDomain }}
23+
image: {{ .Values.fluentdElasticsearch.fluentdElasticsearch.image.repository }}:{{
24+
.Values.fluentdElasticsearch.fluentdElasticsearch.image.tag | default .Chart.AppVersion
25+
}}
26+
name: fluentd-elasticsearch
27+
resources: {{- toYaml .Values.fluentdElasticsearch.fluentdElasticsearch.resources
28+
| nindent 10 }}
29+
volumeMounts:
30+
- mountPath: /var/log
31+
name: varlog
32+
- mountPath: /var/lib/docker/containers
33+
name: varlibdockercontainers
34+
readOnly: true
35+
terminationGracePeriodSeconds: 30
36+
tolerations:
37+
- effect: NoSchedule
38+
key: node-role.kubernetes.io/master
39+
operator: Exists
40+
volumes:
41+
- hostPath:
42+
path: /var/log
43+
name: varlog
44+
- hostPath:
45+
path: /var/lib/docker/containers
46+
name: varlibdockercontainers
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "app-with-empty-nodeselector.fullname" . }}-myapp
5+
labels:
6+
app: myapp
7+
{{- include "app-with-empty-nodeselector.labels" . | nindent 4 }}
8+
spec:
9+
replicas: {{ .Values.myapp.replicas }}
10+
selector:
11+
matchLabels:
12+
app: myapp
13+
{{- include "app-with-empty-nodeselector.selectorLabels" . | nindent 6 }}
14+
template:
15+
metadata:
16+
labels:
17+
app: myapp
18+
{{- include "app-with-empty-nodeselector.selectorLabels" . | nindent 8 }}
19+
spec:
20+
containers:
21+
- args:
22+
- --health-probe-bind-address=:8081
23+
- --metrics-bind-address=127.0.0.1:8080
24+
- --leader-elect
25+
command:
26+
- /manager
27+
env:
28+
- name: VAR1
29+
valueFrom:
30+
secretKeyRef:
31+
key: VAR1
32+
name: {{ include "app-with-empty-nodeselector.fullname" . }}-my-secret-vars
33+
- name: VAR2
34+
valueFrom:
35+
secretKeyRef:
36+
key: VAR2
37+
name: {{ include "app-with-empty-nodeselector.fullname" . }}-my-secret-vars
38+
- name: KUBERNETES_CLUSTER_DOMAIN
39+
value: {{ quote .Values.kubernetesClusterDomain }}
40+
image: {{ .Values.myapp.app.image.repository }}:{{ .Values.myapp.app.image.tag
41+
| default .Chart.AppVersion }}
42+
livenessProbe:
43+
httpGet:
44+
path: /healthz
45+
port: 8081
46+
initialDelaySeconds: 15
47+
periodSeconds: 20
48+
name: app
49+
readinessProbe:
50+
httpGet:
51+
path: /readyz
52+
port: 8081
53+
initialDelaySeconds: 5
54+
periodSeconds: 10
55+
resources: {{- toYaml .Values.myapp.app.resources | nindent 10 }}
56+
securityContext: {{- toYaml .Values.myapp.app.containerSecurityContext | nindent
57+
10 }}
58+
volumeMounts:
59+
- mountPath: /my_config.properties
60+
name: manager-config
61+
subPath: my_config.properties
62+
- mountPath: /my.ca
63+
name: secret-volume
64+
- mountPath: /etc/props
65+
name: props
66+
- mountPath: /usr/share/nginx/html
67+
name: sample-pv-storage
68+
- args:
69+
- --secure-listen-address=0.0.0.0:8443
70+
- --v=10
71+
env:
72+
- name: KUBERNETES_CLUSTER_DOMAIN
73+
value: {{ quote .Values.kubernetesClusterDomain }}
74+
image: {{ .Values.myapp.proxySidecar.image.repository }}:{{ .Values.myapp.proxySidecar.image.tag
75+
| default .Chart.AppVersion }}
76+
name: proxy-sidecar
77+
ports:
78+
- containerPort: 8443
79+
name: https
80+
resources: {}
81+
nodeSelector: {{- toYaml .Values.myapp.nodeSelector | nindent 8 }}
82+
securityContext:
83+
runAsNonRoot: true
84+
terminationGracePeriodSeconds: 10
85+
volumes:
86+
- configMap:
87+
name: {{ include "app-with-empty-nodeselector.fullname" . }}-my-config
88+
name: manager-config
89+
- configMap:
90+
name: {{ include "app-with-empty-nodeselector.fullname" . }}-my-config-props
91+
name: props
92+
- name: secret-volume
93+
secret:
94+
secretName: {{ include "app-with-empty-nodeselector.fullname" . }}-my-secret-ca
95+
- name: sample-pv-storage
96+
persistentVolumeClaim:
97+
claimName: {{ include "app-with-empty-nodeselector.fullname" . }}-my-sample-pv-claim
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "app-with-empty-nodeselector.fullname" . }}-my-config-props
5+
labels:
6+
{{- include "app-with-empty-nodeselector.labels" . | nindent 4 }}
7+
data:
8+
my.prop1: {{ .Values.myConfigProps.myProp1 | quote }}
9+
my.prop2: {{ .Values.myConfigProps.myProp2 | quote }}
10+
my.prop3: {{ .Values.myConfigProps.myProp3 | quote }}
11+
myval.yaml: {{ .Values.myConfigProps.myvalYaml | toYaml | indent 1 }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "app-with-empty-nodeselector.fullname" . }}-my-config
5+
labels:
6+
{{- include "app-with-empty-nodeselector.labels" . | nindent 4 }}
7+
immutable: true
8+
data:
9+
dummyconfigmapkey: {{ .Values.myConfig.dummyconfigmapkey | quote }}
10+
my_config.properties: |
11+
health.healthProbeBindAddress={{ .Values.myConfig.myConfigProperties.health.healthProbeBindAddress | quote }}
12+
metrics.bindAddress={{ .Values.myConfig.myConfigProperties.metrics.bindAddress | quote }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: PersistentVolumeClaim
3+
metadata:
4+
name: {{ include "app-with-empty-nodeselector.fullname" . }}-my-sample-pv-claim
5+
labels:
6+
{{- include "app-with-empty-nodeselector.labels" . | nindent 4 }}
7+
spec:
8+
accessModes:
9+
- ReadWriteOnce
10+
resources:
11+
limits:
12+
storage: {{ .Values.pvc.mySamplePvClaim.storageLimit | quote }}
13+
requests:
14+
storage: {{ .Values.pvc.mySamplePvClaim.storageRequest | quote }}
15+
storageClassName: {{ .Values.pvc.mySamplePvClaim.storageClass | quote }}

0 commit comments

Comments
 (0)