Configuring initial User in K8s Pod

Hello,

I initially deployed SCM-Manager in an OpenShift Cluster using the official Helm Chart (with persistence disabled).

I then tried to configure the initial user directly in the Deployment using args (as suggested by the Chart Values):

kind: Deployment
apiVersion: apps/v1
# ...
      containers:
        - image: '<internal registry>/scm-manager:3.4.1'
          args:
            - '-Dscm.initialUser=admin'
            - '-Dscm.initialPassword=123456'

Though, when the Pod gets recreated, it still logs the token for initial user creation. The UI also asks me to initialize the user (username prefilled with scmadmin).

The Pod’s YAML reflects the args:

kind: Pod
apiVersion: v1
# ...
      args:
        - '-Dscm.initialUser=admin'
        - '-Dscm.initialPassword=123456'

The sample in the values file is old and does not work anymore. You can set the initial user and password now via environment variables, e.g.:

extraEnv: |
  - name: SCM_WEBAPP_INITIALUSER
    value: "admin"
  - name: SCM_WEBAPP_INITIALPASSWORD
    value: "123456"

Or even better, use a secret:

apiVersion: v1
kind: Secret
metadata:
  name: scm-admin-credentials
stringData:
  SCM_WEBAPP_INITIALUSER: admin
  SCM_WEBAPP_INITIALPASSWORD: "123456"

and reference it in the values.yaml:

extraEnvFrom: |
  - secretRef:
      name: scm-admin-credentials

We will update the sample in the values files. Sorry for that.

Hi Sebastian, thanks for providing a solution!
While you’re at it, you may also want to update the docs:

@malte.hei it is already in review. But thanks for the hint.