apiVersion: batch/v1
kind: Job
metadata:
  name: secret-generator
spec:
  template:
    spec:
      serviceAccountName: secret-admin # do not use default, create a new service account
      restartPolicy: OnFailure
      containers:
        - name:            k8s-secret-admin
          image:           littlefox/k8s-secret-admin:latest
          imagePullPolicy: IfNotPresent
          args:
          - --name
          - application-config
          - --namespace
          - the-next-big-thing

          # will generate "session-key" as random 128 byte sequence
          - --bytes
          - session-key=128

          # generate "postgres_pass" as random 32 character password
          - --password
          - postgres_pass=32

          # some static database config values
          - --static
          - postgres_database=bigthing
          - --static
          - postgres_user=root
