Skip to content

Commit

Permalink
feat: por for cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-bisonai committed Apr 24, 2024
1 parent 10bde86 commit cf3a407
Show file tree
Hide file tree
Showing 5 changed files with 202 additions and 0 deletions.
21 changes: 21 additions & 0 deletions por/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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"
100 changes: 100 additions & 0 deletions por/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
11 changes: 11 additions & 0 deletions por/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
56 changes: 56 additions & 0 deletions por/values.yaml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions secret-store/por-secret.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit cf3a407

Please sign in to comment.