From 6ea91fdfe664ce5bc959a8f732da456ec58253ba Mon Sep 17 00:00:00 2001 From: Aswin <43544673+Aswin-ElMagnifico@users.noreply.github.com> Date: Wed, 29 Nov 2023 15:54:00 +0530 Subject: [PATCH] Helm charts for challenger --- .helmignore | 23 +++++++ Chart.yaml | 6 ++ pob-challenger-0.1.0.tgz | Bin 0 -> 3990 bytes templates/NOTES.txt | 22 ++++++ templates/_helpers.tpl | 62 +++++++++++++++++ templates/deployment.yaml | 72 ++++++++++++++++++++ templates/hpa.yaml | 32 +++++++++ templates/ingress.yaml | 61 +++++++++++++++++ templates/service.yaml | 15 ++++ templates/serviceaccount.yaml | 13 ++++ templates/tests/test-connection.yaml | 15 ++++ values.yaml | 98 +++++++++++++++++++++++++++ 12 files changed, 419 insertions(+) create mode 100644 .helmignore create mode 100644 Chart.yaml create mode 100644 pob-challenger-0.1.0.tgz create mode 100644 templates/NOTES.txt create mode 100644 templates/_helpers.tpl create mode 100644 templates/deployment.yaml create mode 100644 templates/hpa.yaml create mode 100644 templates/ingress.yaml create mode 100644 templates/service.yaml create mode 100644 templates/serviceaccount.yaml create mode 100644 templates/tests/test-connection.yaml create mode 100644 values.yaml diff --git a/.helmignore b/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/Chart.yaml b/Chart.yaml new file mode 100644 index 0000000..82dcf9b --- /dev/null +++ b/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +appVersion: 1.16.0 +description: A Helm chart for Kubernetes +name: pob-challenger +type: application +version: 0.1.0 diff --git a/pob-challenger-0.1.0.tgz b/pob-challenger-0.1.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..a972edbd917bca6de854c02d82d9233961ac5071 GIT binary patch literal 3990 zcmV;H4{7ipiwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PH+zbKAI*^L672{qsBa9)RqU@i{h}6M? zBFRbE43C0=7o&HjCvOe;pA(j$x?=^fLH-Z+5BHk# zzdzi6kpKH=JMao8Bx4%f(p#afZ;HU%fr}YcKot=9<@oKJ-bBcRXpJ#UC_~fX6-JCm zggKFvj2SA>0>%g_Q3_+ATnku;OoGNFWkjP2JWrxk3nwDuI)tI;(S%Gf^Z+ELLQyT` zB7`fdIVu&+2<81$j6YV?3qYDNHWG|Rix7_46&; zaXx42UORPG>b}4O(>Vm+QmXx&vQfs^IYtt-3gOq^ti~%4h2Z<%Bx7vtp{G#JX@tj7 zWG8CrJ5Mp96N(D1W~gTL>OB@ zVh0j9uc3UT;COUu#>U7sB~1ON2SCh7$NCZ)=R#XOZ5NQlvH53s)F94`FZ+hDys_gi zW(bA>ASP|246saLVEdjGqXz~GkgZb0ip_~$Wfa4L#8O7TEGRTSNq8W za0bY5JQeYAgSu42Z^#&#yEC`v7-f>`#fjh=uk~sU6ZNAMSsKFLU@$PN*WN86DH&5n zHAUst6d;x&Ev|cT{N|0lmPq1voGso9q5qpQR12jssc>Cp{8*g{ZaOp{|Ey4kFw9A@ z+%y=RT|E;qj)XL;kqW6pcrkb}@I1<=5|yP2xsk>=gb88FfQ=YY>a5^Y+bSB=mn*X# zP|?rf1$Jx*d`kIsYe&sgk3<%>nT3Hr6G~f33`fjO=)|pu*Ca_9224bR+4le`(X+g> z8(L}$RL)-2y!1u4%! zWzo!_e@i(v%NZEST!;)}0at|AW>OiJaW`A-mCU@)*oLrzhjjDG%EQ%3)^8*_v*GMjXY zMm#NU*X^yv-`&&Of#W!)<_%#m7c5IqnT0hR6PZpk4X-d|VqsSy#tG%Nci`ontrYA) zFV~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pPeS-j7>(xSAn{aYk88`4mzTU6LuP)$c&5 zEVceNs2MT_Qzpi)T9WeVGmyxLrgOB>pUQK>V{ZpIPTd#gk5h>gdX2F&)BpM;fOniN zKyW+KkOV18`%@x;7rZ+Ec&>#+ZwK=47CxMuLrkUef+^K~``3~01>-+u-~KHg%%*+w zr?^#f-Y)@-NpzW|_Lr=b_cTyfsrNJ(lS}Vupc8W~B%OLs|Hs>b4@6RtDL8%gT6sY# w#qSttFQ74!zUwZ=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/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "pob-challenger.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/templates/service.yaml b/templates/service.yaml new file mode 100644 index 0000000..756a6ec --- /dev/null +++ b/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "pob-challenger.fullname" . }} + labels: + {{- include "pob-challenger.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "pob-challenger.selectorLabels" . | nindent 4 }} diff --git a/templates/serviceaccount.yaml b/templates/serviceaccount.yaml new file mode 100644 index 0000000..e75ab0b --- /dev/null +++ b/templates/serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "pob-challenger.serviceAccountName" . }} + labels: + {{- include "pob-challenger.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} +{{- end }} diff --git a/templates/tests/test-connection.yaml b/templates/tests/test-connection.yaml new file mode 100644 index 0000000..603a9d9 --- /dev/null +++ b/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "pob-challenger.fullname" . }}-test-connection" + labels: + {{- include "pob-challenger.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "pob-challenger.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/values.yaml b/values.yaml new file mode 100644 index 0000000..1d6f5b8 --- /dev/null +++ b/values.yaml @@ -0,0 +1,98 @@ +# Default values for pob-challenger. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: witnesschain/pob_challenger + pullPolicy: Always + # 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 + # Automatically mount a ServiceAccount's API credentials? + automount: 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: {} +podLabels: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: NodePort + port: 8080 + +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 + +# Additional volumes on the output Deployment definition. +volumes: [] +# - name: foo +# secret: +# secretName: mysecret +# optional: false + +# Additional volumeMounts on the output Deployment definition. +volumeMounts: [] +# - name: foo +# mountPath: "/etc/foo" +# readOnly: true + +nodeSelector: {} + +tolerations: [] + +affinity: {}