Skip to content

Commit

Permalink
feat: add consent to galoy chart
Browse files Browse the repository at this point in the history
  • Loading branch information
bodymindarts committed Oct 16, 2023
1 parent c4ced89 commit 9191b24
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 0 deletions.
8 changes: 8 additions & 0 deletions charts/galoy/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
{{- default "trigger" .Values.galoy.trigger.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified consent name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "galoy.consent.fullname" -}}
{{- default "consent" .Values.galoy.consent.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
CronJob name
*/}}
Expand Down
52 changes: 52 additions & 0 deletions charts/galoy/templates/consent-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "galoy.consent.fullname" . }}
labels:
app: {{ template "galoy.consent.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
app.kubernetes.io/managed-by: Helm

kube-monkey/enabled: enabled
kube-monkey/identifier: {{ template "galoy.trigger.fullname" . }}
kube-monkey/kill-mode: fixed
kube-monkey/kill-value: "1"
kube-monkey/mtbf: "8"
spec:
selector:
matchLabels:
app: {{ template "galoy.consent.fullname" . }}
release: {{ .Release.Name }}
replicas: {{ .Values.galoy.consent.replicas }}
template:
metadata:
labels:
app: {{ template "galoy.consent.fullname" . }}
release: "{{ .Release.Name }}"
kube-monkey/enabled: enabled
kube-monkey/identifier: {{ template "galoy.trigger.fullname" . }}
spec:
serviceAccountName: {{ template "galoy.name" . }}
containers:
- name: consent
image: "{{ .Values.galoy.images.consent.repository }}@{{ .Values.galoy.images.consent.digest }}"
resources:
{{- toYaml .Values.resources | nindent 10 }}
ports:
- name: http
containerPort: {{ .Values.galoy.consent.port }}
protocol: TCP
env:
- name: PORT
value: "{{ .Values.galoy.consent.port }}"
- name: GRAPHQL_PUBLIC_API
value: {{ .Values.galoy.consent.graphqlPublicApi }}
- name: CORE_AUTH_URL
value: {{ .Values.galoy.consent.coreAuthUrl }}
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: {{ .Values.tracing.otelExporterOtlpEndpoint }}
- name: TRACING_SERVICE_NAME
value: "{{ .Values.tracing.prefix }}-{{ template "galoy.consent.fullname" . }}"
- name: HYDRA_ADMIN_URL
value: {{ .Values.galoy.consent.hydraAdminUrl }}
48 changes: 48 additions & 0 deletions charts/galoy/templates/consent-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{{- if .Values.galoy.consent.ingress.enabled -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "galoy.consent.fullname" . }}
labels:
app: {{ template "galoy.consent.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
app.kubernetes.io/managed-by: Helm
annotations:
cert-manager.io/cluster-issuer: {{ .Values.galoy.consent.ingress.clusterIssuer }}
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600" # 1 hour
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" # 1 hour
nginx.ingress.kubernetes.io/proxy-connect-timeout: "1s"
nginx.ingress.kubernetes.io/proxy-next-upstream: "error timeout"
nginx.ingress.kubernetes.io/proxy-next-upstream-tries: "3"
nginx.ingress.kubernetes.io/limit-rpm: "10"
nginx.ingress.kubernetes.io/limit-burst-multiplier: "2"
nginx.ingress.kubernetes.io/limit-connections: "10"
{{- with .Values.galoy.consent.ingress.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ingressClassName: nginx
tls:
{{- range .Values.galoy.consent.ingress.hosts }}
- hosts:
- {{ . }}
secretName: {{ printf "%s-tls" . }}
{{- end }}
rules:
{{- range .Values.galoy.consent.ingress.hosts }}
- host: {{ . }}
http:
paths:
{{- if $.Values.galoy.consent.ingress.extraPaths }}
{{- toYaml $.Values.galoy.consent.ingress.extraPaths | nindent 10 }}
{{- end }}
- pathType: ImplementationSpecific
path: /
backend:
service:
name: {{ template "galoy.consent.fullname" $ }}
port:
number: {{ $.Values.galoy.consent.port }}
{{- end -}}
{{- end -}}
18 changes: 18 additions & 0 deletions charts/galoy/templates/consent-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "galoy.consent.fullname" . }}
labels:
app: {{ template "galoy.consent.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
app.kubernetes.io/managed-by: Helm
spec:
type: {{ .Values.galoy.consent.serviceType }}
ports:
- port: {{ .Values.galoy.consent.port }}
targetPort: {{ .Values.galoy.consent.port }}
protocol: TCP
name: http
selector:
app: {{ template "galoy.consent.fullname" . }}
16 changes: 16 additions & 0 deletions charts/galoy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ galoy:
## Digest of the image
##
digest: "sha256:aa16b25de59adef5b13b391394c9b637ce79c64e20ca36d0798968b5028a08d2"
consent:
repository: us.gcr.io/galoy-org/galoy-consent
## Digest of the image
##
digest: "sha256:f0a9190ad0b1f4accddc938c7ebd08ee7e9006011864d68cc1ad4aae6451ac46"
## Galoy Application MongoDB Migration Image details
##
mongodbMigrate:
Expand Down Expand Up @@ -381,6 +386,17 @@ galoy:
failureThreshold: 5
successThreshold: 2
timeoutSeconds: 1
consent:
resources: {}
port: 80
graphqlPublicApi: http://galoy-oathkeeper-proxy/graphql
coreAuthUrl: http://galoy-oathkeeper-proxy/auth
hydraAdminUrl: http://galoy-hydra-admin:4445
ingress:
enabled: false
hosts: [consent.staging.galoy.io]
clusterIssuer: letsencrypt-issuer
tlsSecretName: websocket-tls
mongoBackupCron:
resources: {}
galoyCron:
Expand Down
2 changes: 2 additions & 0 deletions dev/.envrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
use flake ..

export KUBE_CONFIG_PATH=~/.kube/config
export KUBE_CTX=k3d-k3s-default

0 comments on commit 9191b24

Please sign in to comment.