Skip to content

Take2 on config unification#3594

Merged
costinm merged 18 commits intomasterfrom
costin-0216
Feb 26, 2018
Merged

Take2 on config unification#3594
costinm merged 18 commits intomasterfrom
costin-0216

Conversation

@costinm
Copy link
Copy Markdown
Contributor

@costinm costinm commented Feb 18, 2018

Changes:

  • move values.yaml to the normal place ( so updateValues is not needed for normal operation, --set in helm
    is more natural )
  • added few targets to test generation of istio.yaml from helm
  • use the same names as in the (release) istio.yaml - we want to be able to gracefully upgrade
  • removed some of the configuration that is not supported ( like arbitrary names )
  • use the single repo/tag - we don't really test or support getting each piece at a different version,
    and the UX is pretty bad (user having to type the tag 7 times)

I did more manual diffs - they're very time consuming, fixed few things missing (ingress certs), but
we'll need more people and eyes to get them in sync and make sure nothing gets lost.

@costinm costinm requested review from a team February 18, 2018 05:52
@istio-merge-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
We suggest the following additional approver: sebastienvas

Assign the PR to them by writing /assign @sebastienvas in a comment when ready.

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

Details Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@costinm costinm requested review from linsun and sdake February 22, 2018 01:00
Copy link
Copy Markdown
Member

@sdake sdake left a comment

Choose a reason for hiding this comment

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

nice work @costinm! I don't see any glaring errors, although would like to give it a test which I'll do today and report back.

mountPath: /etc/statsd
- name: {{ template "mixer.name" . }}
image: "{{ .Values.global.mixer.repository }}:{{ .Values.global.mixer.tag }}"
image: "{{ .Values.global.hub }}/mixer:{{ .Values.global.tag }}"
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.

this is a good improvement.

- "2"
- --discoveryAddress
- {{ .Release.Name }}-pilot:15003
- istio-pilot:15003
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.

yup this is much better.

heritage: {{ .Release.Service }}
istio: ingress
spec:
{{- if .Values.service.nodePort.enabled }}
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.

the nodePort.enabled feature is to permit people to eval if they lack a load balancer. I think the current istio generated manifest has this nodeport feature commented out. I think the conditional is warranted.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Super useful for minikube - but instead of conditional I added 2 services, one with node port
and one load balancer. This way we can have both.

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.

wfm.

istio: ingress

---
{{- if .Values.service.nodePort.enabled }}
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.

cool if this works, wfm.

# Common settings.
global:
# Default tag for Istio images.
hub: istio
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.

is this hub correct? Wouldn't it be docker.io/istio or gcr.io/istio?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

docker.io is added automatically, and it seems to work.

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.

wfm.

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.

would be good to specify it out as I'm not sure it'd work when custom registry is used in various cloud provider. also for clarity :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will do it in a separate PR, more changes will likely be needed before we change the tests.

httpGet:
path: /
port: {{ .Values.service.internalPort }}
# livenessProbe:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

commented out because it fails - 404. We need to add it back, but not sure what URL.

@sdake
Copy link
Copy Markdown
Member

sdake commented Feb 23, 2018

When I tested, I accidentally deployed to the istio namespace rather than the istio-system namespace which results in:

sdake@falkor-07:~/go/src/istio.io/istio/samples/bookinfo/kube$ istioctl kube-inject -i istio -f bookinfo.yaml -o bookfino-injected.yaml
Error: failed to convert to proto. unknown field "mixerCheckServer" in v1alpha1.MeshConfig
sdake@falkor-07:~/go/src/istio.io/istio/samples/bookinfo/kube$ istioctl version
Version: 0.5.1
GitRevision: 30acfe6528107ea333543309095659b93364b30d
User: root@2e4a18076b04
Hub: docker.io/istio
GolangVersion: go1.9
BuildStatus: Clean

I'll try istio-system. In the past, the helm charts have always deployed by default to the default namespace. IOW there may be a latent issue with the helm chart related to custom namespaces. Otherwise, things look good!

@costinm
Copy link
Copy Markdown
Contributor Author

costinm commented Feb 23, 2018 via email

@sdake
Copy link
Copy Markdown
Member

sdake commented Feb 23, 2018

Agreed it is likely a problem with the 0.51 images being out of sync with the manifests. I have just rebuilt latest master and will report back whether that works for me or not with helm install istio --name istio --set hub=docker.io/sdake --set tag=sdake.

Cheers
-steve

Copy link
Copy Markdown
Member

@sdake sdake left a comment

Choose a reason for hiding this comment

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

I tested with master and a master version of istioctl using manual injection. That works well enough. I think some more sanitization and testing is in order over time, but this PR looks good to go from my POV.

metadata:
labels:
app: {{ template "grafana.name" . }}
release: {{ .Release.Name }}
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.

I think there is value to keep release label so users can easily query what makes up a helm release.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This breaks upgrading from istio.yaml ( release / upgradeVersion ) to istio.yaml (helm ), which is
pretty important for now.

We can add annotations or other markers. I'm also not sure if the cost is worth it (k8s keeps indexes by label)

name: {{ .Values.service.name }}
selector:
app: {{ template "grafana.name" . }}
release: {{ .Release.Name }}
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.

same comment here...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Confirmed that the release/etc show up in the 'deployment' (as labels).
The change only removes them from the replica set and pods.

labels:
app: {{ template "mixer.name" . }}
release: {{ .Release.Name }}
istio: mixer
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.

I think these labels are helm convention you may want to keep.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I tried. We can add them later ( but will break upgrade ).

k8s treats the label set as immutable for some strange reasons.

labels:
app: istio-ca
spec:
type: LoadBalancer
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.

do we always want to do loadbalancer type for this? I asked as istio ingress has a node port option.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's what we have in istio.yaml - we can add a node port as well, but separate PR :-)

chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
istio: sidecar-injector
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.

same comment here on labels.

data:
mesh: |-
{{- if .Values.global.securityEnabled }}
{{- if .Values.global.mtlsDefault }}
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.

could we call it mtlsEnabled? default is confusing as to on or off...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Do you mind doing this in separate PR ? Don't want to go trough another wait :-)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I had to rebase, so updated it.

# create RBAC resources
# Default mtls policy. If true, mtls between services will be enabled by default.
mtlsDefault: false

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.

I'm confused that we want to expose both securityEnabled and mtlsDefault or mtlsEnabled to our user... because you can't have mtlsEnabled = true while securityEnabled = false. Maybe having mtlEnabled as a child property under securityEnabled?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Well, technically you can... SecurityEnabled means istioCA is installed. In theory you can have
another component generating certificates ( for example using vault or a native CA). Or use
some other spiffee thing.


# create RBAC resources. Must be set for any cluster configured with rbac.
rbacEnabled: true
# mutual TLS authentication
Copy link
Copy Markdown
Member

@linsun linsun Feb 23, 2018

Choose a reason for hiding this comment

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

for rbacEnabled... I'd assume it is only valid when security is enabled? and mixer is enabled today...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

AFAIK RBAC is required if the cluster has rbac ( and many have it on by default ).
RBAC only registers the cluster permissions so pilot can read stuff.

Copy link
Copy Markdown
Member

@linsun linsun left a comment

Choose a reason for hiding this comment

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

pending address of minor comments. Really good work Costin, I appreciate your effort so now we can generate istio yams from helm artifacts. :)

@istio-merge-robot
Copy link
Copy Markdown

@costinm PR needs rebase

@istio-merge-robot istio-merge-robot added the needs-rebase Indicates a PR needs to be rebased before being merged label Feb 24, 2018
@istio-merge-robot istio-merge-robot removed the needs-rebase Indicates a PR needs to be rebased before being merged label Feb 25, 2018
@costinm
Copy link
Copy Markdown
Contributor Author

costinm commented Feb 26, 2018

PTAL - I addressed most of the comments, but also added prometheus change (to sync with the templates/addons config), and added the refresh setting for larger clusters.

@ldemailly
Copy link
Copy Markdown
Member

please be careful to not commit accidental/unwanted changes to vendor, please undo that change for the build to pass

if [ ! -f /usr/local/bin/helm -a ! -f ${ISTIO_OUT}/helm ] ; then
# Install helm. Please keep it in sync with .circleci
cd /tmp && \
curl -Lo /tmp/helm.tgz https://storage.googleapis.com/kubernetes-helm/helm-${HELM_VER}-linux-amd64.tar.gz && \
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.

can we make this optional ? not everyone should have to install helm ? (only if you touch the templates,...)

not every build (lint, unit test, etc...) need helm either

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We plan to use helm to generate istio.yaml and test configs - so it won't be optional.
Also helm ( full helm, with tiller ) will need to be part of one of the integration tests.

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.

this is a bit risky though because helm can easily become required accidentally that way
it's also not hermetic, we should avoid downloading stuff
maybe the helm client can be vendored ? it should already have most of it as we use the libs in gen-deploy ?

in short I'm concerned it's really easy after that to break the "istio-auth.yaml" is all you need to install a basic istio (demo) setup - and pass all the tests

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.

it still shouldn't be required

@costinm
Copy link
Copy Markdown
Contributor Author

costinm commented Feb 26, 2018

/test istio-pilot-e2e

@costinm costinm merged commit 1bef28b into master Feb 26, 2018
@costinm costinm deleted the costin-0216 branch March 7, 2018 23:48
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.

6 participants