-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #6 : Add Namespace and Probes Configuration to Kubernetes Manifests #7
base: main
Are you sure you want to change the base?
Changes from 6 commits
9f6b9bd
647f337
931e99a
d39a512
d421355
ab32e68
b2e54fd
01d71e2
bb69782
4ef0a98
ba98d11
7234332
b9f58e6
a8df846
d0364ac
d1b7e62
4203578
9630037
c9d7c60
42a31a4
91b183c
9ea3325
bf9ab27
312d157
bfcf826
e987067
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,11 @@ apiVersion: apps/v1 | |
kind: Deployment | ||
metadata: | ||
name: {{ .Values.name }} | ||
namespace: {{ .Values.namespace }} | ||
labels: | ||
app: {{ .Values.name }} | ||
spec: | ||
replicas: {{ (.Values.scaling).replicas | default 1 }} | ||
replicas: {{ .Values.scaling.replicas }} | ||
selector: | ||
matchLabels: | ||
app: {{ .Values.name }} | ||
|
@@ -17,32 +18,48 @@ spec: | |
containers: | ||
- name: {{ .Values.name }} | ||
image: "{{ .Values.general.image }}:{{ .Values.general.version }}" | ||
{{- if ((.Values.networking).expose) }} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you remove all empty lines? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah sure |
||
{{- if .Values.networking.expose }} | ||
ports: | ||
- name: http | ||
containerPort: {{ .Values.networking.port | default 80 }} | ||
containerPort: {{ .Values.networking.port }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens if port is not set? We cant enforce it since exposing is optional There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah but this template is meant to expose the port specified by the user. |
||
protocol: TCP | ||
{{- end }} | ||
|
||
env: | ||
{{- if ((.Values.general).environment) }} | ||
{{- range $key, $value := (.Values.general).environment }} | ||
- name: {{ $key }} | ||
value: {{ $value | quote }} | ||
{{- if .Values.general.environment }} | ||
{{- toYaml .Values.general.environment | indent 12 }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
{{- end }} | ||
{{- end }} | ||
{{- if or ((.Values.scaling).resources).memory ((.Values.scaling).resources).cpu }} | ||
|
||
resources: | ||
{{- if ((.Values.scaling).resources).memory }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you rever the resources object since its not format properly and it can cause a null pointer because of deleted brackets There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok |
||
{{- if .Values.scaling.resources.memory }} | ||
limits: | ||
memory: {{ ((.Values.scaling).resources).memory }}Gi | ||
memory: "{{ .Values.scaling.resources.memory }}Gi" | ||
{{- end }} | ||
{{- if or ((.Values.scaling).resources).memory ((.Values.scaling).resources).cpu }} | ||
{{- if .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 }}Gi | ||
{{- end }} | ||
cpu: "{{ .Values.scaling.resources.cpu }}" | ||
{{- end }} | ||
{{- end }} | ||
|
||
readinessProbe: | ||
httpGet: | ||
path: {{ .Values.probes.readiness.path }} | ||
port: http | ||
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }} | ||
periodSeconds: {{ .Values.probes.readiness.periodSeconds }} | ||
failureThreshold: {{ .Values.probes.readiness.failureThreshold }} | ||
|
||
livenessProbe: | ||
httpGet: | ||
path: {{ .Values.probes.liveness.path }} | ||
port: http | ||
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }} | ||
periodSeconds: {{ .Values.probes.liveness.periodSeconds }} | ||
|
||
startupProbe: | ||
httpGet: | ||
path: {{ .Values.probes.startup.path }} | ||
port: http | ||
initialDelaySeconds: {{ .Values.probes.startup.initialDelaySeconds }} | ||
periodSeconds: {{ .Values.probes.startup.periodSeconds }} | ||
failureThreshold: {{ .Values.probes.startup.failureThreshold }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,11 @@ | |
"title": "Name", | ||
"description": "Application name" | ||
}, | ||
"namespace": { | ||
"type": "string", | ||
"title": "Namespace", | ||
"description": "Namespace for Application" | ||
}, | ||
"general": { | ||
"type": "object", | ||
"title": "General", | ||
|
@@ -74,6 +79,79 @@ | |
"resources" | ||
] | ||
}, | ||
"probes": { | ||
"type": "object", | ||
"title": "Probes", | ||
"properties": { | ||
"startup": { | ||
RohanRusta21 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"title": "Startup Probe", | ||
"type": "object", | ||
"properties": { | ||
RohanRusta21 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"path": { | ||
"title": "Path for probe", | ||
"type": "string" | ||
}, | ||
"initialDelaySeconds": { | ||
"title": "Initial Delay Seconds", | ||
"type": "integer" | ||
}, | ||
"periodSeconds": { | ||
"title": "Period Seconds", | ||
"type": "integer" | ||
}, | ||
"failureThreshold": { | ||
"title": "Failure Threshold", | ||
"type": "integer" | ||
} | ||
} | ||
}, | ||
"liveness": { | ||
"title": "Liveness Probe", | ||
"type": "object", | ||
"properties": { | ||
"path": { | ||
"title": "Path for probe", | ||
"type": "string" | ||
}, | ||
"initialDelaySeconds": { | ||
"title": "Initial Delay Seconds", | ||
"type": "integer" | ||
}, | ||
"periodSeconds": { | ||
"title": "Period Seconds", | ||
"type": "integer" | ||
} | ||
} | ||
}, | ||
"readiness": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey @petar-cvit , Yup its done now. Please Review it :) |
||
"title": "Readiness Probe", | ||
"type": "object", | ||
"properties": { | ||
"path": { | ||
"title": "Path for probe", | ||
"type": "string" | ||
}, | ||
"initialDelaySeconds": { | ||
"title": "Initial Delay Seconds", | ||
"type": "integer" | ||
}, | ||
"periodSeconds": { | ||
"title": "Period Seconds", | ||
"type": "integer" | ||
}, | ||
"failureThreshold": { | ||
"title": "Failure Threshold", | ||
"type": "integer" | ||
} | ||
} | ||
} | ||
}, | ||
"order": [ | ||
"startup", | ||
"liveness", | ||
"readiness" | ||
] | ||
}, | ||
"networking": { | ||
"type": "object", | ||
"title": "Networking", | ||
|
@@ -100,8 +178,10 @@ | |
], | ||
"order": [ | ||
"name", | ||
"namespace", | ||
"general", | ||
"scaling", | ||
"probes", | ||
"networking" | ||
], | ||
"title": "Values", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we leave this default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes we can