supabase-community / supabase-kubernetes

Helm 3 charts to deploy a Supabase on Kubernetes
Apache License 2.0
452 stars 119 forks source link

Supabase auth and realtime pod is in crashloop #86

Open sagarshrestha24 opened 1 month ago

sagarshrestha24 commented 1 month ago

Bug report

Supabase auth and realtime pod is in crashloop

Describe the bug

After doing a fresh helm install: helm -n default install MY-RELEASE -f values.yaml . I get a CrashLoopBackOff from the supabase-auth pod (also tried values.example.yaml)

[POP] 2023/02/08 01:10:15 info - 0.0140 seconds
time="2023-02-08T01:10:15Z" level=fatal msg="running db migrations: Migrator: problem creating schema migrations: CREATE TABLE \"schema_migrations\" (\n\"version\" VARCHAR (14) NOT NULL\n);\nCREATE UNIQUE INDEX \"schema_migrations_version_idx\" ON \"schema_migrations\" (version);: ERROR: no schema has been selected to create in (SQLSTATE 3F000)"

I have install postgresql from crunchy operator and database is up and running.I'm only getting a crashloopbackoff on supabase-auth and supabase-realtime. Realtime kicks out because of supabase-auth.

Here is the values manifest file

auth:
  # Enable auth provisioning
  enabled: true
  image:
    repository: supabase/gotrue
    pullPolicy: Always
    tag: "v2.162.2"
  imagePullSecrets: []
  replicaCount: 1
  nameOverride: ""
  fullnameOverride: ""
  livenessProbe: {}
  readinessProbe: {}
  serviceAccount:
    # Specifies whether a service account should be created
    create: true
    # Annotations to add to the service account
    annotations: {}
    # The name of the service account to use.
    # If not set and create is true, a name is generated using the fullname template
    name: ""
  podAnnotations: {}
  podSecurityContext: {}
    # fsGroup: 2000
  securityContext: {}
    # capabilities:
    #   drop:
    #   - ALL
    # readOnlyRootFilesystem: true
    # runAsNonRoot: true
    # runAsUser: 1000
  service:
    type: ClusterIP
    port: 9999
  environment:
    # Override the database hostname if using external database
    DB_HOST: hippo-primary.postgres-operator.svc
    DB_USER: hippo
    DB_PORT: 5432
    DB_DRIVER: postgres
    DB_SSL: disable
    API_EXTERNAL_URL: http://example.com
    GOTRUE_API_HOST: "0.0.0.0"
    GOTRUE_API_PORT: "9999"
    GOTRUE_SITE_URL: http://example.com
    GOTRUE_URI_ALLOW_LIST: "*"
    GOTRUE_DISABLE_SIGNUP: "false"
    GOTRUE_JWT_DEFAULT_GROUP_NAME: authenticated
    GOTRUE_JWT_ADMIN_ROLES: service_role
    GOTRUE_JWT_AUD: authenticated
    GOTRUE_JWT_EXP: "3600"
    GOTRUE_EXTERNAL_EMAIL_ENABLED: "true"
    GOTRUE_MAILER_AUTOCONFIRM: "true"
    GOTRUE_SMTP_ADMIN_EMAIL: "sagar.shrestha@berrybytes.com"
    GOTRUE_SMTP_HOST: "smtp.gmail.com"
    GOTRUE_SMTP_PORT: 587
    GOTRUE_SMTP_SENDER_NAME: "sagar"
    GOTRUE_EXTERNAL_PHONE_ENABLED: "false"
    GOTRUE_SMS_AUTOCONFIRM: "false"
    GOTRUE_MAILER_URLPATHS_INVITE: "/auth/v1/verify"
    GOTRUE_MAILER_URLPATHS_CONFIRMATION: "/auth/v1/verify"
    GOTRUE_MAILER_URLPATHS_RECOVERY: "/auth/v1/verify"
    GOTRUE_MAILER_URLPATHS_EMAIL_CHANGE: "/auth/v1/verify"
  envFrom: []
    # - secretRef:
    #     name: env-secret
  # volumeMounts:
  #   - name: volume_name
  #     mountPath: /path/to/my/secret
  # volumes:
  #   - name: volume_name
  #     secret:
  #       defaultMode: 733
  #       secretName: my_secret
  #       items:
  #       - key: my_secret.txt
  #         path: name_of_file_in_container.txt
  resources: {}
    # We usually recommend not to specify default resources and to leave this as a conscious
    # choice for the user. This also increases chances charts run on environments with little
    # resources, such as Minikube. If you do want to specify resources, uncomment the following
    # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
    # limits:
    #   cpu: 100m
    #   memory: 128Mi
    # requests:
    #   cpu: 100m
    #   memory: 128Mi
  autoscaling:
    enabled: true
    minReplicas: 1
    maxReplicas: 100
    targetCPUUtilizationPercentage: 80
    # targetMemoryUtilizationPercentage: 80
  nodeSelector: {}
  tolerations: []
  affinity: {}

# Rest Service
rest:
  # Enable postgrest provisioning
  enabled: false
  image:
    repository: postgrest/postgrest
    pullPolicy: IfNotPresent
    tag: "latest"
  imagePullSecrets: []
  nameOverride: ""
  fullnameOverride: ""
  livenessProbe: {}
  readinessProbe: {}
  serviceAccount:
    # Specifies whether a service account should be created
    create: true
    # Annotations to add to the service account
    annotations: {}
    # The name of the service account to use.
    # If not set and create is true, a name is generated using the fullname template
    name: ""
  podAnnotations: {}
  podSecurityContext: {}
    # fsGroup: 2000
  securityContext: {}
    # capabilities:
    #   drop:
    #   - ALL
    # readOnlyRootFilesystem: true
    # runAsNonRoot: true
    # runAsUser: 1000
  service:
    type: ClusterIP
    port: 3000
  environment:
    # Override the database hostname if using external database
    DB_HOST: hippo-primary.postgres-operator.svc.cluster.local
    DB_USER: authenticator
    DB_PORT: 5432
    DB_DRIVER: postgres
    DB_SSL: disable  # disable, allow, prefer, require, verify-ca, verify-full
    PGRST_DB_SCHEMAS: public,storage,graphql_public
    PGRST_DB_ANON_ROLE: anon
    PGRST_DB_USE_LEGACY_GUCS: false
    PGRST_APP_SETTINGS_JWT_EXP: 3600
  # volumeMounts:
  #   - name: volume_name
  #     mountPath: /path/to/my/secret
  # volumes:
  #   - name: volume_name
  #     secret:
  #       defaultMode: 733
  #       secretName: my_secret
  #       items:
  #       - key: my_secret.txt
  #         path: name_of_file_in_container.txt
  resources: {}
    # We usually recommend not to specify default resources and to leave this as a conscious
    # choice for the user. This also increases chances charts run on environments with little
    # resources, such as Minikube. If you do want to specify resources, uncomment the following
    # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
    # limits:
    #   cpu: 100m
    #   memory: 128Mi
    # requests:
    #   cpu: 100m
    #   memory: 128Mi
  autoscaling:
    enabled: true
    minReplicas: 1
    maxReplicas: 100
    targetCPUUtilizationPercentage: 80
    # targetMemoryUtilizationPercentage: 80
  nodeSelector: {}
  tolerations: []
  affinity: {}

# Realtime Service
realtime:
  # Enable realtime provisioning
  enabled: false
  image:
    repository: supabase/realtime
    pullPolicy: IfNotPresent
    tag: "latest"
  imagePullSecrets: []
  nameOverride: ""
  fullnameOverride: ""
  livenessProbe: {}
  readinessProbe: {}
  serviceAccount:
    # Specifies whether a service account should be created
    create: true
    # Annotations to add to the service account
    annotations: {}
    # The name of the service account to use.
    # If not set and create is true, a name is generated using the fullname template
    name: ""
  podAnnotations: {}
  podSecurityContext: {}
    # fsGroup: 2000
  securityContext: {}
    # capabilities:
    #   drop:
    #   - ALL
    # readOnlyRootFilesystem: true
    # runAsNonRoot: true
    # runAsUser: 1000
  service:
    type: ClusterIP
    port: 4000
  environment:
    # Override the database hostname if using external database
    DB_HOST: hippo-primary.postgres-operator.svc.cluster.local
    DB_USER: supabase_admin
    DB_PORT: 5432
    DB_SSL: disable  # disable, allow, prefer, require, verify-ca, verify-full
    DB_AFTER_CONNECT_QUERY: "SET search_path TO _realtime"
    DB_ENC_KEY: supabaserealtime
    PORT: "4000"
    FLY_ALLOC_ID: fly123
    FLY_APP_NAME: realtime
    SECRET_KEY_BASE: UpNVntn3cDxHJpq99YMc1T1AQgQpc8kfYTuRgBiYa15BLrx8etQoXz3gZv1/u2oq
    ERL_AFLAGS: -proto_dist inet_tcp
    ENABLE_TAILSCALE: "false"
    DNS_NODES: "''"
  # volumeMounts:
  #   - name: volume_name
  #     mountPath: /path/to/my/secret
  # volumes:
  #   - name: volume_name
  #     secret:
  #       defaultMode: 733
  #       secretName: my_secret
  #       items:
  #       - key: my_secret.txt
  #         path: name_of_file_in_container.txt
  resources: {}
    # We usually recommend not to specify default resources and to leave this as a conscious
    # choice for the user. This also increases chances charts run on environments with little
    # resources, such as Minikube. If you do want to specify resources, uncomment the following
    # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
    # limits:
    #   cpu: 100m
    #   memory: 128Mi
    # requests:
    #   cpu: 100m
    #   memory: 128Mi
  autoscaling:
    enabled: true
    minReplicas: 1
    maxReplicas: 100
    targetCPUUtilizationPercentage: 80
    # targetMemoryUtilizationPercentage: 80
  nodeSelector: {}
  tolerations: []
  affinity: {}

Can anyone please help on this issue