-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Helm and gateway tests #11276
Merged
Merged
Helm and gateway tests #11276
Changes from 14 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
3ccf867
add tests to gateway setup
dhawton cb00e02
manually cleanup the minimal istio install
dhawton dc95da6
Add canary upgrade test
dhawton c40b67f
convert rewrite-repo to a helper function
dhawton 73541ae
upgrade helm test
dhawton 9342916
lint fixes
dhawton 6240a9e
left over validatingwebhook from a prior test
dhawton f1e5e4d
remove boilerplate check
dhawton 7f60cae
undo elided pod names
dhawton 35422fd
gen snip
dhawton e8cc6b5
Remove validatingwebhookconfigurations deletion
dhawton 9ef34b1
remove webhook configs pending fix in istio
dhawton 4093a28
remove webhook configs pending fix in istio
dhawton 57b9064
revert some changes
dhawton 8f3b012
remove temp webhook removals
dhawton 7768335
remove revision labeled mutating webhooks
dhawton 4f0aabf
revert revision-tags-middle change
dhawton 7665d9b
make gen
dhawton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
167 changes: 167 additions & 0 deletions
167
content/en/docs/setup/additional-setup/gateway/snips.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
#!/bin/bash | ||
# shellcheck disable=SC2034,SC2153,SC2155,SC2164 | ||
|
||
# Copyright Istio Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
#################################################################################################### | ||
# WARNING: THIS IS AN AUTO-GENERATED FILE, DO NOT EDIT. PLEASE MODIFY THE ORIGINAL MARKDOWN FILE: | ||
# docs/setup/additional-setup/gateway/index.md | ||
#################################################################################################### | ||
|
||
! read -r -d '' snip_deploying_a_gateway_1 <<\ENDSNIP | ||
apiVersion: install.istio.io/v1alpha1 | ||
kind: IstioOperator | ||
metadata: | ||
name: ingress | ||
spec: | ||
profile: empty # Do not install CRDs or the control plane | ||
components: | ||
ingressGateways: | ||
- name: ingressgateway | ||
namespace: istio-ingress | ||
enabled: true | ||
label: | ||
# Set a unique label for the gateway. This is required to ensure Gateways | ||
# can select this workload | ||
istio: ingressgateway | ||
values: | ||
gateways: | ||
istio-ingressgateway: | ||
# Enable gateway injection | ||
injectionTemplate: gateway | ||
ENDSNIP | ||
|
||
snip_deploying_a_gateway_2() { | ||
kubectl create namespace istio-ingress | ||
istioctl install -f ingress.yaml | ||
} | ||
|
||
snip_deploying_a_gateway_3() { | ||
kubectl create namespace istio-ingress | ||
helm install istio-ingress istio/gateway -n istio-ingress | ||
} | ||
|
||
! read -r -d '' snip_deploying_a_gateway_4 <<\ENDSNIP | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: istio-ingressgateway | ||
namespace: istio-ingress | ||
spec: | ||
type: LoadBalancer | ||
selector: | ||
istio: ingressgateway | ||
ports: | ||
- port: 80 | ||
name: http | ||
- port: 443 | ||
name: https | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: istio-ingressgateway | ||
namespace: istio-ingress | ||
spec: | ||
selector: | ||
matchLabels: | ||
istio: ingressgateway | ||
template: | ||
metadata: | ||
annotations: | ||
# Select the gateway injection template (rather than the default sidecar template) | ||
inject.istio.io/templates: gateway | ||
labels: | ||
# Set a unique label for the gateway. This is required to ensure Gateways can select this workload | ||
istio: ingressgateway | ||
# Enable gateway injection. If connecting to a revisioned control plane, replace with "istio.io/rev: revision-name" | ||
sidecar.istio.io/inject: "true" | ||
spec: | ||
containers: | ||
- name: istio-proxy | ||
image: auto # The image will automatically update each time the pod starts. | ||
--- | ||
# Set up roles to allow reading credentials for TLS | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: istio-ingressgateway-sds | ||
namespace: istio-ingress | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["secrets"] | ||
verbs: ["get", "watch", "list"] | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: istio-ingressgateway-sds | ||
namespace: istio-ingress | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: istio-ingressgateway-sds | ||
subjects: | ||
- kind: ServiceAccount | ||
name: default | ||
ENDSNIP | ||
|
||
snip_deploying_a_gateway_5() { | ||
kubectl create namespace istio-ingress | ||
kubectl apply -f ingress.yaml | ||
} | ||
|
||
! read -r -d '' snip_gateway_selectors_1 <<\ENDSNIP | ||
apiVersion: networking.istio.io/v1beta1 | ||
kind: Gateway | ||
metadata: | ||
name: gateway | ||
spec: | ||
selector: | ||
istio: ingressgateway | ||
... | ||
ENDSNIP | ||
|
||
! read -r -d '' snip_canary_upgrade_advanced_1 <<\ENDSNIP | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: istio-ingressgateway-canary | ||
namespace: istio-ingress | ||
spec: | ||
selector: | ||
matchLabels: | ||
istio: ingressgateway | ||
template: | ||
metadata: | ||
annotations: | ||
inject.istio.io/templates: gateway | ||
labels: | ||
istio: ingressgateway | ||
istio.io/rev: canary # Set to the control plane revision you want to deploy | ||
spec: | ||
containers: | ||
- name: istio-proxy | ||
image: auto | ||
ENDSNIP | ||
|
||
snip_canary_upgrade_advanced_2() { | ||
kubectl get endpoints -n istio-ingress -o "custom-columns=NAME:.metadata.name,PODS:.subsets[*].addresses[*].targetRef.name" | ||
} | ||
|
||
! read -r -d '' snip_canary_upgrade_advanced_2_out <<\ENDSNIP | ||
NAME PODS | ||
istio-ingressgateway istio-ingressgateway-...,istio-ingressgateway-canary-... | ||
ENDSNIP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/usr/bin/env bash | ||
# Copyright Istio Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -e | ||
set -u | ||
|
||
set -o pipefail | ||
|
||
# @setup profile=none | ||
function rebuild() { | ||
istioctl x uninstall --purge --skip-confirmation | ||
kubectl delete namespace istio-ingress | ||
istioctl install --skip-confirmation --set profile=minimal | ||
} | ||
|
||
istioctl install --skip-confirmation --set profile=minimal | ||
_wait_for_deployment istio-system istiod | ||
|
||
# shellcheck disable=SC2154 | ||
cat <<EOF >ingress.yaml | ||
$snip_deploying_a_gateway_1 | ||
EOF | ||
|
||
echo y | snip_deploying_a_gateway_2 | ||
_wait_for_deployment istio-ingress ingressgateway | ||
|
||
rebuild | ||
_rewrite_helm_repo snip_deploying_a_gateway_3 | ||
_wait_for_deployment istio-ingress istio-ingress | ||
|
||
rebuild | ||
# shellcheck disable=SC2154 | ||
cat <<EOF >ingress.yaml | ||
$snip_deploying_a_gateway_4 | ||
EOF | ||
snip_deploying_a_gateway_5 | ||
_wait_for_deployment istio-ingress istio-ingressgateway | ||
|
||
istioctl install --skip-confirmation --set profile=minimal --set revision=canary | ||
_wait_for_deployment istio-system istiod-canary | ||
|
||
# shellcheck disable=SC2154 | ||
cat <<EOF | kubectl apply -f - | ||
$snip_canary_upgrade_advanced_1 | ||
EOF | ||
_wait_for_deployment istio-ingress istio-ingressgateway-canary | ||
|
||
# shellcheck disable=SC2154 | ||
_verify_like snip_canary_upgrade_advanced_2 "${snip_canary_upgrade_advanced_2_out}" | ||
|
||
# @cleanup | ||
|
||
istioctl x uninstall --purge --skip-confirmation | ||
kubectl delete namespace istio-system | ||
kubectl delete namespace istio-ingress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env bash | ||
# Copyright Istio Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
source "content/en/docs/setup/upgrade/helm/common.sh" | ||
|
||
set -e | ||
set -u | ||
|
||
set -o pipefail | ||
|
||
# @setup profile=none | ||
|
||
_install_istio_helm | ||
|
||
snip_canary_upgrade_recommended_1 | ||
_rewrite_helm_repo snip_canary_upgrade_recommended_2 | ||
_wait_for_deployment istio-system istiod-canary | ||
|
||
# shellcheck disable=SC2154 | ||
_verify_like snip_canary_upgrade_recommended_3 "${snip_canary_upgrade_recommended_3_out}" | ||
|
||
snip_canary_upgrade_recommended_4 | ||
_rewrite_helm_repo snip_canary_upgrade_recommended_5 | ||
|
||
_rewrite_helm_repo helm template istiod istio/istiod -s templates/revision-tags.yaml --set revisionTags="{prod-stable}" --set revision=1-9-5 -n istio-system | kubectl delete -f - | ||
_rewrite_helm_repo helm template istiod istio/istiod -s templates/revision-tags.yaml --set revisionTags="{prod-canary}" --set revision=1-10-0 -n istio-system | kubectl delete -f - | ||
helm uninstall istiod-canary -n istio-system | ||
_remove_istio_helm | ||
|
||
# @cleanup |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you removing the space before the
...
? Isn't the...
supposed to be for theNAMESPACES
column of the output?