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

Allow installation of consul-k8s into a non-default namespace #106

Closed
paulbouwer opened this issue Jun 25, 2019 · 1 comment
Closed

Allow installation of consul-k8s into a non-default namespace #106

paulbouwer opened this issue Jun 25, 2019 · 1 comment

Comments

@paulbouwer
Copy link
Contributor

Issue

When installing Consul into a Kubernetes cluster via the Consul Helm Chart and targeting a namespace that is not default, there is the following issue.

The consul-k8s server-acl-init command executed by the server-acl-init-job attempts to get the Kubernetes api-server service kubernetes.default.svc.

See https://github.com/hashicorp/consul-k8s/blob/master/subcommand/server-acl-init/command.go#L347

This code attempts to obtain the service from the namespace specified to the helm chart. If this namespace value is default, then everything just works. If this namespace value is something like consul, then the code fails.

While running in a Pod, the Kubernetes apiserver is accessible via a Service named kubernetes in the default namespace. Therefore, Pods can use the kubernetes.default.svc hostname to query the API server. Official client libraries do this automatically.

https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/#accessing-the-api-from-a-pod

Solution

Hardcode the namespace searched by this specific piece of code to default, since that is always where the service will be.

@lkysow
Copy link
Member

lkysow commented Sep 18, 2019

Fixed by #107

@lkysow lkysow closed this as completed Sep 18, 2019
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

No branches or pull requests

2 participants