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

Refine Helm Charts: Add missing namespaces. #4606

Merged
merged 7 commits into from
Mar 30, 2018

Conversation

yusuoh
Copy link

@yusuoh yusuoh commented Mar 28, 2018

No description provided.

@codecov
Copy link

codecov bot commented Mar 28, 2018

Codecov Report

Merging #4606 into master will decrease coverage by 4%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #4606    +/-   ##
=======================================
- Coverage      75%     72%    -3%     
=======================================
  Files         297     295     -2     
  Lines       24742   25217   +475     
=======================================
- Hits        18524   18099   -425     
- Misses       5453    6359   +906     
+ Partials      765     759     -6
Impacted Files Coverage Δ
...olarwinds/internal/papertrail/papertrail_logger.go 62% <0%> (-18%) ⬇️
mixer/adapter/prometheus/prometheus.go 89% <0%> (-11%) ⬇️
pilot/pkg/config/kube/ingress/status.go 19% <0%> (-5%) ⬇️
mixer/adapter/redisquota/redisquota.go 86% <0%> (-3%) ⬇️
mixer/adapter/servicecontrol/testhelper.go 72% <0%> (-2%) ⬇️
pilot/pkg/model/egress_rules.go 95% <0%> (-2%) ⬇️
pilot/pkg/model/authentication.go 75% <0%> (-1%) ⬇️
mixer/adapter/fluentd/fluentd.go 76% <0%> (-1%) ⬇️
mixer/adapter/circonus/circonus.go 70% <0%> (-1%) ⬇️
mixer/adapter/rbac/rbacStore.go 84% <0%> (ø) ⬇️
... and 41 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 57d4d60...c1da740. Read the comment docs.

.gitignore Outdated
@@ -48,6 +48,10 @@ install/kubernetes/istio-sidecar-injector-configmap-release.yaml
install/kubernetes/istio-sidecar-injector.yaml
install/kubernetes/istio.yaml
install/kubernetes/istio-all.yaml
install/kubernetes/orig_istio-auth.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we generate files under $OUT and not in the source tree ?

@costinm
Copy link
Contributor

costinm commented Mar 28, 2018

Adding more people - I don't think we have tiller tests - or if it works with tiller.

We need to keep it working for both

@sdake
Copy link
Member

sdake commented Mar 28, 2018

@costin the helm charts worked with tiller a few weeks ago. I'll test this PR later tonight against tiller - I've got a few errands to run. I don't think there is harm in hard-coding the namespaces, although typically with helm -n argument is used to specify the namespace (and is automatically set in that condition IIRC). I could be wrong on th eabove - the helm charts went through a large refactor.

I'll report back this evening. otherwise lgtm

@mandarjog
Copy link
Contributor

Why do we need namespace embedded in the artifacts ?
kubectl -n < > apply
or helm -n work just fine ..

What is the helm best practice here?

@yusuoh
Copy link
Author

yusuoh commented Mar 28, 2018

This change is to make sure that the generated yamls from Istio release are correct (i.e. user can use kubectl apply -f istio.yaml without specifying namespaces). Currently some of them are tagged with namespaces and some are not. The kubectl -n and helm -n should still work as before.

It is not breaking the e2e tests only because those test are always using kubectl -n to set up the environment.

@yusuoh
Copy link
Author

yusuoh commented Mar 28, 2018

Btw, it seems that helm install -n and Helm template -n have different behavior. The previous one will tag all resources with correct namespace while the later won't unless you specifiy {{.Release.Namespace}} explicitly.

@yusuoh
Copy link
Author

yusuoh commented Mar 28, 2018

There is a related issue in Helm: helm/helm#3553

@costinm
Copy link
Contributor

costinm commented Mar 29, 2018

I think we should follow Helm practices - if it means 'kubectl apply -n istio-system' - it's fine with me.

If helm recommends including the namespace in template - good with me as well.

@yusuoh
Copy link
Author

yusuoh commented Mar 29, 2018

It seems that a new file is added by previous PR #4001 (install/kubernetes/helm/istio/templates/namespace.yaml), which broke the helm install. Because helm -n is trying to create namespace which already exits.

istio$ helm install install/kubernetes/helm/istio --namespace=istio-system
Error: release dangling-buffalo failed: namespaces "istio-system" already exists

After I deleted that file, it passes with this PR. However, we need to find a way to generate yaml from templates correctly.

@yusuoh
Copy link
Author

yusuoh commented Mar 29, 2018

Fixed the above namespace issue in #4612 by moving the namespace file out of helm chart.

@sdake
Copy link
Member

sdake commented Mar 29, 2018

Apologies I failed to test this PR last night. Sounds like you gave it a spin with Tiller though @yusuoh. I think Helm best practice is to use -n to override namespaces.

CCing @jascott1 who is a helm core and can answer the best practice question.

@jascott1
Copy link

jascott1 commented Mar 29, 2018

Having a Namespace manifest is currently problematic with Helm as you have discovered. Just using --namespace is more idiomatic.

@yusuoh
Copy link
Author

yusuoh commented Mar 29, 2018

@jascott1 This PR is not adding the namespace manifest but only to specify the metata.namespace field in k8s resources. Do you think it is OK to do that?

@andraxylia
Copy link
Contributor

This namespaces are part of the RBAC rules, so this fix is required. We cannot simply get a yaml file and apply it with -n to a namespace.

@jascott1
Copy link

@yusuoh Yes there is no problem with that approach afaik.

@jascott1
Copy link

BTW I corrected my above post, just for clarity its --namespace for namespace and -n is release name.

Copy link
Contributor

@costinm costinm left a comment

Choose a reason for hiding this comment

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

/lgtm

@istio-testing
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: costinm

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@istio-merge-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@istio-merge-robot
Copy link

Automatic merge from submit-queue.

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.

None yet

9 participants