Update values so istioctl x wait works (#12508)

* Update values so istioctl x wait works

* Remove extra values

* Update all snippet instances of `istio install` for wait_for_istio

* Fix value
This commit is contained in:
Eric Van Norman 2023-01-24 17:46:18 -06:00 committed by GitHub
parent 565ddc4cc5
commit 93ea5bb3ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 56 additions and 39 deletions

View File

@ -21,7 +21,7 @@
####################################################################################################
snip_install_with_enable_status() {
istioctl install --set values.pilot.env.PILOT_ENABLE_STATUS=true --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true --set values.global.istiod.enableAnalysis=true
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true --set values.pilot.env.PILOT_ENABLE_STATUS=true --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true --set values.global.istiod.enableAnalysis=true
}
snip_apply_and_wait_for_httpbin_vs() {

View File

@ -30,7 +30,7 @@ spec:
gatewayTopology:
numTrustedProxies: 2
EOF
istioctl install -f topology.yaml
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true -f topology.yaml
}
snip_create_httpbin_namespace() {

View File

@ -83,7 +83,7 @@ status:
ENDSNIP
snip_install_with_custom_config_analysis() {
istioctl install --set values.global.istiod.enableAnalysis=true
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true --set values.global.istiod.enableAnalysis=true
}
snip_analyze_k_frod() {

View File

@ -45,7 +45,7 @@ ENDSNIP
snip_deploying_a_gateway_2() {
kubectl create namespace istio-ingress
istioctl install -f ingress.yaml
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true -f ingress.yaml
}
snip_deploying_a_gateway_3() {

View File

@ -39,7 +39,7 @@ export PATH=$PWD/bin:$PATH
}
snip_install_istio_install_1() {
istioctl install -f samples/bookinfo/demo-profile-no-gateways.yaml -y
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true -f samples/bookinfo/demo-profile-no-gateways.yaml -y
}
! read -r -d '' snip_install_istio_install_1_out <<\ENDSNIP

View File

@ -34,7 +34,7 @@ export PATH=$PWD/bin:$PATH
}
snip_install_istio_install_1() {
istioctl install --set profile=demo -y
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true --set profile=demo -y
}
! read -r -d '' snip_install_istio_install_1_out <<\ENDSNIP

View File

@ -47,7 +47,7 @@ EOF
}
snip_set_up_a_gateway_in_the_external_cluster_2() {
istioctl install -f controlplane-gateway.yaml --context="${CTX_EXTERNAL_CLUSTER}"
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true -f controlplane-gateway.yaml --context="${CTX_EXTERNAL_CLUSTER}"
}
snip_set_up_a_gateway_in_the_external_cluster_3() {
@ -215,7 +215,7 @@ sed -i'.bk' \
}
snip_set_up_the_control_plane_in_the_external_cluster_5() {
istioctl install -f external-istiod.yaml --context="${CTX_EXTERNAL_CLUSTER}"
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true -f external-istiod.yaml --context="${CTX_EXTERNAL_CLUSTER}"
}
snip_set_up_the_control_plane_in_the_external_cluster_6() {
@ -367,7 +367,7 @@ spec:
istio-ingressgateway:
injectionTemplate: gateway
EOF
istioctl install -f istio-ingressgateway.yaml --set values.global.istioNamespace=external-istiod --context="${CTX_REMOTE_CLUSTER}"
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true -f istio-ingressgateway.yaml --set values.global.istioNamespace=external-istiod --context="${CTX_REMOTE_CLUSTER}"
}
snip_enable_gateways_2() {
@ -390,7 +390,7 @@ spec:
istio-egressgateway:
injectionTemplate: gateway
EOF
istioctl install -f istio-egressgateway.yaml --set values.global.istioNamespace=external-istiod --context="${CTX_REMOTE_CLUSTER}"
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true -f istio-egressgateway.yaml --set values.global.istioNamespace=external-istiod --context="${CTX_REMOTE_CLUSTER}"
}
snip_enable_gateways_4() {

View File

@ -35,7 +35,7 @@ EOF
}
snip_configure_cluster1_as_a_primary_2() {
istioctl install --context="${CTX_CLUSTER1}" -f cluster1.yaml
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true --context="${CTX_CLUSTER1}" -f cluster1.yaml
}
snip_configure_cluster2_as_a_primary_1() {
@ -53,7 +53,7 @@ EOF
}
snip_configure_cluster2_as_a_primary_2() {
istioctl install --context="${CTX_CLUSTER2}" -f cluster2.yaml
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true --context="${CTX_CLUSTER2}" -f cluster2.yaml
}
snip_enable_endpoint_discovery_1() {

View File

@ -40,7 +40,7 @@ EOF
}
snip_configure_cluster1_as_a_primary_2() {
istioctl install --context="${CTX_CLUSTER1}" -f cluster1.yaml
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true --context="${CTX_CLUSTER1}" -f cluster1.yaml
}
snip_install_the_eastwest_gateway_in_cluster1_1() {
@ -83,7 +83,7 @@ EOF
}
snip_configure_cluster2_as_a_primary_2() {
istioctl install --context="${CTX_CLUSTER2}" -f cluster2.yaml
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true --context="${CTX_CLUSTER2}" -f cluster2.yaml
}
snip_install_the_eastwest_gateway_in_cluster2_1() {

View File

@ -35,7 +35,7 @@ EOF
}
snip_configure_cluster1_as_a_primary_2() {
istioctl install --set values.pilot.env.EXTERNAL_ISTIOD=true --context="${CTX_CLUSTER1}" -f cluster1.yaml
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true --set values.pilot.env.EXTERNAL_ISTIOD=true --context="${CTX_CLUSTER1}" -f cluster1.yaml
}
snip_install_the_eastwest_gateway_in_cluster1_1() {
@ -85,7 +85,7 @@ EOF
}
snip_configure_cluster2_as_a_remote_3() {
istioctl install --context="${CTX_CLUSTER2}" -f cluster2.yaml
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true --context="${CTX_CLUSTER2}" -f cluster2.yaml
}
snip_attach_cluster2_as_a_remote_cluster_of_cluster1_1() {

View File

@ -40,7 +40,7 @@ EOF
}
snip_configure_cluster1_as_a_primary_2() {
istioctl install --set values.pilot.env.EXTERNAL_ISTIOD=true --context="${CTX_CLUSTER1}" -f cluster1.yaml
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true --set values.pilot.env.EXTERNAL_ISTIOD=true --context="${CTX_CLUSTER1}" -f cluster1.yaml
}
snip_install_the_eastwest_gateway_in_cluster1_1() {
@ -99,7 +99,7 @@ EOF
}
snip_configure_cluster2_as_a_remote_3() {
istioctl install --context="${CTX_CLUSTER2}" -f cluster2.yaml
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true --context="${CTX_CLUSTER2}" -f cluster2.yaml
}
snip_install_the_eastwest_gateway_in_cluster2_1() {

View File

@ -23,7 +23,7 @@
snip_deploying_multiple_control_planes_1() {
kubectl create ns usergroup-1
kubectl label ns usergroup-1 usergroup=usergroup-1
istioctl install -y -f - <<EOF
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true -y -f - <<EOF
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
@ -47,7 +47,7 @@ EOF
snip_deploying_multiple_control_planes_2() {
kubectl create ns usergroup-2
kubectl label ns usergroup-2 usergroup=usergroup-2
istioctl install -y -f - <<EOF
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true -y -f - <<EOF
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:

View File

@ -62,21 +62,21 @@ EOF
}
snip_install_the_istio_control_plane_2() {
istioctl install -f vm-cluster.yaml
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true -f vm-cluster.yaml
}
snip_install_istio() {
istioctl install -f vm-cluster.yaml --set values.pilot.env.PILOT_ENABLE_WORKLOAD_ENTRY_AUTOREGISTRATION=true --set values.pilot.env.PILOT_ENABLE_WORKLOAD_ENTRY_HEALTHCHECKS=true
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true -f vm-cluster.yaml --set values.pilot.env.PILOT_ENABLE_WORKLOAD_ENTRY_AUTOREGISTRATION=true --set values.pilot.env.PILOT_ENABLE_WORKLOAD_ENTRY_HEALTHCHECKS=true
}
snip_install_eastwest() {
samples/multicluster/gen-eastwest-gateway.sh --single-cluster | istioctl install -y -f -
samples/multicluster/gen-eastwest-gateway.sh --single-cluster | istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true -y -f -
}
snip_install_the_istio_control_plane_5() {
samples/multicluster/gen-eastwest-gateway.sh \
--mesh mesh1 --cluster "${CLUSTER}" --network "${CLUSTER_NETWORK}" | \
istioctl install -y -f -
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true -y -f -
}
snip_expose_istio() {

View File

@ -88,7 +88,7 @@ kubectl delete -f samples/httpbin/httpbin.yaml
}
snip_disable_envoys_access_logging_1() {
istioctl install --set profile=default
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true --set profile=default
}
! read -r -d '' snip_disable_envoys_access_logging_1_out <<\ENDSNIP

View File

@ -130,7 +130,7 @@ kubectl delete -f samples/open-telemetry/otel.yaml
}
snip_disable_envoys_access_logging_1() {
istioctl install --set profile=default
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true --set profile=default
}
! read -r -d '' snip_disable_envoys_access_logging_1_out <<\ENDSNIP

View File

@ -69,7 +69,7 @@ EOF
}
! read -r -d '' snip_enable_custom_metrics_2_out <<\ENDSNIP
# istioctl install -f custom_metrics.yaml
# istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true -f custom_metrics.yaml
ENDSNIP
! read -r -d '' snip_enable_custom_metrics_3 <<\ENDSNIP

View File

@ -21,7 +21,7 @@
####################################################################################################
snip_before_you_begin_1() {
istioctl install --set profile=default
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true --set profile=default
}
snip_setup_1() {

View File

@ -21,7 +21,7 @@
####################################################################################################
snip_before_you_begin_1() {
istioctl install --set profile=demo --set meshConfig.trustDomain=old-td
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true --set profile=demo --set meshConfig.trustDomain=old-td
}
snip_before_you_begin_2() {
@ -74,7 +74,7 @@ kubectl exec "$(kubectl -n sleep-allow get pod -l app=sleep -o jsonpath={.items.
ENDSNIP
snip_migrate_trust_domain_without_trust_domain_aliases_1() {
istioctl install --set profile=demo --set meshConfig.trustDomain=new-td
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true --set profile=demo --set meshConfig.trustDomain=new-td
}
snip_migrate_trust_domain_without_trust_domain_aliases_2() {
@ -115,7 +115,7 @@ spec:
trustDomainAliases:
- old-td
EOF
istioctl install --set profile=demo -f td-installation.yaml -y
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true --set profile=demo -f td-installation.yaml -y
}
snip_migrate_trust_domain_with_trust_domain_aliases_2() {

View File

@ -47,7 +47,7 @@ popd
}
snip_deploy_istio_1() {
istioctl install --set profile=demo
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true --set profile=demo
}
snip_deploying_example_services_1() {

View File

@ -29,7 +29,7 @@ spec:
meshMTLS:
minProtocolVersion: TLSV1_3
EOF
istioctl install -f ./istio.yaml
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true -f ./istio.yaml
}
snip_check_the_tls_configuration_of_istio_workloads_1() {

View File

@ -21,7 +21,7 @@
####################################################################################################
snip_before_you_begin_1() {
istioctl install --set profile=demo --set meshConfig.outboundTrafficPolicy.mode=REGISTRY_ONLY
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true --set profile=demo --set meshConfig.outboundTrafficPolicy.mode=REGISTRY_ONLY
}
snip_before_you_begin_2() {

View File

@ -26,7 +26,7 @@ kubectl get crd gateways.gateway.networking.k8s.io || \
}
snip_setup_2() {
istioctl install --set profile=minimal -y
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true --set profile=minimal -y
}
snip_configuring_a_gateway_1() {

View File

@ -22,7 +22,7 @@
source "content/en/boilerplates/snips/gateway-api-support.sh"
snip_before_you_begin_1() {
istioctl install profile=minimal
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true profile=minimal
}
snip_before_you_begin_2() {

View File

@ -21,7 +21,7 @@
####################################################################################################
snip_before_you_begin_1() {
istioctl install --set profile=default --set values.pilot.env.ENABLE_TLS_ON_SIDECAR_INGRESS=true
istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true --set profile=default --set values.pilot.env.ENABLE_TLS_ON_SIDECAR_INGRESS=true
}
snip_before_you_begin_2() {

View File

@ -101,6 +101,7 @@ with open(markdown, 'rt', encoding='utf-8') as mdfile:
# Replace github file token with release-specific URL.
github_url = "https://raw.githubusercontent.com/istio/istio/" + source_branch_name
line = line.replace("{{< github_file >}}", github_url)
line = line.replace("istioctl install", "istioctl install --set values.pilot.env.PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING=true")
match = sectionhead.match(line)
if match:

View File

@ -19,13 +19,14 @@ import (
"istio.io/istio.io/pkg/test/istioio"
"istio.io/istio/pkg/test/framework"
"istio.io/istio/pkg/test/framework/components/istio"
"istio.io/istio/pkg/test/framework/resource"
)
func TestMain(m *testing.M) {
// nolint: staticcheck
framework.
NewSuite(m).
Setup(istio.Setup(nil, nil)).
Setup(istio.Setup(nil, setupConfig)).
Run()
}
@ -34,3 +35,12 @@ func TestDocs(t *testing.T) {
NewTest(t).
Run(istioio.NewTestDocsFunc("profile=default"))
}
func setupConfig(ctx resource.Context, cfg *istio.Config) {
cfg.ControlPlaneValues = `
values:
pilot:
env:
PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING: true
`
}

View File

@ -37,5 +37,11 @@ func TestDocs(t *testing.T) {
}
func setupConfig(ctx resource.Context, cfg *istio.Config) {
cfg.ControlPlaneValues = "profile: demo"
cfg.ControlPlaneValues = `
profile: demo
values:
pilot:
env:
PILOT_ENABLE_CONFIG_DISTRIBUTION_TRACKING: true
`
}