Skip to content

enable pilot config validation#1987

Merged
ayj merged 3 commits intoistio:masterfrom
ayj:enable-pilot-webhook-validation-by-default
Dec 6, 2017
Merged

enable pilot config validation#1987
ayj merged 3 commits intoistio:masterfrom
ayj:enable-pilot-webhook-validation-by-default

Conversation

@ayj
Copy link
Copy Markdown
Contributor

@ayj ayj commented Dec 5, 2017

Add config validation webhook to Pilot e2e tests. Now that
kubernetes/kubernetes#49987 is fixed
validation webhooks can be enable on GKE >= 1.8. The following changes
are made as part of this PR:

  • Rename external-admission-webhook-gke-1-7-x-workaround.sh to
    generate-webhook-cert.sh and refactor use cfssl and k8s API to
    generate and sign webhook certificate with k8s CA.

  • Refactored pilot and e2e test defaults to use istio-pilot instead
    of istio-pilot-external service name. The k8s api-server will
    invoke the istio-pilot's webhook service directly to validate
    config.

  • Added test code to generate self-signed CA and signed server
    cert/key. This enables validation webhook in automated e2e testing.

ref: #1478

Add config validation webhook to Pilot e2e tests. Now that
kubernetes/kubernetes#49987 is fixed
validation webhooks can be enable on GKE >= 1.8. The following changes
are made as part of this PR:

* Rename external-admission-webhook-gke-1-7-x-workaround.sh to
  generate-webhook-cert.sh and refactor use cfssl and k8s API to
  generate and sign webhook certificate with k8s CA.

* Refactored pilot and e2e test defaults to use `istio-pilot` instead
  of `istio-pilot-external` service name. The k8s api-server will
  invoke the istio-pilot's webhook service directly to validate
  config.

* Added test code to generate self-signed CA and signed server
  cert/key. This enables validation webhook in automated e2e testing.
@ayj
Copy link
Copy Markdown
Contributor Author

ayj commented Dec 5, 2017

cc @wattli for cert management as defined by https://docs.google.com/document/d/1f61uHoPvozoVhlut6TG66L2XQ_DvFQWUUeFjHJeypHQ/edit#bookmark=id.74mjrvtdgjl4

cc @jmuk for equivalent mixer webhook validation integration

@istio-testing
Copy link
Copy Markdown
Collaborator

@ayj: Adding do-not-merge/release-note-label-needed because the release note process has not been followed.

Details

One of the following labels is required "release-note", "release-note-action-required", or "release-note-none".
Please see: https://github.com/kubernetes/community/blob/master/contributors/devel/pull-requests.md#write-release-notes-if-needed.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jmuk
Copy link
Copy Markdown
Contributor

jmuk commented Dec 5, 2017

So do we want to remove 1.7 workaround? I think the new script is a little different about the load balancer hack, which doesn't work with 1.7.x.

@ayj
Copy link
Copy Markdown
Contributor Author

ayj commented Dec 5, 2017

Anyone using the workaround on GKE 1.7 is already on an alpha cluster. They would be likely to upgrade to 1.8.x anyway since alpha clusters expire after 30 days. The updated script should work for non-GKE clusters >= 1.7 and GKE >= 1.8.

@jmuk
Copy link
Copy Markdown
Contributor

jmuk commented Dec 5, 2017

ah, fair enough, thanks.

Copy link
Copy Markdown
Member

@cmluciano cmluciano left a comment

Choose a reason for hiding this comment

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

Cannot get this to work locally yet

@@ -0,0 +1,128 @@
#!/bin/sh
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 you make this file executable?

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.

Thanks, fixed. I also changed to #!/bin/bash.


set -e

function usage() {
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 function specification does not work. You can remove the function keyword and just have usage.

exit 1
}

while [[ $# -gt 0 ]]; do
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 unable to get this to work with the following example

./generate-webhook-cert.sh --service test --namespace default --secret webhook --secret-namespace default

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'm unable to see or reproduce the error. Any additional information on what's not working here?

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.

ok I think I must have had a typo. It works with the latest patchset now.

* s/sh/bash
* remove `function` keyword
@codecov
Copy link
Copy Markdown

codecov bot commented Dec 5, 2017

Codecov Report

Merging #1987 into master will increase coverage by 0.33%.
The diff coverage is 25%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1987      +/-   ##
==========================================
+ Coverage   81.81%   82.15%   +0.33%     
==========================================
  Files         190      200      +10     
  Lines       15675    16273     +598     
==========================================
+ Hits        12825    13369     +544     
- Misses       2414     2466      +52     
- Partials      436      438       +2
Flag Coverage Δ
#broker 46.09% <ø> (-1.18%) ⬇️
#mixer 83.74% <ø> (+0.38%) ⬆️
#pilot 80.71% <25%> (+0.13%) ⬆️
#security 92.03% <ø> (ø) ⬆️
Impacted Files Coverage Δ
pilot/platform/kube/admit/admit.go 55.24% <25%> (-0.06%) ⬇️
mixer/adapter/stackdriver/helper/common.go 66.66% <0%> (-8.34%) ⬇️
mixer/adapter/prometheus/server.go 89.58% <0%> (-6.25%) ⬇️
mixer/adapter/prometheus/prometheus.go 75.24% <0%> (-3.78%) ⬇️
mixer/adapter/circonus/circonus.go 69.23% <0%> (-1.56%) ⬇️
mixer/adapter/list/list.go 94.21% <0%> (-1%) ⬇️
mixer/pkg/config/apiserver.go 98.92% <0%> (-0.24%) ⬇️
mixer/adapter/svcctrl/reportbuilder.go 88.57% <0%> (-0.11%) ⬇️
mixer/adapter/memquota/memquota.go 100% <0%> (ø) ⬆️
mixer/adapter/list/stringList.go 100% <0%> (ø) ⬆️
... and 24 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 620a7c7...f32bb74. Read the comment docs.

@cmluciano
Copy link
Copy Markdown
Member

/lgtm

@istio-merge-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

Assign the PR to them by writing /assign @hklai 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

@ayj ayj merged commit 704d5cc into istio:master Dec 6, 2017
@ayj ayj deleted the enable-pilot-webhook-validation-by-default branch December 6, 2017 17:09
istio-merge-robot pushed a commit that referenced this pull request Dec 14, 2017
Automatic merge from submit-queue.

Revert servicecontrol adapter BUILD change from PR 1987

**What this PR does / why we need it**:
Test code shouldn't be compiled into prod code. This reverts change from #1987. It appeared it was an accident. 

**Release note**:

```release-note
NONE
```
SRohitRaj pushed a commit to SRohitRaj/Istio that referenced this pull request Jun 7, 2024
Automatic merge from submit-queue.

Revert servicecontrol adapter BUILD change from PR 1987

**What this PR does / why we need it**:
Test code shouldn't be compiled into prod code. This reverts change from istio/istio#1987. It appeared it was an accident. 

**Release note**:

```release-note
NONE
```
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