Skip to content

Update templates for initialzier and pilot external admission webhook#793

Merged
istio-merge-robot merged 15 commits intoistio:masterfrom
ayj:update-templates-for-initializer-and-pilot-admission-webhook
Sep 19, 2017
Merged

Update templates for initialzier and pilot external admission webhook#793
istio-merge-robot merged 15 commits intoistio:masterfrom
ayj:update-templates-for-initializer-and-pilot-admission-webhook

Conversation

@ayj
Copy link
Copy Markdown
Contributor

@ayj ayj commented Sep 14, 2017

  1. Update RBAC templates for sidecar initialzier and pilot external
    admission webhook

  2. Update istio-pilot template with external admission webook for
    config validation. Self-registration is gated on availability of
    secret with cert/key for signing requests. Secret is not created by
    default due to GKE 1.7.x bug which requires additional external
    IP. Workaround script is included for curious users to test but is not
    integrated in e2e tests.

  3. Initializer deployment is in its own file. The expectation is that
    this file will be included in cluster-wide specific tests where the
    initializer will not interfere with other tests in a shared cluster.

istio/old_pilot_repo#1153 (or equivalent) is required
for sidecar configuration per-namespace. The following command
an be temporarily used in cluster-wide specific tests to propogate
sidecar configmap to app namespaces.

kubectl -n <new-namespace> create cm istio \ 
    --from-file=<(kubectl -n istio-system get cm istio -o jsonpath={.data}

Release note:

NONE

1) Update RBAC templates for sidecar initialzier and pilot external
admission webhook

2) Update istio-pilot template with external admission webook for
config validation. Self-registration is gated on availability of
secret with cert/key for signing requests. Secret is not created by
default due to GKE 1.7.x bug which requires additional external
IP. Workaround script is included for curious users to test but is not
integrated in e2e tests.

3) Initializer deployment is in its own file. The expectation is that
this file will be included in cluster-wide specific tests where the
initializer will not interfere with other tests in a shared cluster.

istio/old_pilot_repo#1153 (or equivalent) is required
for sidecar configuration per-namespace. The following command can be
temporarily used in cluster-wide specific tests to propogate sidecar
configmap to app namespaces.

    kubectl -n <new-namespace> create cm istio --from-file=<(kubectl -n istio-system get cm istio -o jsonpath={.data}
image: gcr.io/istio-testing/pilot:5acaa9e26e7d9b239cbc72da63f5f9a3dac5a54e
imagePullPolicy: IfNotPresent
args: ["discovery", "-v", "2"]
args: ["discovery", "-v", "2", "--admission-service", "istio-pilot-external"]
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.

So this will be on even in non cluster-wide? Is it for validation?

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.

Yes. This shouldn't be a problem because the admission control service only self-registers when the dependent secret w/certs is created. That secret is not created by default due to GKE 1.7.x bug (see workaround script).

- deployments
- statefulsets
- jobs
- daemonsets
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.

Do we need other workloads?

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.

  • Initializer doesn't support cronjob yet.
  • replicatsets and replicationcontrollers had some issues with current initializer support that aren't resolved yet. Deployments are recommended instead of using replicasets or replicationctonrollers (see here)
  • pod also did not work but isn't recommended on its own since some controllers will complain if the pod template spec in the deployment doesn't match the pod spec itself.

@andraxylia
Copy link
Copy Markdown
Contributor

Let's go with the plan we discussed in the meeting and close on this:

  • validation webhooks on by default
  • initializer in a separate yaml file

@andraxylia
Copy link
Copy Markdown
Contributor

My only concern is with the name, sidecar initializer somehow makes me think it runs as a sidecar. I would call it simply istio-initializer.

name: istio-sidecar-initializer-admin-role-binding-istio-system
subjects:
- kind: ServiceAccount
name: istio-sidecar-initializer-service-account
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.

Remove sidecar from the name

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.

The naming was derived from kelsey heightower's envoy-initializer, i.e. s/envoy/istio-sidecar. I can change it if its confusing, but I should start with istio/pilot first. Also, any chance istio will use other initializers?

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 never know what future holds in store, there may be other initializers. The name is still confusing. We call the proxy a side car proxy, so I expect a sidecar initializer to be a sidecar...

How about istio-proxy-initializer or istio-proxy-injector?

cp $ISTIO $ISTIO_AUTH
sed -i=.bak "s/# authPolicy: MUTUAL_TLS/authPolicy: MUTUAL_TLS/" $ISTIO_AUTH

# TODO(andra/jason) - copy this into ${ISTIO_CLUSTER_WIDE} after initial cluster-wide test is verified.
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.

remove todo

name: http-discovery
- port: 8081
name: http-apiserver
- port: 443
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.

Is this the only change needed to enable webhooks?

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.

No, users need to run install/kubernetes/external-admission-webhook-gke-1-7-x-workaround.sh. This concerts the istio-pilot service to type=LoadBalancer, generates certs, and plumbs them through to k8s secret. The secret creation triggers the admission webhook to self-register.

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 will need to document the extra step somewhere on istio.io.

@istio-merge-robot
Copy link
Copy Markdown

@ayj PR needs rebase

@istio-merge-robot istio-merge-robot added the needs-rebase Indicates a PR needs to be rebased before being merged label Sep 16, 2017
@andraxylia
Copy link
Copy Markdown
Contributor

/lgtm

we can do the renaming in a separate commit, if you fix the conflicts and find a window to merge

metadata:
name: istio-sidecar-initializer
namespace: istio-system
annotations:
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 really need the annotation here? We already defined the initializers as [], so seems here do not need the annotations.

initializers:
  pending: []

labels:
istio: sidecar-initializer
annotations:
sidecar.istio.io/inject: "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.

ditto as above

@gyliu513
Copy link
Copy Markdown
Member

This also fixed #636

@istio-merge-robot
Copy link
Copy Markdown

/lgtm cancel //PR changed after LGTM, removing LGTM. @andraxylia @ayj

@istio-merge-robot istio-merge-robot removed lgtm needs-rebase Indicates a PR needs to be rebased before being merged labels Sep 18, 2017
ayj added a commit to ayj/pilot that referenced this pull request Sep 18, 2017
The use of `sidecar` in the name of the initializer seems to be
undesirable (see
istio/istio#793 (comment)). Rename
to simplify `istio-initializer` or `initializer` throughout.
ayj added a commit to ayj/pilot that referenced this pull request Sep 18, 2017
The use of `sidecar` in the name of the initializer seems to be
undesirable (see
istio/istio#793 (comment)). Rename
to simplify `istio-initializer` or `initializer` throughout.
template:
metadata:
annotations:
alpha.istio.io/sidecar: ignore
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.

This is generated, can you remove from grafana.yaml.tmpl and re-run updateVersion.sh

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 should be the case already. Lines 20-21 show the result of the new annotation from the template.

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.

Nvm, it's good, somehow I had missed the .tmpl files.

config: |-
policy: "enabled"
namespaces: [""] # everything, aka v1.NamepsaceAll, aka cluster-wide
initializerName: "sidecar.initializer.istio.io"
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.

Do we keep sidecar 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.

That's up to. It requires another corresponding change in istio/pilot

andraxylia and others added 4 commits September 18, 2017 14:16
…-for-initializer-and-pilot-admission-webhook
…bhook' of github.com:ayj/istio into update-templates-for-initializer-and-pilot-admission-webhook
@andraxylia
Copy link
Copy Markdown
Contributor

/retest all

1 similar comment
@ayj
Copy link
Copy Markdown
Contributor Author

ayj commented Sep 18, 2017

/retest all

@andraxylia
Copy link
Copy Markdown
Contributor

/lgtm

@istio-merge-robot
Copy link
Copy Markdown

/lgtm cancel //PR changed after LGTM, removing LGTM. @andraxylia @ayj

@andraxylia
Copy link
Copy Markdown
Contributor

/lgtm

@istio-merge-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andraxylia

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

@istio-merge-robot
Copy link
Copy Markdown

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

@istio-merge-robot
Copy link
Copy Markdown

Automatic merge from submit-queue

@istio-merge-robot istio-merge-robot merged commit c6bccb9 into istio:master Sep 19, 2017
ayj added a commit to ayj/pilot that referenced this pull request Sep 20, 2017
The use of `sidecar` in the name of the initializer seems to be
undesirable (see
istio/istio#793 (comment)). Rename
to simplify `istio-initializer` or `initializer` throughout.
rshriram pushed a commit that referenced this pull request Oct 30, 2017
…#793)

Automatic merge from submit-queue

Update templates for initialzier and pilot external admission webhook

1) Update RBAC templates for sidecar initialzier and pilot external
admission webhook

2) Update istio-pilot template with external admission webook for
config validation. Self-registration is gated on availability of
secret with cert/key for signing requests. Secret is not created by
default due to GKE 1.7.x bug which requires additional external
IP. Workaround script is included for curious users to test but is not
integrated in e2e tests.

3) Initializer deployment is in its own file. The expectation is that
this file will be included in cluster-wide specific tests where the
initializer will not interfere with other tests in a shared cluster.

istio/old_pilot_repo#1153 (or equivalent) is required 
for sidecar configuration per-namespace. The following command
an be temporarily used in cluster-wide specific tests to propogate 
sidecar configmap to app namespaces.

    kubectl -n <new-namespace> create cm istio \ 
        --from-file=<(kubectl -n istio-system get cm istio -o jsonpath={.data}

**Release note**:

```release-note
NONE
```
Former-commit-id: c6bccb9
vbatts pushed a commit to vbatts/istio that referenced this pull request Oct 31, 2017
…istio#793)

Automatic merge from submit-queue

Update templates for initialzier and pilot external admission webhook

1) Update RBAC templates for sidecar initialzier and pilot external
admission webhook

2) Update istio-pilot template with external admission webook for
config validation. Self-registration is gated on availability of
secret with cert/key for signing requests. Secret is not created by
default due to GKE 1.7.x bug which requires additional external
IP. Workaround script is included for curious users to test but is not
integrated in e2e tests.

3) Initializer deployment is in its own file. The expectation is that
this file will be included in cluster-wide specific tests where the
initializer will not interfere with other tests in a shared cluster.

istio/old_pilot_repo#1153 (or equivalent) is required 
for sidecar configuration per-namespace. The following command
an be temporarily used in cluster-wide specific tests to propogate 
sidecar configmap to app namespaces.

    kubectl -n <new-namespace> create cm istio \ 
        --from-file=<(kubectl -n istio-system get cm istio -o jsonpath={.data}

**Release note**:

```release-note
NONE
```
Former-commit-id: c6bccb9
mandarjog pushed a commit that referenced this pull request Nov 2, 2017
…#793)

Automatic merge from submit-queue

Update templates for initialzier and pilot external admission webhook

1) Update RBAC templates for sidecar initialzier and pilot external
admission webhook

2) Update istio-pilot template with external admission webook for
config validation. Self-registration is gated on availability of
secret with cert/key for signing requests. Secret is not created by
default due to GKE 1.7.x bug which requires additional external
IP. Workaround script is included for curious users to test but is not
integrated in e2e tests.

3) Initializer deployment is in its own file. The expectation is that
this file will be included in cluster-wide specific tests where the
initializer will not interfere with other tests in a shared cluster.

istio/old_pilot_repo#1153 (or equivalent) is required 
for sidecar configuration per-namespace. The following command
an be temporarily used in cluster-wide specific tests to propogate 
sidecar configmap to app namespaces.

    kubectl -n <new-namespace> create cm istio \ 
        --from-file=<(kubectl -n istio-system get cm istio -o jsonpath={.data}

**Release note**:

```release-note
NONE
```
Former-commit-id: c6bccb9
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