Skip to content

Commit

Permalink
[ADD] new version, hpa support and readinessProbe
Browse files Browse the repository at this point in the history
  • Loading branch information
az-adhoc committed Aug 13, 2024
1 parent b4b9a1e commit 2de0be2
Show file tree
Hide file tree
Showing 9 changed files with 146 additions and 157 deletions.
6 changes: 4 additions & 2 deletions charts/adhoc-aeroo-docs/v0.1.3/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ description: A document conversion service (.odt to .pdf for reports)

type: application

version: 0.1.2
version: 0.1.3

appVersion: "1.16.0"
appVersion: "9.1"

home: "https://github.com/adhoc-dev/helm-charts"
sources:
Expand All @@ -18,5 +18,7 @@ maintainers:
email: [email protected]
- name: jjscarafia
email: [email protected]
- name: azacchino
email: [email protected]

icon: "https://github.com/adhoc-dev/helm-charts/raw/master/img/aerooIcon.png"
91 changes: 90 additions & 1 deletion charts/adhoc-aeroo-docs/v0.1.3/questions.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,98 @@
questions:

# NodeTag - Affinity
- variable: image.tag
label: "Image Tag"
type: "string"
required: true
default: "latest"
group: "Common"

- variable: replicaCount
group: "Deploy"
label: "Replica Count"
description: "Scale (number of replicas)"
type: "int"
required: true
default: "1"
- variable: autoscaling.enabled
group: "Deploy"
label: "Enable Autoscaling"
description: "Scale (number of replicas)"
type: "boolean"
default: false
required: false
- variable: autoscaling.minReplicas
group: "Deploy"
label: "autoscaling min"
description: "Scale (minimum number of replicas)"
type: "int"
required: false
default: "1"
- variable: autoscaling.maxReplicas
group: "Deploy"
label: "autoscaling max"
description: "Scale (maximum number of replicas)"
type: "int"
required: false
default: "3"
- variable: autoscaling.targetMemoryUtilizationPercentage
group: "Deploy"
label: "Memory Utilization Percentage"
description: "target % of requested memory"
type: "int"
required: false
default: "85"

# Pods limits and requests
- variable: resources.requestsEnabled
group: "Resources"
label: "Enable requests"
description: "Enable requests"
type: "boolean"
default: false
required: false
- variable: resources.requests.cpu
group: "Resources"
label: "Pods CPU Request"
description: "Pods CPU Request"
type: "string"
required: true
default: "50m"
- variable: resources.requests.memory
group: "Resources"
label: "Pods Memory Request"
description: "Pods Memory Request"
type: "string"
required: true
default: "512Mi"

- variable: resources.limitsEnabled
group: "Resources"
label: "Enable limits"
description: "Enable limits"
type: "boolean"
default: false
required: false
- variable: resources.limits.cpu
group: "Resources"
label: "Pods CPU Limit"
description: "Pods CPU Limit"
type: "string"
required: true
default: "1000m"
- variable: resources.limits.memory
group: "Resources"
label: "Pods Memory Limit"
description: "Pods Memory Limit"
type: "string"
required: true
default: "2Gi"

# NodeTag - Affinity
- variable: nodeTag
label: "Node tag for node affinity"
description: "Tag to schedule pods in nodes"
type: "string"
required: true
default: "Prod"
group: "Deploy"
22 changes: 0 additions & 22 deletions charts/adhoc-aeroo-docs/v0.1.3/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,22 +0,0 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "adhoc-aeroo.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "adhoc-aeroo.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "adhoc-aeroo.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "adhoc-aeroo.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}
13 changes: 11 additions & 2 deletions charts/adhoc-aeroo-docs/v0.1.3/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ spec:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
- name: aero
containerPort: 8989
protocol: TCP
{{- with .Values.livenessProbe }}
Expand All @@ -45,8 +45,17 @@ spec:
readinessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if or .Values.resources.limitsEnabled .Values.resources.requestsEnabled }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- if .Values.resources.limitsEnabled }}
limits:
{{- toYaml .Values.resources.limits | nindent 14 }}
{{- end }}
{{- if .Values.resources.requestsEnabled }}
requests:
{{- toYaml .Values.resources.requests | nindent 14 }}
{{- end }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
8 changes: 6 additions & 2 deletions charts/adhoc-aeroo-docs/v0.1.3/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ spec:
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
61 changes: 0 additions & 61 deletions charts/adhoc-aeroo-docs/v0.1.3/templates/ingress.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions charts/adhoc-aeroo-docs/v0.1.3/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
targetPort: aero
protocol: TCP
name: http
name: aero
selector:
{{- include "adhoc-aeroo.selectorLabels" . | nindent 4 }}

This file was deleted.

83 changes: 33 additions & 50 deletions charts/adhoc-aeroo-docs/v0.1.3/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ image:
repository: adhoc/aeroo-docs
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "latest"
tag: "9.1"

imagePullSecrets: []
nameOverride: ""
Expand All @@ -28,68 +28,51 @@ podAnnotations: {}
podSecurityContext: {}
# fsGroup: 2000

securityContext: {}
# capabilities:
# drop:
# - ALL
securityContext:
capabilities:
drop:
- ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
runAsNonRoot: true
runAsUser: 1000


# livenessProbe:
# failureThreshold: 3
# periodSeconds: 10
# successThreshold: 1
# tcpSocket:
# port: 8989
# timeoutSeconds: 5

readinessProbe:
livenessProbe:
failureThreshold: 3
periodSeconds: 10
successThreshold: 2
successThreshold: 1
tcpSocket:
port: 8989
port: aero
timeoutSeconds: 5

readinessProbe:
initialDelaySeconds: 30
failureThreshold: 3
periodSeconds: 60
successThreshold: 2
timeoutSeconds: 15
httpGet:
path: /?jsonrpc=2.0&method=test&id=1
port: aero

service:
type: ClusterIP
port: 8989

ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
resources:
limitsEnabled: true
limits:
cpu: 1000m
memory: 2Gi
requestsEnabled: true
requests:
cpu: 50m
memory: 512Mi

autoscaling:
enabled: false
enabled: true
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
maxReplicas: 3
# targetCPUUtilizationPercentage: 80
targetMemoryUtilizationPercentage: 85

nodeTag: "Prod"

0 comments on commit 2de0be2

Please sign in to comment.