Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Hansel-Christopher committed Apr 28, 2024
1 parent 19705e1 commit 70f6e9c
Show file tree
Hide file tree
Showing 6 changed files with 186 additions and 48 deletions.
13 changes: 13 additions & 0 deletions charts/build-push-chart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CHART_DIR="$1"
VERSION=$(grep 'version:' $CHART_DIR/Chart.yaml | cut -d ':' -f 2 | tr -d ' ')

# Validate version
if [ -z "$VERSION" ]; then
echo "Version not found in Chart.yaml"
exit 1
fi

helm package service-chart
helm push service-chart-$VERSION.tgz oci://registry-1.docker.io/hanselchristopher001

rm service-chart-$VERSION.tgz
13 changes: 10 additions & 3 deletions charts/service-chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,19 @@ A Helm chart for Kubernetes
| autoscaling.minReplicas | int | `1` | |
| autoscaling.triggers.memory.value | string | `"80"` | |
| containerPort | int | `5000` | |
| deploymentAnnotations | object | `{}` | |
| fullnameOverride | string | `""` | |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"hanselchristopher001/password-generator"` | |
| image.tag | string | `"v1.0.0"` | |
| ingress.annotations | object | `{}` | |
| ingress.className | string | `"nginx"` | |
| ingress.enabled | bool | `false` | |
| ingress.hosts[0].paths[0].path | string | `"/"` | |
| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | |
| ingress.hosts[0].host | string | `"localhost"` | |
| ingress.hosts[0].paths[0].path | string | `"/generate-passwords"` | |
| ingress.hosts[0].paths[0].pathType | string | `"Prefix"` | |
| ingress.hosts[0].paths[1].path | string | `"/"` | |
| ingress.hosts[0].paths[1].pathType | string | `"Prefix"` | |
| ingress.tls | list | `[]` | |
| nodeSelector | object | `{}` | |
| pdb.maxUnavailable | int | `1` | |
Expand All @@ -40,7 +44,10 @@ A Helm chart for Kubernetes
| probes.startup.path | string | `"/"` | |
| probes.startup.periodSeconds | int | `20` | |
| replicaCount | int | `3` | |
| resources | object | `{}` | |
| resources.limits.cpu | string | `"200m"` | |
| resources.limits.memory | string | `"512Mi"` | |
| resources.requests.cpu | string | `"100m"` | |
| resources.requests.memory | string | `"256Mi"` | |
| service.port | int | `80` | |
| service.type | string | `"ClusterIP"` | |
| serviceMonitor.enabled | bool | `true` | |
Expand Down
2 changes: 1 addition & 1 deletion charts/service-chart/templates/pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: PodDisruptionBudget
metadata:
name: {{ include "service-chart.fullname" . }}
labels:
{{- include "service-chart.standardLabels" . }}
{{- include "service-chart.standardLabels" . | nindent 4 }}
spec:
maxUnavailable: {{ .Values.pdb.maxUnavailable | default 1 }}
selector:
Expand Down
7 changes: 5 additions & 2 deletions charts/service-chart/templates/rollout.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ metadata:
name: {{ include "service-chart.fullname" . }}
labels:
{{- include "service-chart.standardLabels" . | nindent 4 }}
annotations:
{{- if .Values.deploymentAnnotations }}
{{ toYaml .Values.deploymentAnnotations | indent 4 }}
{{- end }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
Expand All @@ -19,8 +23,7 @@ spec:
template:
metadata:
labels:
app: {{ include "service-chart.name" . }}
release: {{ .Release.Name }}
{{- include "service-chart.selectorLabels" . | nindent 8 }}
spec:
containers:
- name: {{ .Chart.Name }}
Expand Down
104 changes: 104 additions & 0 deletions charts/service-chart/values-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
fullnameOverride: "example-app"

deploymentAnnotations: {}
# example: "annotation"

replicaCount: 1

resources:
requests:
cpu: "100m"
memory: "256Mi"
limits:
cpu: "200m"
memory: "512Mi"

pdb:
maxUnavailable: 1

image:
repository: hanselchristopher001/password-generator
pullPolicy: IfNotPresent
tag: "v1.0.0"

nodeSelector: {}
affinity: {}
tolerations: {}

probes:
liveness:
enabled: true
path: "/"
initialDelaySeconds: 30
periodSeconds: 10
readiness:
enabled: true
path: "/"
initialDelaySeconds: 20
periodSeconds: 5
startup:
enabled: true
path: "/"
initialDelaySeconds: 30
periodSeconds: 20
failureThreshold: 10

service:
type: ClusterIP
port: 80

containerPort: 5000

ingress:
enabled: false
className: "nginx"
annotations: {}
hosts:
- host: localhost
paths:
- path: /generate-passwords
pathType: Prefix
- path: /
pathType: Prefix
tls: []

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 10
triggers:
memory:
value: "80"

serviceMonitor:
enabled: true

topologySpreadConstraints:
# - maxSkew: 1
# topologyKey: kubernetes.io/hostname
# whenUnsatisfiable: ScheduleAnyway
# labelSelector:
# matchExpressions:
# - key: disktype
# operator: In
# values:
# - ssd
# - maxSkew: 1
# topologyKey: topology.kubernetes.io/zone
# whenUnsatisfiable: ScheduleAnyway
# labelSelector:
# matchExpressions:
# - key: disktype
# operator: In
# values:
# - ssd

# affinity:
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# —matchExpressions:
# —key: "disktype"
# operator: "In"
# values:
# — ssd
95 changes: 53 additions & 42 deletions charts/service-chart/values.yaml
Original file line number Diff line number Diff line change
@@ -1,56 +1,26 @@
fullnameOverride: ""

deploymentAnnotations: {}
# example: "annotation"

replicaCount: 3

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 10
triggers:
memory:
value: "80"
resources:
requests:
cpu: "100m"
memory: "256Mi"
limits:
cpu: "200m"
memory: "512Mi"

pdb:
maxUnavailable: 1

topologySpreadConstraints:
# - maxSkew: 1
# topologyKey: kubernetes.io/hostname
# whenUnsatisfiable: ScheduleAnyway
# labelSelector:
# matchExpressions:
# - key: disktype
# operator: In
# values:
# - ssd
# - maxSkew: 1
# topologyKey: topology.kubernetes.io/zone
# whenUnsatisfiable: ScheduleAnyway
# labelSelector:
# matchExpressions:
# - key: disktype
# operator: In
# values:
# - ssd

# affinity:
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# —matchExpressions:
# —key: "disktype"
# operator: "In"
# values:
# — ssd


image:
repository: hanselchristopher001/password-generator
pullPolicy: IfNotPresent
tag: "v1.0.0"

resources: {}

nodeSelector: {}
affinity: {}
tolerations: {}
Expand Down Expand Up @@ -84,10 +54,51 @@ ingress:
className: "nginx"
annotations: {}
hosts:
- paths:
- host: localhost
paths:
- path: /generate-passwords
pathType: Prefix
- path: /
pathType: ImplementationSpecific
pathType: Prefix
tls: []

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 10
triggers:
memory:
value: "80"

serviceMonitor:
enabled: true

topologySpreadConstraints:
# - maxSkew: 1
# topologyKey: kubernetes.io/hostname
# whenUnsatisfiable: ScheduleAnyway
# labelSelector:
# matchExpressions:
# - key: disktype
# operator: In
# values:
# - ssd
# - maxSkew: 1
# topologyKey: topology.kubernetes.io/zone
# whenUnsatisfiable: ScheduleAnyway
# labelSelector:
# matchExpressions:
# - key: disktype
# operator: In
# values:
# - ssd

# affinity:
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# —matchExpressions:
# —key: "disktype"
# operator: "In"
# values:
# — ssd

0 comments on commit 70f6e9c

Please sign in to comment.