Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip adding stable/incubator on init flag #7868

Closed
mattfarina opened this issue Apr 3, 2020 · 15 comments
Closed

Skip adding stable/incubator on init flag #7868

mattfarina opened this issue Apr 3, 2020 · 15 comments
Assignees
Labels
feature v2.x Issues and Pull Requests related to the major version v2

Comments

@mattfarina
Copy link
Collaborator

In Helm v2 when helm init is run it adds the stable repo and an update happens. Even if you specify the tiller image. This is a problem for air gaped environments. They can specify a local tiller image but still have issues due to the upstream charts repo.

Since we are extending the Helm v2 support window it may be worth adding a flag to init to skip trying to add the stable repo.

Note, this was captured in the CNCF Air Gapped Working Group.

@mattfarina mattfarina added feature v2.x Issues and Pull Requests related to the major version v2 labels Apr 3, 2020
@bacongobbler
Copy link
Member

Seems reasonable. There's helm init --skip-refresh which will skip refreshing the repository cache file, but I don't believe there is a feature flag to skip adding the stable repository entirely.

@technosophos
Copy link
Member

I think that this is a necessary change in order to allow Helm2 users to continue using Helm when the Stable and Incubator repositories go away.

@hickeyma
Copy link
Contributor

hickeyma commented Apr 6, 2020

Sounds reasonable to me.

@rimusz
Copy link
Contributor

rimusz commented Apr 6, 2020

why not just to remove of adding stable/incubator repos in helm v2 with init?
then document it as we have it for the helm v3?

@bacongobbler
Copy link
Member

bacongobbler commented Apr 6, 2020

That would be a breaking change.

@rimusz
Copy link
Contributor

rimusz commented Apr 6, 2020

the change will be needed sooner or later anyway :)

@bacongobbler
Copy link
Member

Helm 2's support window will be closed by the time the stable chart repository is shut down, @rimusz. It will not be necessary to remove the stable repository from helm init during Helm 2's lifetime. That's why it'd be best as a feature flag so users can continue to use Helm 2 after the support window has closed.

Now normally, we have mentioned that we would not accept new features for the Helm 2 branch. However, this does seems like a necessary feature we need to get in before the stable repository is shut down. I'm less concerned about providing this to help support the air-gapped scenario given our current support window for Helm 2, but it certainly would help out in that regard.

Have there been any suggestions on a flag name from the Air Gapped WG? Perhaps helm init --skip-repos?

@rimusz
Copy link
Contributor

rimusz commented Apr 6, 2020

then flag with a name helm init --skip-repos is needed for sure.

@mattfarina
Copy link
Collaborator Author

@bacongobbler helm init --skip-repos works for me. I can start dev on this.

@mattfarina mattfarina self-assigned this Apr 10, 2020
@rjbez17
Copy link

rjbez17 commented Apr 13, 2020

For those waiting for this, this is the hack we've used internally to work around the issue. Run before helm init, then you can do a helm repo remove stable after the init.

# Make helm work without internet
# We need to make a dummy repository so helm init doesn't try to add
# an existing valid stable repo.
mkdir -p $HOME/.helm/repository/cache
mkdir -p $HOME/.helm/repository/local
mkdir -p $HOME/.helm/cache/archive

DATE=$(date +%F)
cat <<EOF > $HOME/.helm/repository/repositories.yaml
apiVersion: v1
generated: ${DATE}T12:00:00.111111-06:00
repositories:
- caFile: ""
  cache: /root/.helm/repository/cache/stable-index.yaml
  certFile: ""
  keyFile: ""
  name: stable
  password: ""
  url: localhost
  username: ""
EOF
# End hack

@bacongobbler
Copy link
Member

@rjbez17 I think helm init --client-only --skip-refresh && helm repo remove stable will accomplish the same task, if I'm not mistaken.

@rjbez17
Copy link

rjbez17 commented Apr 13, 2020

@bacongobbler could you then follow that up with a helm init to deploy tiller without issue?

@bacongobbler
Copy link
Member

bacongobbler commented Apr 13, 2020

Yep, though if you want to deploy tiller, you can also just omit the --client-only flag from the above example. --client-only prevents Helm from installing tiller in Kubernetes.

So, there's two ways you can do it:

helm init --skip-refresh --client-only
helm repo remove stable
helm init --skip-refresh

Or

helm init --skip-refresh
helm repo remove stable

Both accomplish the same thing.

@mattfarina
Copy link
Collaborator Author

@rjbez17 there is a flag to specify a different alternative location for Tiller, too.

@mattfarina mattfarina mentioned this issue Jun 25, 2020
8 tasks
mattfarina added a commit to mattfarina/helm that referenced this issue Jun 25, 2020
The stable charts repository is nearing the end of its life. Once
that has happened those who attempt to run helm init will get an
error. This flag provides a means to still use Helm v2 after the
stable charts repository is gone.

A secondary situation is that Helm v2 can be used in environmnets
without a network connection.

Closes helm#7868

Signed-off-by: Matt Farina <matt@mattfarina.com>
mattfarina added a commit to mattfarina/helm that referenced this issue Jun 25, 2020
The stable charts repository is nearing the end of its life. Once
that has happened those who attempt to run helm init will get an
error. This flag provides a means to still use Helm v2 after the
stable charts repository is gone.

A secondary situation is that Helm v2 can be used in environmnets
without a network connection.

Closes helm#7868

Signed-off-by: Matt Farina <matt@mattfarina.com>
@bridgetkromhout
Copy link
Member

@mattfarina's PR in #8344 said "closes" and it's merged, so as far as I can tell, we can probably close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature v2.x Issues and Pull Requests related to the major version v2
Projects
None yet
Development

No branches or pull requests

7 participants