Skip to content

fix(helm): add dry-run flag for init - #1426

Merged
technosophos merged 1 commit into
helm:masterfrom
technosophos:fix/1417-init-dry-run
Oct 21, 2016
Merged

technosophos merged 1 commit into
helm:masterfrom
technosophos:fix/1417-init-dry-run

Conversation

@technosophos

Copy link
Copy Markdown
Member

This adds a --dry-run flag to init, and causes the manifest file for
Tiller to be emitted on --debug. Together, this means you can do a
'helm init --dry-run --debug' and dump the Tiller manifest much as you
can with 'helm install --dry-run --debug'.

This does not require a server round-trip.

Closes #1417

This adds a --dry-run flag to init, and causes the manifest file for
Tiller to be emitted on --debug. Together, this means you can do a
'helm init --dry-run --debug' and dump the Tiller manifest much as you
can with 'helm install --dry-run --debug'.

This does not require a server round-trip.

Closes helm#1417
@technosophos technosophos added this to the 2.0.0-Beta milestone Oct 20, 2016
@technosophos technosophos self-assigned this Oct 20, 2016
@technosophos

Copy link
Copy Markdown
Member Author

Example:

⇒  helm init --dry-run --debug                                                                                              1 ↵
metadata:
  creationTimestamp: null
  labels:
    app: helm
    name: tiller
  name: tiller-deploy
spec:
  replicas: 1
  strategy: {}
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: helm
        name: tiller
    spec:
      containers:
      - image: gcr.io/kubernetes-helm/tiller:v2.0.0-beta.1
        imagePullPolicy: Always
        livenessProbe:
          httpGet:
            path: /liveness
            port: 44135
          initialDelaySeconds: 1
          timeoutSeconds: 1
        name: tiller
        ports:
        - containerPort: 44134
          name: tiller
        readinessProbe:
          httpGet:
            path: /readiness
            port: 44135
          initialDelaySeconds: 1
          timeoutSeconds: 1
        resources: {}
      serviceAccountName: ""
      volumes: null
status: {}

Will this work for you, @djsly?

@djsly

djsly commented Oct 20, 2016

Copy link
Copy Markdown

That's pretty helpful indeed. Prevents me from doing a real init to export the manifest.

After I import this, how can I ensure that other users with kube-system access won't alter the manifest by doing a subsequent helm init ?

Will the client be smart enough to detect the deployment object is already present ? will a newer client force the running tiller to be updated ?

@technosophos

technosophos commented Oct 21, 2016 •

Copy link
Copy Markdown
Member Author

On helm init, the client checks to see if there is already a helm-deployment deployment in the kube-system namespace. If so, it does not attempt to install, and init only does its local configuration.

Edit: And for the time being, we don't let helm update Tiller. We require manual steps to do that. Post 2.0, we might change this.

@djsly

djsly commented Oct 21, 2016 •

Copy link
Copy Markdown

ok I like the for the time being statement :)
I would like to manage the version of tiller that gets deployed as we release a cluster version to the user with a set of docker images running inside the kube-system.

My only concern was that I had Helm user who told me that sometimes they download the latest heml and they are forced to align the tiller image. If you are saying that this enforcement right now is a manual step. I'm happy with this.

Thanks for the quick work around!

@djsly

djsly commented Oct 21, 2016

Copy link
Copy Markdown

LTGM

Comment thread cmd/helm/init_test.go
cmd := &initCmd{out: &buf, home: helmpath.Home(home), kubeClient: fake.Extensions(), clientOnly: true}
if err := cmd.run(); err != nil {
t.Errorf("expected error: %v", err)
t.Errorf("unexpected error: %v", err)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expect the unexpected

@technosophos
technosophos merged commit 768f88d into helm:master Oct 21, 2016
@technosophos
technosophos deleted the fix/1417-init-dry-run branch October 28, 2016 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants