Skip to content

Commit

Permalink
Merge pull request #55 from keephq/feature/gke
Browse files Browse the repository at this point in the history
feat: gke
  • Loading branch information
shahargl authored Oct 13, 2024
2 parents 15cf88e + 3c9982f commit f142c5e
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 39 deletions.
2 changes: 1 addition & 1 deletion charts/keep/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: keep
version: 0.1.20
version: 0.1.21
description: Keep Helm Chart
type: application
icon: https://platform.keephq.dev/_next/image?url=%2Fkeep.png&w=48&q=75
Expand Down
4 changes: 4 additions & 0 deletions charts/keep/templates/backend-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ metadata:
labels:
{{- include "keep.labels" . | nindent 4 }}
keep-component: backend-service
annotations:
{{- if .Values.isGKE }}
cloud.google.com/backend-config: '{"default": "{{ include "keep.fullname" . }}-backend-backendconfig"}'
{{- end }}
spec:
type: {{ .Values.backend.service.type }}
ports:
Expand Down
2 changes: 1 addition & 1 deletion charts/keep/templates/db-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ spec:
resources:
requests:
storage: {{ .Values.database.pvc.size }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/keep/templates/frontend-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ spec:
{{- if .Values.frontend.extraIngress -}}
{{ toYaml .Values.frontend.extraIngress | nindent 2 }}
{{- end }}
{{- end }}
{{- end }}
6 changes: 5 additions & 1 deletion charts/keep/templates/frontend-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ metadata:
labels:
{{- include "keep.labels" . | nindent 4 }}
keep-component: frontend-service
annotations:
{{- if .Values.isGKE }}
cloud.google.com/backend-config: '{"default": "{{ include "keep.fullname" . }}-frontend-backendconfig"}'
{{- end }}
spec:
type: {{ .Values.frontend.service.type }}
ports:
Expand All @@ -22,4 +26,4 @@ spec:
selector:
{{- include "keep.selectorLabels" . | nindent 4 }}
keep-component: frontend
{{- end}}
{{- end }}
16 changes: 16 additions & 0 deletions charts/keep/templates/gke/backend-gke-healthcheck-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if .Values.isGKE -}}
apiVersion: cloud.google.com/v1
kind: BackendConfig
metadata:
name: {{ include "keep.fullname" . }}-backend-backendconfig
namespace: {{ .Release.Namespace }}
spec:
healthCheck:
checkIntervalSec: {{ .Values.frontend.backendConfig.healthCheck.checkIntervalSec }}
timeoutSec: {{ .Values.backend.backendConfig.healthCheck.timeoutSec }}
healthyThreshold: {{ .Values.backend.backendConfig.healthCheck.healthyThreshold }}
unhealthyThreshold: {{ .Values.backend.backendConfig.healthCheck.unhealthyThreshold }}
requestPath: {{ .Values.backend.backendConfig.healthCheck.path }}
port: {{ .Values.backend.backendConfig.healthCheck.port }}
type: {{ .Values.backend.backendConfig.healthCheck.type }}
{{- end }}
16 changes: 16 additions & 0 deletions charts/keep/templates/gke/frontend-gke-healthcheck-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if .Values.isGKE -}}
apiVersion: cloud.google.com/v1
kind: BackendConfig
metadata:
name: {{ include "keep.fullname" . }}-frontend-backendconfig
namespace: {{ .Release.Namespace }}
spec:
healthCheck:
checkIntervalSec: {{ .Values.frontend.backendConfig.healthCheck.checkIntervalSec }}
timeoutSec: {{ .Values.frontend.backendConfig.healthCheck.timeoutSec }}
healthyThreshold: {{ .Values.frontend.backendConfig.healthCheck.healthyThreshold }}
unhealthyThreshold: {{ .Values.frontend.backendConfig.healthCheck.unhealthyThreshold }}
requestPath: {{ .Values.frontend.backendConfig.healthCheck.path }}
port: {{ .Values.frontend.backendConfig.healthCheck.port }}
type: {{ .Values.frontend.backendConfig.healthCheck.type }}
{{- end }}
83 changes: 48 additions & 35 deletions charts/keep/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ serviceAccount:
name: ""
nameOverride: ""
fullnameOverride: ""
isGKE: false

backend:
# if true, the backend will be enabled
Expand All @@ -25,8 +26,6 @@ backend:
value: k8s
- name: PORT
value: "8080"
- name: SECRET_MANAGER_DIRECTORY
value: /state
- name: PUSHER_APP_ID
value: 1
- name: PUSHER_APP_KEY
Expand Down Expand Up @@ -68,6 +67,16 @@ backend:
path: /
tls: []
wildcardPolicy: None
# GKE healthcheck config
backendConfig:
healthCheck:
checkIntervalSec: 30
timeoutSec: 10
healthyThreshold: 1
unhealthyThreshold: 3
path: "/docs"
port: 8080
type: HTTP
resources: {}
autoscaling:
enabled: false
Expand Down Expand Up @@ -99,10 +108,12 @@ frontend:
value: secret
- name: NEXTAUTH_URL
value: http://localhost:3000
# Shahar: took me whole day to figure out that I need to set this to 1
# https://github.com/nextauthjs/next-auth/issues/600
- name: VERCEL
value: 1
- name: API_URL
value: http://keep-backend:8080
- name: NEXT_PUBLIC_API_URL
value: ""
- name: NEXT_PUBLIC_POSTHOG_KEY
value: "phc_muk9qE3TfZsX3SZ9XxX52kCGJBclrjhkP9JxAQcm1PZ"
- name: NEXT_PUBLIC_POSTHOG_HOST
Expand Down Expand Up @@ -139,17 +150,26 @@ frontend:
className: ""
annotations: {}
hosts:
- host: chart-example.local
paths:
- paths:
- path: /
pathType: ImplementationSpecific
pathType: Prefix
tls: []
route:
enabled: false
host: chart-example.local
path: /
tls: []
wildcardPolicy: None
# GKE healthcheck config
backendConfig:
healthCheck:
checkIntervalSec: 30
timeoutSec: 10
healthyThreshold: 1
unhealthyThreshold: 3
path: "/signin"
port: 3000
type: HTTP
resources: {}
autoscaling:
enabled: false
Expand Down Expand Up @@ -199,26 +219,6 @@ websocket:
service:
type: ClusterIP
port: 6001
ingress:
enabled: true
className: ""
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/enable-websocket: "true"
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
hosts:
- host: websocket.example.local
paths:
- path: /
pathType: ImplementationSpecific
tls: []
route:
enabled: false
host: websocket.example.local
path: /
tls: []
wildcardPolicy: None
resources: {}
autoscaling:
enabled: false
Expand All @@ -233,15 +233,28 @@ websocket:
enabled: false
probes:
livenessProbe:
tcpSocket:
port: 6001
initialDelaySeconds: 30
periodSeconds: 10
httpGet:
path: /
port: http
readinessProbe:
tcpSocket:
port: 6001
initialDelaySeconds: 30
periodSeconds: 10
httpGet:
path: /
port: http
ingress:
enabled: false
className: "nginx"
hosts:
- host: chart-example-websocket.local
paths:
- path: /
pathType: Prefix
tls: []
annotations: {}
route:
enabled: false
host: chart-example.local
wildcardPolicy: None
tls: []

database:
enabled: true
Expand Down

0 comments on commit f142c5e

Please sign in to comment.