diff --git a/charts/keep/Chart.yaml b/charts/keep/Chart.yaml index 96aa116..b8cda33 100644 --- a/charts/keep/Chart.yaml +++ b/charts/keep/Chart.yaml @@ -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 diff --git a/charts/keep/templates/backend-service.yaml b/charts/keep/templates/backend-service.yaml index 570b4f3..7c7cac3 100644 --- a/charts/keep/templates/backend-service.yaml +++ b/charts/keep/templates/backend-service.yaml @@ -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: diff --git a/charts/keep/templates/db-pvc.yaml b/charts/keep/templates/db-pvc.yaml index 5f8b4a3..6ab6274 100644 --- a/charts/keep/templates/db-pvc.yaml +++ b/charts/keep/templates/db-pvc.yaml @@ -10,4 +10,4 @@ spec: resources: requests: storage: {{ .Values.database.pvc.size }} -{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/keep/templates/frontend-ingress.yaml b/charts/keep/templates/frontend-ingress.yaml index f6bf0f0..c113f3f 100644 --- a/charts/keep/templates/frontend-ingress.yaml +++ b/charts/keep/templates/frontend-ingress.yaml @@ -61,4 +61,4 @@ spec: {{- if .Values.frontend.extraIngress -}} {{ toYaml .Values.frontend.extraIngress | nindent 2 }} {{- end }} -{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/keep/templates/frontend-service.yaml b/charts/keep/templates/frontend-service.yaml index 2800e19..7908ac0 100644 --- a/charts/keep/templates/frontend-service.yaml +++ b/charts/keep/templates/frontend-service.yaml @@ -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: @@ -22,4 +26,4 @@ spec: selector: {{- include "keep.selectorLabels" . | nindent 4 }} keep-component: frontend -{{- end}} +{{- end }} diff --git a/charts/keep/templates/gke/backend-gke-healthcheck-config.yaml b/charts/keep/templates/gke/backend-gke-healthcheck-config.yaml new file mode 100644 index 0000000..3767863 --- /dev/null +++ b/charts/keep/templates/gke/backend-gke-healthcheck-config.yaml @@ -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 }} \ No newline at end of file diff --git a/charts/keep/templates/gke/frontend-gke-healthcheck-config.yaml b/charts/keep/templates/gke/frontend-gke-healthcheck-config.yaml new file mode 100644 index 0000000..09afffe --- /dev/null +++ b/charts/keep/templates/gke/frontend-gke-healthcheck-config.yaml @@ -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 }} \ No newline at end of file diff --git a/charts/keep/values.yaml b/charts/keep/values.yaml index d11e5df..dd4cc31 100644 --- a/charts/keep/values.yaml +++ b/charts/keep/values.yaml @@ -5,6 +5,7 @@ serviceAccount: name: "" nameOverride: "" fullnameOverride: "" +isGKE: false backend: # if true, the backend will be enabled @@ -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 @@ -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 @@ -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 @@ -139,10 +150,9 @@ frontend: className: "" annotations: {} hosts: - - host: chart-example.local - paths: + - paths: - path: / - pathType: ImplementationSpecific + pathType: Prefix tls: [] route: enabled: false @@ -150,6 +160,16 @@ frontend: 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 @@ -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 @@ -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