diff --git a/por/Chart.yaml b/por/Chart.yaml new file mode 100644 index 00000000..eb160324 --- /dev/null +++ b/por/Chart.yaml @@ -0,0 +1,21 @@ +apiVersion: v2 +name: orakl-por +description: A Helm chart for Kubernetes +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.0.1 +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "v0.0.1.20240424.0840.bae03fd" diff --git a/por/templates/deployment.yaml b/por/templates/deployment.yaml new file mode 100644 index 00000000..41299342 --- /dev/null +++ b/por/templates/deployment.yaml @@ -0,0 +1,100 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.deployment.name }} + labels: + app: {{ .Values.deployment.name }} + app.kubernetes.io/name: {{ .Values.deployment.name }} + app.kubernetes.io/instance: {{ .Values.deployment.name }} +spec: + replicas: {{ .Values.por.replicas }} + selector: + matchLabels: + app: {{ .Values.deployment.name }} + app.kubernetes.io/name: {{ .Values.deployment.name }} + app.kubernetes.io/instance: {{ .Values.deployment.name }} + template: + metadata: + {{- with .Values.global.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + app: {{ .Values.deployment.name }} + app.kubernetes.io/name: {{ .Values.deployment.name }} + app.kubernetes.io/instance: {{ .Values.deployment.name }} + spec: + {{- with .Values.global.image.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + + securityContext: + {{- toYaml .Values.por.podSecurityContext | nindent 8 }} + {{- if .Values.global.affinity.enabled }} + affinity: + nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 1 + preference: + matchExpressions: + - key: {{ .Values.global.affinity.key }} + operator: In + values: + - {{ .Values.global.affinity.value }} + {{- end }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.por.containerSecurityContext | nindent 12 }} + image: "{{ .Values.global.image.repository }}:{{ .Values.global.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.global.image.pullPolicy }} + env: + - name: POR_REPORTER_PK + valueFrom: + secretKeyRef: + name: por-secrets + key: POR_REPORTER_PK + - name: POR_PROVIDER_URL + value: "http://10.148.4.194:8551" + - name: POR_PORT + value: "3000" + - name: POR_CHAIN + value: "cypress" + ports: + - name: http + containerPort: 3000 + protocol: TCP + {{- if .Values.global.livenessProbe.enabled }} + livenessProbe: + httpGet: + path: {{ .Values.global.livenessProbe.path }} + port: 3000 + initialDelaySeconds: {{ .Values.global.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.global.livenessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.global.livenessProbe.timeoutSeconds }} + successThreshold: {{ .Values.global.livenessProbe.successThreshold }} + failureThreshold: {{ .Values.global.livenessProbe.failureThreshold }} + {{- end }} + {{- if .Values.global.readinessProbe.enabled }} + readinessProbe: + httpGet: + path: {{ .Values.global.readinessProbe.path }} + port: 3000 + initialDelaySeconds: {{ .Values.global.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.global.readinessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.global.readinessProbe.timeoutSeconds }} + successThreshold: {{ .Values.global.readinessProbe.successThreshold }} + failureThreshold: {{ .Values.global.readinessProbe.failureThreshold }} + {{- end }} + resources: + {{- toYaml .Values.por.resources | nindent 12 }} + + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/por/templates/service.yaml b/por/templates/service.yaml new file mode 100644 index 00000000..d509c702 --- /dev/null +++ b/por/templates/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.deployment.name }} +spec: + ports: + - port: 3000 + targetPort: http + protocol: TCP + selector: + app: {{ .Values.deployment.name }} diff --git a/por/values.yaml b/por/values.yaml new file mode 100644 index 00000000..c5a4fe45 --- /dev/null +++ b/por/values.yaml @@ -0,0 +1,56 @@ +## Klaytn Orakl POR Configuration +## created by Bisonai + +global: + name: por + namespace: orakl + image: + repository: public.ecr.aws/bisonai/orakl-por #repository url + pullPolicy: IfNotPresent + tag: "v0.0.1.20240424.0840.bae03fd" + imagePullPolicy: IfNotPresent + # -- If defined, uses a Secret to pull an image from a private Docker registry or repository + imagePullSecrets: [] + secretManager: + enabled: true + secretId: + versionId: + affinity: + enabled: false + key: kubernetes.io/hostname + value: + podAnnotations: + livenessProbe: + enabled: true + path: /api/v1/ + initialDelaySeconds: 10 + periodSeconds: 5 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 5 + readinessProbe: + enabled: true + path: /api/v1/ + initialDelaySeconds: 10 + periodSeconds: 5 + timeoutSeconds: 1 + successThreshold: 1 + failureThreshold: 5 +por: + enabled: true + replicas: 1 + podSecurityContext: {} + containerSecurityContext: {} + resources: + limits: + cpu: 500m + memory: 1Gi + requests: + cpu: 500m + memory: 1Gi +nodeSelector: {} +tolerations: [] +dotenv: {} +deployment: + name: orakl-por + replicas: 1 diff --git a/secret-store/por-secret.yaml b/secret-store/por-secret.yaml new file mode 100644 index 00000000..4985da74 --- /dev/null +++ b/secret-store/por-secret.yaml @@ -0,0 +1,14 @@ +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: por-secrets +spec: + refreshInterval: "15s" + secretStoreRef: + name: vault-backend + kind: SecretStore + data: + - secretKey: POR_REPORTER_PK + remoteRef: + key: baobab/por + property: POR_REPORTER_PK