dtzar/helm-kubectl

Not able to set Admin default password

vosuyak opened this issue · 14 comments

Use case:
Looking to use this image in my Kubernetes deployment component and run via kubectl rather than the docker cmd.

The Issue:
When passing the image in my Kubernetes cluster, I'm able to land on the /login page, however, because this is running on Kubernetes and not docker, a generated password is not present on the command prompt.

Potential solution:
Is there a way to pass a temporary default password via, the -e (environment)? With this approach login proceeds to the dashboard.

image

gaby commented

@vosuyak You can do this through your deployment YAML, ex:

spec:
  containers:
  - name: envar-demo-container
    image: dtzar/helm-kubectl:latest
    env:
    - name: JENKINS_PASSWORD
      value: "changeme"

Hello @gabrielcalderon thank you for the quick response. I've attempted the above example and unfortunately no luck with this approach. Are there any additional steps need prior to this?

gaby commented

@vosuyak How are you trying to run your deployment ?

@gabrielcalderon deployments are done to my deployment component/object, which is generated via helm with values set to values.yaml.

Testing the Helm chart passes, and deploying to local cluster passes too. I'm still able to land on the GUI path of /login and the set password still does not work with the suggestions made above.

gaby commented

Are you using this image to deploy your deployment? If that's the case, I would suggest creating your own image based on dtzar/helm-kubectl.

This image is actually used solely to put Jenkins on my Kubernetes cluster. The reason why I chose this image was that it connects to docker.sock on the build. Is JENKINS_PASSWORD a valid environment variable? I know JENKINS_USER is.

gaby commented

@vosuyak Were you able to solve the password issue?

@gabrielcalderon Thanks for following up, and no, I am still not able to set an initial admin password with the suggestions made.

gaby commented

@vosuyak Can you share your deployment YAML ?

apiVersion: apps/v1
kind: Deployment
metadata:
  name: jenkins-deployment
  namespace: prod
  labels:
    app.kubernetes.io/version: "1.16.0"
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: jenkins
  template:
    metadata:
      labels:
        app.kubernetes.io/name: jenkins
    spec:
      containers:
      - env:
        - name: JENKINS_PASSWORD
          value: "changeme"
        image: "trion/jenkins-docker-client:latest"
        imagePullPolicy: "IfNotPresent"
        name: jenkins
        ports:
        - containerPort: 80
      restartPolicy: Always
gaby commented

@vosuyak Are you using this to deploy jenkins? I don't think the issue is related to this image. To deploy Jenkins you should use Jenkins helm chart located here: https://github.com/jenkinsci/helm-charts

@gabrielcalderon my apologies, i just updated my deployment example with the correct images being used to run my jenkins
"trion/jenkins-docker-client:latest" . This image is not allowing me to add a inital password value.

gaby commented

@vosuyak That's what i'm saying, that image is not related to this repo. The correct repo to open a ticket for that image would be: https://github.com/trion-development/docker-jenkins-docker-client