Search code examples
dockerkubernetesrancherapache-superset

Superset configurations are lost upon Kubernetes pod start/stop


I'm having a problem with Superset on Kubernetes. After installing Superset when the pod comes down and goes up, the configurations are not saved and I lost the admin user I have created with the command:

docker exec -it superset superset fab create-admin \
           --username admin \
           --firstname Superset \
           --lastname Admin \
           --email [email protected] \
           --password admin

After that command, the only commands I used were:

$ docker exec -it superset superset db upgrade
$ docker exec -it superset superset db upgrade
$ docker exec -it superset superset init

I'm using Rancher to deploy the Superset pod. How can I persist the configurations?


Solution

  • For me I think you have two options:

    1. Create a volume for your pod. Your pod definition will looks something like this (PS I didn't test this code)
    apiVersion: v1
    kind: Pod
    metadata:
      name: pv-recycler
      namespace: default
    spec:
      restartPolicy: Never
      volumes:
      - name: vol
        hostPath:
          path: /any/path/it/will/be/replaced
      containers:
      - name: pv-recycler
        image: "superset"
        command: ["/bin/sh", "superset fab", "create-admin --username admin --firstname Superset --lastname Admin --email [email protected] --password admin"]
        volumeMounts:
        - name: vol
          mountPath: /scrub
    
    1. Make a dockerfile, add your configuration and build a new image with your configuration