From b4b9a1ed3e47556e1f0752bc267572e65e3cb62f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CAndres?= Date: Thu, 8 Aug 2024 15:32:24 -0300 Subject: [PATCH 1/2] [ADD] new version --- charts/adhoc-aeroo-docs/v0.1.3/Chart.yaml | 22 +++++ charts/adhoc-aeroo-docs/v0.1.3/questions.yml | 9 ++ .../v0.1.3/templates/NOTES.txt | 22 +++++ .../v0.1.3/templates/_helpers.tpl | 62 ++++++++++++ .../v0.1.3/templates/deployment.yaml | 68 +++++++++++++ .../v0.1.3/templates/hpa.yaml | 28 ++++++ .../v0.1.3/templates/ingress.yaml | 61 ++++++++++++ .../v0.1.3/templates/service.yaml | 15 +++ .../v0.1.3/templates/serviceaccount.yaml | 12 +++ .../templates/tests/test-connection.yaml | 15 +++ charts/adhoc-aeroo-docs/v0.1.3/values.yaml | 95 +++++++++++++++++++ 11 files changed, 409 insertions(+) create mode 100644 charts/adhoc-aeroo-docs/v0.1.3/Chart.yaml create mode 100644 charts/adhoc-aeroo-docs/v0.1.3/questions.yml create mode 100644 charts/adhoc-aeroo-docs/v0.1.3/templates/NOTES.txt create mode 100644 charts/adhoc-aeroo-docs/v0.1.3/templates/_helpers.tpl create mode 100644 charts/adhoc-aeroo-docs/v0.1.3/templates/deployment.yaml create mode 100644 charts/adhoc-aeroo-docs/v0.1.3/templates/hpa.yaml create mode 100644 charts/adhoc-aeroo-docs/v0.1.3/templates/ingress.yaml create mode 100644 charts/adhoc-aeroo-docs/v0.1.3/templates/service.yaml create mode 100644 charts/adhoc-aeroo-docs/v0.1.3/templates/serviceaccount.yaml create mode 100644 charts/adhoc-aeroo-docs/v0.1.3/templates/tests/test-connection.yaml create mode 100644 charts/adhoc-aeroo-docs/v0.1.3/values.yaml diff --git a/charts/adhoc-aeroo-docs/v0.1.3/Chart.yaml b/charts/adhoc-aeroo-docs/v0.1.3/Chart.yaml new file mode 100644 index 0000000..5689a0d --- /dev/null +++ b/charts/adhoc-aeroo-docs/v0.1.3/Chart.yaml @@ -0,0 +1,22 @@ +annotations: + category: DevOps +apiVersion: v2 +name: adhoc-aeroo-docs +description: A document conversion service (.odt to .pdf for reports) + +type: application + +version: 0.1.2 + +appVersion: "1.16.0" + +home: "https://github.com/adhoc-dev/helm-charts" +sources: + - "https://github.com/adhoc-dev/" +maintainers: + - name: dbollini + email: dib@adhoc.com.ar + - name: jjscarafia + email: jjs@adhoc.com.ar + +icon: "https://github.com/adhoc-dev/helm-charts/raw/master/img/aerooIcon.png" diff --git a/charts/adhoc-aeroo-docs/v0.1.3/questions.yml b/charts/adhoc-aeroo-docs/v0.1.3/questions.yml new file mode 100644 index 0000000..998a33b --- /dev/null +++ b/charts/adhoc-aeroo-docs/v0.1.3/questions.yml @@ -0,0 +1,9 @@ +questions: + +# NodeTag - Affinity + - variable: nodeTag + label: "Node tag for node affinity" + description: "Tag to schedule pods in nodes" + type: "string" + required: true + default: "Prod" diff --git a/charts/adhoc-aeroo-docs/v0.1.3/templates/NOTES.txt b/charts/adhoc-aeroo-docs/v0.1.3/templates/NOTES.txt new file mode 100644 index 0000000..931fff3 --- /dev/null +++ b/charts/adhoc-aeroo-docs/v0.1.3/templates/NOTES.txt @@ -0,0 +1,22 @@ +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 }} diff --git a/charts/adhoc-aeroo-docs/v0.1.3/templates/_helpers.tpl b/charts/adhoc-aeroo-docs/v0.1.3/templates/_helpers.tpl new file mode 100644 index 0000000..e0b922c --- /dev/null +++ b/charts/adhoc-aeroo-docs/v0.1.3/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "adhoc-aeroo.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "adhoc-aeroo.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "adhoc-aeroo.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "adhoc-aeroo.labels" -}} +helm.sh/chart: {{ include "adhoc-aeroo.chart" . }} +{{ include "adhoc-aeroo.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "adhoc-aeroo.selectorLabels" -}} +app.kubernetes.io/name: {{ include "adhoc-aeroo.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "adhoc-aeroo.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "adhoc-aeroo.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/adhoc-aeroo-docs/v0.1.3/templates/deployment.yaml b/charts/adhoc-aeroo-docs/v0.1.3/templates/deployment.yaml new file mode 100644 index 0000000..da0f879 --- /dev/null +++ b/charts/adhoc-aeroo-docs/v0.1.3/templates/deployment.yaml @@ -0,0 +1,68 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "adhoc-aeroo.fullname" . }} + labels: + {{- include "adhoc-aeroo.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "adhoc-aeroo.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "adhoc-aeroo.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "adhoc-aeroo.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 8989 + protocol: TCP + {{- with .Values.livenessProbe }} + livenessProbe: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.readinessProbe }} + readinessProbe: + {{- toYaml . | nindent 12 }} + {{- end }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: {{ .Values.nodeTag }} + operator: In + values: + - "true" + + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/adhoc-aeroo-docs/v0.1.3/templates/hpa.yaml b/charts/adhoc-aeroo-docs/v0.1.3/templates/hpa.yaml new file mode 100644 index 0000000..2c492ad --- /dev/null +++ b/charts/adhoc-aeroo-docs/v0.1.3/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "adhoc-aeroo.fullname" . }} + labels: + {{- include "adhoc-aeroo.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "adhoc-aeroo.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/charts/adhoc-aeroo-docs/v0.1.3/templates/ingress.yaml b/charts/adhoc-aeroo-docs/v0.1.3/templates/ingress.yaml new file mode 100644 index 0000000..4d3e484 --- /dev/null +++ b/charts/adhoc-aeroo-docs/v0.1.3/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "adhoc-aeroo.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else -}} +apiVersion: extensions/v1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "adhoc-aeroo.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/adhoc-aeroo-docs/v0.1.3/templates/service.yaml b/charts/adhoc-aeroo-docs/v0.1.3/templates/service.yaml new file mode 100644 index 0000000..472ec83 --- /dev/null +++ b/charts/adhoc-aeroo-docs/v0.1.3/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "adhoc-aeroo.fullname" . }} + labels: + {{- include "adhoc-aeroo.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "adhoc-aeroo.selectorLabels" . | nindent 4 }} diff --git a/charts/adhoc-aeroo-docs/v0.1.3/templates/serviceaccount.yaml b/charts/adhoc-aeroo-docs/v0.1.3/templates/serviceaccount.yaml new file mode 100644 index 0000000..8ce28c2 --- /dev/null +++ b/charts/adhoc-aeroo-docs/v0.1.3/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "adhoc-aeroo.serviceAccountName" . }} + labels: + {{- include "adhoc-aeroo.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/adhoc-aeroo-docs/v0.1.3/templates/tests/test-connection.yaml b/charts/adhoc-aeroo-docs/v0.1.3/templates/tests/test-connection.yaml new file mode 100644 index 0000000..91dfc28 --- /dev/null +++ b/charts/adhoc-aeroo-docs/v0.1.3/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "adhoc-aeroo.fullname" . }}-test-connection" + labels: + {{- include "adhoc-aeroo.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "adhoc-aeroo.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/charts/adhoc-aeroo-docs/v0.1.3/values.yaml b/charts/adhoc-aeroo-docs/v0.1.3/values.yaml new file mode 100644 index 0000000..94499e9 --- /dev/null +++ b/charts/adhoc-aeroo-docs/v0.1.3/values.yaml @@ -0,0 +1,95 @@ +# Default values for adhoc-aeroo. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: adhoc/aeroo-docs + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "latest" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + + +# livenessProbe: +# failureThreshold: 3 +# periodSeconds: 10 +# successThreshold: 1 +# tcpSocket: +# port: 8989 +# timeoutSeconds: 5 + +readinessProbe: + failureThreshold: 3 + periodSeconds: 10 + successThreshold: 2 + tcpSocket: + port: 8989 + timeoutSeconds: 5 + +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 + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeTag: "Prod" From 2de0be2c3ab7004184ea557c05b39ef04c6b06d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CAndres?= Date: Tue, 13 Aug 2024 15:33:14 -0300 Subject: [PATCH 2/2] [ADD] new version, hpa support and readinessProbe --- charts/adhoc-aeroo-docs/v0.1.3/Chart.yaml | 6 +- charts/adhoc-aeroo-docs/v0.1.3/questions.yml | 91 ++++++++++++++++++- .../v0.1.3/templates/NOTES.txt | 22 ----- .../v0.1.3/templates/deployment.yaml | 13 ++- .../v0.1.3/templates/hpa.yaml | 8 +- .../v0.1.3/templates/ingress.yaml | 61 ------------- .../v0.1.3/templates/service.yaml | 4 +- .../templates/tests/test-connection.yaml | 15 --- charts/adhoc-aeroo-docs/v0.1.3/values.yaml | 83 +++++++---------- 9 files changed, 146 insertions(+), 157 deletions(-) delete mode 100644 charts/adhoc-aeroo-docs/v0.1.3/templates/ingress.yaml delete mode 100644 charts/adhoc-aeroo-docs/v0.1.3/templates/tests/test-connection.yaml diff --git a/charts/adhoc-aeroo-docs/v0.1.3/Chart.yaml b/charts/adhoc-aeroo-docs/v0.1.3/Chart.yaml index 5689a0d..6308502 100644 --- a/charts/adhoc-aeroo-docs/v0.1.3/Chart.yaml +++ b/charts/adhoc-aeroo-docs/v0.1.3/Chart.yaml @@ -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: @@ -18,5 +18,7 @@ maintainers: email: dib@adhoc.com.ar - name: jjscarafia email: jjs@adhoc.com.ar + - name: azacchino + email: az@adhoc.com.ar icon: "https://github.com/adhoc-dev/helm-charts/raw/master/img/aerooIcon.png" diff --git a/charts/adhoc-aeroo-docs/v0.1.3/questions.yml b/charts/adhoc-aeroo-docs/v0.1.3/questions.yml index 998a33b..0694d10 100644 --- a/charts/adhoc-aeroo-docs/v0.1.3/questions.yml +++ b/charts/adhoc-aeroo-docs/v0.1.3/questions.yml @@ -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" \ No newline at end of file diff --git a/charts/adhoc-aeroo-docs/v0.1.3/templates/NOTES.txt b/charts/adhoc-aeroo-docs/v0.1.3/templates/NOTES.txt index 931fff3..e69de29 100644 --- a/charts/adhoc-aeroo-docs/v0.1.3/templates/NOTES.txt +++ b/charts/adhoc-aeroo-docs/v0.1.3/templates/NOTES.txt @@ -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 }} diff --git a/charts/adhoc-aeroo-docs/v0.1.3/templates/deployment.yaml b/charts/adhoc-aeroo-docs/v0.1.3/templates/deployment.yaml index da0f879..fbdc640 100644 --- a/charts/adhoc-aeroo-docs/v0.1.3/templates/deployment.yaml +++ b/charts/adhoc-aeroo-docs/v0.1.3/templates/deployment.yaml @@ -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 }} @@ -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 }} diff --git a/charts/adhoc-aeroo-docs/v0.1.3/templates/hpa.yaml b/charts/adhoc-aeroo-docs/v0.1.3/templates/hpa.yaml index 2c492ad..644be22 100644 --- a/charts/adhoc-aeroo-docs/v0.1.3/templates/hpa.yaml +++ b/charts/adhoc-aeroo-docs/v0.1.3/templates/hpa.yaml @@ -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 }} diff --git a/charts/adhoc-aeroo-docs/v0.1.3/templates/ingress.yaml b/charts/adhoc-aeroo-docs/v0.1.3/templates/ingress.yaml deleted file mode 100644 index 4d3e484..0000000 --- a/charts/adhoc-aeroo-docs/v0.1.3/templates/ingress.yaml +++ /dev/null @@ -1,61 +0,0 @@ -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "adhoc-aeroo.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} - {{- end }} -{{- end }} -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1 -{{- else -}} -apiVersion: extensions/v1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "adhoc-aeroo.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} - {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} - {{- end }} -{{- end }} diff --git a/charts/adhoc-aeroo-docs/v0.1.3/templates/service.yaml b/charts/adhoc-aeroo-docs/v0.1.3/templates/service.yaml index 472ec83..3ef1092 100644 --- a/charts/adhoc-aeroo-docs/v0.1.3/templates/service.yaml +++ b/charts/adhoc-aeroo-docs/v0.1.3/templates/service.yaml @@ -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 }} diff --git a/charts/adhoc-aeroo-docs/v0.1.3/templates/tests/test-connection.yaml b/charts/adhoc-aeroo-docs/v0.1.3/templates/tests/test-connection.yaml deleted file mode 100644 index 91dfc28..0000000 --- a/charts/adhoc-aeroo-docs/v0.1.3/templates/tests/test-connection.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: "{{ include "adhoc-aeroo.fullname" . }}-test-connection" - labels: - {{- include "adhoc-aeroo.labels" . | nindent 4 }} - annotations: - "helm.sh/hook": test -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ['{{ include "adhoc-aeroo.fullname" . }}:{{ .Values.service.port }}'] - restartPolicy: Never diff --git a/charts/adhoc-aeroo-docs/v0.1.3/values.yaml b/charts/adhoc-aeroo-docs/v0.1.3/values.yaml index 94499e9..eecccb6 100644 --- a/charts/adhoc-aeroo-docs/v0.1.3/values.yaml +++ b/charts/adhoc-aeroo-docs/v0.1.3/values.yaml @@ -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: "" @@ -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"