Skip to content

Add proxy version info to envoy metadata#6854

Merged
rshriram merged 12 commits intoistio:release-1.0from
rshriram:proxy_version_1.0
Jul 6, 2018
Merged

Add proxy version info to envoy metadata#6854
rshriram merged 12 commits intoistio:release-1.0from
rshriram:proxy_version_1.0

Conversation

@rshriram
Copy link
Copy Markdown
Member

@rshriram rshriram commented Jul 5, 2018

To allow smooth upgrades from 1.0 to future versions.
I need help to determine the places where this needs to be plugged in.

cc @sdake @costinm @ayj

Signed-off-by: Shriram Rajagopalan shriramr@vmware.com

Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com>
@rshriram rshriram requested review from costinm and removed request for nmittler and vadimeisenbergibm July 5, 2018 02:02
@kyessenov
Copy link
Copy Markdown
Contributor

Thank you for this much saner approach. We can condition mixer plugin based on the version of the proxy asking for the config.

Shriram Rajagopalan added 3 commits July 5, 2018 11:03
Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com>
Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com>
fieldRef:
fieldPath: status.podIP
- name: ISTIO_META_ISTIO_PROXY_VERSION
{{ if eq .IstioProxyVersion "" -}}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think this will work - or is needed. Once upgrade happens, auto-inject or inject will put the right proxy version and proxy.

@mandarjog - is this code still used ? My understanding was that we now read the config map and this is dead code to be cleaned up ?

Copy link
Copy Markdown
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.

Looks great - but missing 2 files, need values.yaml in both istio and istio-remote to add the istioProxyVersion.

@costinm
Copy link
Copy Markdown
Contributor

costinm commented Jul 5, 2018

Once you add values.yaml:
/lgtm
/approve

@costinm
Copy link
Copy Markdown
Contributor

costinm commented Jul 5, 2018

Noted in slack: we do allow users to use custom images.
Maybe a better approach would be to modify the Docker image of the proxy, and have the env 'built in' the docker file.

Thinking about it - it may be a more flexible approach.

For the version: it might be something like: 1.0,mixer5.2,myplugin3.4 if we want to
also let pilot know about additional plugins that may be built into envoy binary.

Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com>
@istio-testing istio-testing removed the lgtm label Jul 5, 2018
@codecov
Copy link
Copy Markdown

codecov bot commented Jul 5, 2018

Codecov Report

Merging #6854 into release-1.0 will decrease coverage by 1%.
The diff coverage is 64%.

Impacted file tree graph

@@             Coverage Diff              @@
##           release-1.0   #6854    +/-   ##
============================================
- Coverage           71%     71%   -<1%     
============================================
  Files              369     370     +1     
  Lines            31584   32041   +457     
============================================
+ Hits             22228   22534   +306     
- Misses            8428    8575   +147     
- Partials           928     932     +4
Impacted Files Coverage Δ
pkg/bootstrap/bootstrap_config.go 29% <ø> (-12%) ⬇️
pilot/pkg/kube/inject/inject.go 85% <ø> (ø) ⬆️
pilot/pkg/proxy/envoy/v2/cds.go 60% <0%> (ø) ⬆️
pilot/pkg/proxy/envoy/v2/rds.go 58% <0%> (ø) ⬆️
pilot/pkg/proxy/envoy/v2/lds.go 54% <0%> (ø) ⬆️
istioctl/cmd/istioctl/kubeinject.go 50% <0%> (+6%) ⬆️
pilot/pkg/model/context.go 69% <100%> (+4%) ⬆️
pilot/pkg/proxy/envoy/v2/ads.go 78% <100%> (+1%) ⬆️
mixer/adapter/servicecontrol/distValueBuilder.go 85% <0%> (-7%) ⬇️
... and 23 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 3409b6a...41094c8. Read the comment docs.

@googlebot
Copy link
Copy Markdown
Collaborator

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@googlebot googlebot added cla: no Set by the Google CLA bot to indicate the author of a PR has not signed the Google CLA. and removed cla: yes labels Jul 5, 2018
@GregHanson
Copy link
Copy Markdown
Member

@costinm values.yaml files updated

tag: 0.8.latest

# git SHA or git tag from istio/proxy repo
istioProxyVersion: 0.8.0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure what that means - 0.8.0 shipped and it's injected, so this will never be a valid combination.

You mean "1.0.0" ? Also the tag above should be 1.0.latest

tag: nightly-master

# git SHA or git tag from istio/proxy repo
istioProxyVersion: 0.8.0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same

}); err != nil {
return err
}
return errors.New("one of injectConfigFile or injectConfigMapName is required\n" +
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We seem to still need it, the tests are doing the wrong thing and using the 'builtin defaults' ( which is the only place the hardcoded config should be used ). May be better to split into 2 PR, one adding the env and separate one (in master?) getting rid of the hack and fixing the tests.

DebugMode bool `json:"debugMode"`
Mesh *meshconfig.MeshConfig `json:"-"`
ImagePullPolicy string `json:"imagePullPolicy"`
IstioProxyVersion string `json:"istioProxyVersion"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure why we need this.

InitImage: InitImageName(unitTestHub, unitTestTag, false),
ProxyImage: ProxyImageName(unitTestHub, unitTestTag, false),
ImagePullPolicy: "IfNotPresent",
IstioProxyVersion: unitTestProxyVersion,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If you want to add a test - add one to check env variables are propagated. This is just one particular env.

Metadata map[string]string
}

// ProxyVersion indicates the version of the data plane proxy we are talking to.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As I mentioned - I'm not sure what is the right way to handle this, the proxy version doesn't really help since it's not something pilot can really process. We don't support a single sidecar that has linear versions - the sidecar can be a custom build with extra modules, from a remote repo using its own versioning.

How about not designing a new API and model in 1.0 branch - and just use the presence of the env variable in 1.0 to differentiate 0.8.0 ( which will never have this set ) ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We can still add capabilities by using x.y.z-tags. This is not exposing any api. It’s simply parsing the metadata field into some struct that we can use internally. Plugins are welcome to add additional info and parse it in any way they want. For networking code in open source, we simply need to track the istio versions so that we can emit the right type of Envoy configs for things like filter chain matching on src/dst ip ranges etc. a true version info would be one where Envoy sends list of filters with versions and capabilities it has. This is a simpler version of that. We could do a lot of things with just this.

If we implement unimplemented pieces of Envoy proto, we need to know of the Envoy will respect it or ignore it, in the main networking code. Such things cannot be converted into tags. There would be hundreds of such tags then (eg filterchainipsupport,rediscds,mongofault,etc) one for each thing we add to Envoy. The numbering scheme is a way to mark these features on a linear semver scale, sort of like kernel code.

I don’t want to have dummy env vars that will get removed in next cycle. People could still use new istioctl with 0.8 proxy, or stock Envoy. Using a value in the environment variable transfers the burden to the operator making custom changes to clearly communicate the major istio release with which the proxy is expected to work.

@costinm
Copy link
Copy Markdown
Contributor

costinm commented Jul 6, 2018 via email

Shriram Rajagopalan added 5 commits July 5, 2018 22:03
Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com>
Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com>
Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com>
@costinm
Copy link
Copy Markdown
Contributor

costinm commented Jul 6, 2018 via email

@rshriram
Copy link
Copy Markdown
Member Author

rshriram commented Jul 6, 2018

and I modified this PR 10 minutes ago to add env vars to the image :)

@costinm
Copy link
Copy Markdown
Contributor

costinm commented Jul 6, 2018 via email

Copy link
Copy Markdown
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.

There is also proxy_debug - not sure who is using it ( the 300M one with not-optimized envoy), but fine to fix in in separate PR.

/lgtm
/approve

@istio-testing
Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: costinm, rshriram

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

The pull request process is described here

Details 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

@rshriram rshriram merged commit 67f2bc6 into istio:release-1.0 Jul 6, 2018
@rshriram rshriram deleted the proxy_version_1.0 branch August 21, 2018 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: no Set by the Google CLA bot to indicate the author of a PR has not signed the Google CLA.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants