mirror of https://github.com/istio/istio.io.git
Replace cookies with local storage. (#5949)
- We don't need cookies for istio.io, the few settings we do have should be managed with browser-local storage instead. This is a better privacy posture, and avoids sending needless data to the server for every request.
This commit is contained in:
parent
a222793255
commit
6165cb9821
|
|
@ -629,17 +629,17 @@ If you have some content to display in a variety of formats, it is convenient to
|
|||
format in a different tab. To insert tabbed content, you use a combination of `tabset` and `tabs` annotations:
|
||||
|
||||
{{< text markdown >}}
|
||||
{{</* tabset cookie-name="platform" */>}}
|
||||
{{</* tabset category-name="platform" */>}}
|
||||
|
||||
{{</* tab name="One" cookie-value="one" */>}}
|
||||
{{</* tab name="One" category-value="one" */>}}
|
||||
ONE
|
||||
{{</* /tab */>}}
|
||||
|
||||
{{</* tab name="Two" cookie-value="two" */>}}
|
||||
{{</* tab name="Two" category-value="two" */>}}
|
||||
TWO
|
||||
{{</* /tab */>}}
|
||||
|
||||
{{</* tab name="Three" cookie-value="three" */>}}
|
||||
{{</* tab name="Three" category-value="three" */>}}
|
||||
THREE
|
||||
{{</* /tab */>}}
|
||||
|
||||
|
|
@ -648,17 +648,17 @@ THREE
|
|||
|
||||
which produces the following output:
|
||||
|
||||
{{< tabset cookie-name="platform" >}}
|
||||
{{< tabset category-name="platform" >}}
|
||||
|
||||
{{< tab name="One" cookie-value="one" >}}
|
||||
{{< tab name="One" category-value="one" >}}
|
||||
ONE
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Two" cookie-value="two" >}}
|
||||
{{< tab name="Two" category-value="two" >}}
|
||||
TWO
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Three" cookie-value="three" >}}
|
||||
{{< tab name="Three" category-value="three" >}}
|
||||
THREE
|
||||
{{< /tab >}}
|
||||
|
||||
|
|
@ -666,13 +666,13 @@ THREE
|
|||
|
||||
The `name` attribute of each tab contains the text to display for the tab. The content of the tab can be almost any normal markdown.
|
||||
|
||||
The optional `cookie-name` and `cookie-value` attributes allow the tab setting to be sticky across visits to the page. As the user
|
||||
selects a tab, the cookie will be automatically saved with the given name and value. If multiple tab sets use the same cookie name
|
||||
The optional `category-name` and `category-value` attributes allow the tab setting to be sticky across visits to the page. As the user
|
||||
selects a tab, the selection will be saved automatically with the given name and value. If multiple tab sets use the same category name
|
||||
and values, their setting will be automatically synchronized across pages. This is particularly useful when there are many tab sets
|
||||
in the site that hold the same types of formats.
|
||||
|
||||
For example, if many tab sets are used to represent a choice between `GCP`, `BlueMix` and `AWS`, they can all use a cookie name of `environment` and values of
|
||||
`gcp`, `bluemix`, and `aws`. When a user selects a tab in one page, the equivalent tab will automatically be selected in any other tab set.
|
||||
For example, if many tab sets are used to represent a choice between `GCP`, `BlueMix` and `AWS`, they can all use a category name of `environment` and values of
|
||||
`gcp`, `bluemix`, and `aws`. When a user selects a tab in one page, the equivalent tab will automatically be selected in any other tab set of any page visited.
|
||||
|
||||
### Limitations
|
||||
|
||||
|
|
|
|||
|
|
@ -608,9 +608,9 @@ to be 443. The egress gateway accepts the MongoDB traffic on the port 443, match
|
|||
the egress gateway monitor the identity of the source pods and to enable Mixer policy enforcement based on that
|
||||
identity.)
|
||||
|
||||
{{< tabset cookie-name="mtls" >}}
|
||||
{{< tabset category-name="mtls" >}}
|
||||
|
||||
{{< tab name="mutual TLS enabled" cookie-value="enabled" >}}
|
||||
{{< tab name="mutual TLS enabled" category-value="enabled" >}}
|
||||
|
||||
{{< text_hack bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
|
|
@ -691,7 +691,7 @@ to be 443. The egress gateway accepts the MongoDB traffic on the port 443, match
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="mutual TLS disabled" cookie-value="disabled" >}}
|
||||
{{< tab name="mutual TLS disabled" category-value="disabled" >}}
|
||||
|
||||
{{< text_hack bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
|
|
|
|||
|
|
@ -111,9 +111,9 @@ of analyzers and may find issues that older versions miss.
|
|||
|
||||
You can download the latest `istioctl` into the current folder using the following command:
|
||||
|
||||
{{< tabset cookie-name="platform" >}}
|
||||
{{< tabset category-name="platform" >}}
|
||||
|
||||
{{< tab name="Mac" cookie-value="macos" >}}
|
||||
{{< tab name="Mac" category-value="macos" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ curl https://storage.googleapis.com/istio-build/dev/latest | xargs -I {} curl https://storage.googleapis.com/istio-build/dev/{}/istioctl-{}-osx.tar.gz | tar xvz
|
||||
|
|
@ -121,7 +121,7 @@ $ curl https://storage.googleapis.com/istio-build/dev/latest | xargs -I {} curl
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Linux" cookie-value="linux" >}}
|
||||
{{< tab name="Linux" category-value="linux" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ curl https://storage.googleapis.com/istio-build/dev/latest | xargs -I {} curl https://storage.googleapis.com/istio-build/dev/{}/istioctl-{}-linux.tar.gz | tar xvz
|
||||
|
|
|
|||
|
|
@ -95,9 +95,9 @@ See [Debugging Envoy and Pilot](/docs/ops/diagnostic-tools/proxy-cmd/) for more
|
|||
|
||||
## `istioctl` auto-completion
|
||||
|
||||
{{< tabset cookie-name="prereqs" >}}
|
||||
{{< tabset category-name="prereqs" >}}
|
||||
|
||||
{{< tab name="macOS" cookie-value="macos" >}}
|
||||
{{< tab name="macOS" category-value="macos" >}}
|
||||
|
||||
If you are using the macOS operating system with the Bash terminal shell, make sure that the `bash-completion` package is installed. With the [brew](https://brew.sh) package manager for macOS, you can check to see if the `bash-completion` package is installed with the following command:
|
||||
|
||||
|
|
@ -120,7 +120,7 @@ Once the `bash-completion package` has been installed on your macOS system, add
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Linux" cookie-value="linux" >}}
|
||||
{{< tab name="Linux" category-value="linux" >}}
|
||||
|
||||
If you are using a Linux-based operating system, you can install the Bash completion package with the `apt-get install bash-completion` command for Debian-based Linux distributions or `yum install bash-completion` for RPM-based Linux distributions, the two most common occurrences.
|
||||
|
||||
|
|
@ -138,9 +138,9 @@ Once the `bash-completion` package has been installed on your Linux system, add
|
|||
|
||||
To enable `istioctl` completion on your system, follow the steps for your preferred shell:
|
||||
|
||||
{{< tabset cookie-name="profile" >}}
|
||||
{{< tabset category-name="profile" >}}
|
||||
|
||||
{{< tab name="Bash" cookie-value="bash" >}}
|
||||
{{< tab name="Bash" category-value="bash" >}}
|
||||
|
||||
Installing the bash auto-completion file
|
||||
|
||||
|
|
@ -152,7 +152,7 @@ $ source ~/istioctl.bash
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="ZSH" cookie-value="zsh" >}}
|
||||
{{< tab name="ZSH" category-value="zsh" >}}
|
||||
|
||||
Installing the ZSH auto-completion file
|
||||
|
||||
|
|
|
|||
|
|
@ -94,9 +94,9 @@ deployed and you don't want to install it.
|
|||
[Installation Options](/docs/reference/config/installation-options/) to the helm command.
|
||||
{{< /tip >}}
|
||||
|
||||
{{< tabset cookie-name="helm_profile" >}}
|
||||
{{< tabset category-name="helm_profile" >}}
|
||||
|
||||
{{< tab name="default" cookie-value="default" >}}
|
||||
{{< tab name="default" category-value="default" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ helm template install/kubernetes/helm/istio --name istio --namespace istio-system | kubectl apply -f -
|
||||
|
|
@ -104,7 +104,7 @@ $ helm template install/kubernetes/helm/istio --name istio --namespace istio-sys
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="demo" cookie-value="demo" >}}
|
||||
{{< tab name="demo" category-value="demo" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ helm template install/kubernetes/helm/istio --name istio --namespace istio-system \
|
||||
|
|
@ -113,7 +113,7 @@ $ helm template install/kubernetes/helm/istio --name istio --namespace istio-sys
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="minimal" cookie-value="minimal" >}}
|
||||
{{< tab name="minimal" category-value="minimal" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ helm template install/kubernetes/helm/istio --name istio --namespace istio-system \
|
||||
|
|
@ -122,7 +122,7 @@ $ helm template install/kubernetes/helm/istio --name istio --namespace istio-sys
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="sds" cookie-value="sds" >}}
|
||||
{{< tab name="sds" category-value="sds" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ helm template install/kubernetes/helm/istio --name istio --namespace istio-system \
|
||||
|
|
@ -131,7 +131,7 @@ $ helm template install/kubernetes/helm/istio --name istio --namespace istio-sys
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Mutual TLS enabled" cookie-value="mtls" >}}
|
||||
{{< tab name="Mutual TLS enabled" category-value="mtls" >}}
|
||||
|
||||
Enable mutual TLS in Istio by setting options `global.controlPlaneSecurityEnabled=true`
|
||||
and `global.mtls.enabled=true`, in addition to the specifying the Helm values file
|
||||
|
|
@ -148,7 +148,7 @@ $ helm template install/kubernetes/helm/istio --name istio --namespace istio-sys
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Istio CNI enabled" cookie-value="cni" >}}
|
||||
{{< tab name="Istio CNI enabled" category-value="cni" >}}
|
||||
|
||||
Install the [Istio CNI](/docs/setup/additional-setup/cni/) components:
|
||||
|
||||
|
|
@ -206,9 +206,9 @@ to manage the lifecycle of Istio.
|
|||
[Installation Options](/docs/reference/config/installation-options/) to the helm command.
|
||||
{{< /tip >}}
|
||||
|
||||
{{< tabset cookie-name="helm_profile" >}}
|
||||
{{< tabset category-name="helm_profile" >}}
|
||||
|
||||
{{< tab name="default" cookie-value="default" >}}
|
||||
{{< tab name="default" category-value="default" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ helm install install/kubernetes/helm/istio --name istio --namespace istio-system
|
||||
|
|
@ -216,7 +216,7 @@ $ helm install install/kubernetes/helm/istio --name istio --namespace istio-syst
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="demo" cookie-value="demo" >}}
|
||||
{{< tab name="demo" category-value="demo" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ helm install install/kubernetes/helm/istio --name istio --namespace istio-system \
|
||||
|
|
@ -225,7 +225,7 @@ $ helm install install/kubernetes/helm/istio --name istio --namespace istio-syst
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="minimal" cookie-value="minimal" >}}
|
||||
{{< tab name="minimal" category-value="minimal" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ helm install install/kubernetes/helm/istio --name istio --namespace istio-system \
|
||||
|
|
@ -234,7 +234,7 @@ $ helm install install/kubernetes/helm/istio --name istio --namespace istio-syst
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="sds" cookie-value="sds" >}}
|
||||
{{< tab name="sds" category-value="sds" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ helm install install/kubernetes/helm/istio --name istio --namespace istio-system \
|
||||
|
|
@ -243,7 +243,7 @@ $ helm install install/kubernetes/helm/istio --name istio --namespace istio-syst
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Mutual TLS enabled" cookie-value="mtls" >}}
|
||||
{{< tab name="Mutual TLS enabled" category-value="mtls" >}}
|
||||
|
||||
Enable mutual TLS in Istio by setting options `global.controlPlaneSecurityEnabled=true`
|
||||
and `global.mtls.enabled=true`, in addition to the specifying the Helm values file
|
||||
|
|
@ -260,7 +260,7 @@ $ helm install install/kubernetes/helm/istio --name istio --namespace istio-syst
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Istio CNI enabled" cookie-value="cni" >}}
|
||||
{{< tab name="Istio CNI enabled" category-value="cni" >}}
|
||||
|
||||
Install the [Istio CNI](/docs/setup/additional-setup/cni/) chart:
|
||||
|
||||
|
|
@ -299,9 +299,9 @@ $ helm install install/kubernetes/helm/istio --name istio --namespace istio-syst
|
|||
|
||||
- If you installed Istio using the `helm template` command, uninstall with these commands:
|
||||
|
||||
{{< tabset cookie-name="helm_profile" >}}
|
||||
{{< tabset category-name="helm_profile" >}}
|
||||
|
||||
{{< tab name="default" cookie-value="default" >}}
|
||||
{{< tab name="default" category-value="default" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ helm template install/kubernetes/helm/istio --name istio --namespace istio-system | kubectl delete -f -
|
||||
|
|
@ -310,7 +310,7 @@ $ kubectl delete namespace istio-system
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="demo" cookie-value="demo" >}}
|
||||
{{< tab name="demo" category-value="demo" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ helm template install/kubernetes/helm/istio --name istio --namespace istio-system \
|
||||
|
|
@ -320,7 +320,7 @@ $ kubectl delete namespace istio-system
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="minimal" cookie-value="minimal" >}}
|
||||
{{< tab name="minimal" category-value="minimal" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ helm template install/kubernetes/helm/istio --name istio --namespace istio-system \
|
||||
|
|
@ -330,7 +330,7 @@ $ kubectl delete namespace istio-system
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="sds" cookie-value="sds" >}}
|
||||
{{< tab name="sds" category-value="sds" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ helm template install/kubernetes/helm/istio --name istio --namespace istio-system \
|
||||
|
|
@ -340,13 +340,13 @@ $ kubectl delete namespace istio-system
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Mutual TLS enabled" cookie-value="mtls" >}}
|
||||
{{< tab name="Mutual TLS enabled" category-value="mtls" >}}
|
||||
|
||||
Follow the instructions corresponding to your selected configuration profile.
|
||||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Istio CNI enabled" cookie-value="cni" >}}
|
||||
{{< tab name="Istio CNI enabled" category-value="cni" >}}
|
||||
|
||||
Follow the instructions corresponding to your selected configuration profile
|
||||
and then execute the following command to uninstall the CNI plug-in:
|
||||
|
|
|
|||
|
|
@ -129,8 +129,8 @@ Create one of the following ConfigMaps, or update an existing one, in each
|
|||
cluster that will be calling services in remote clusters
|
||||
(every cluster in the general case):
|
||||
|
||||
{{< tabset cookie-name="platform" >}}
|
||||
{{< tab name="KubeDNS" cookie-value="kube-dns" >}}
|
||||
{{< tabset category-name="platform" >}}
|
||||
{{< tab name="KubeDNS" category-value="kube-dns" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
|
|
@ -147,7 +147,7 @@ EOF
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="CoreDNS (< 1.4.0)" cookie-value="coredns-prev-1.4.0" >}}
|
||||
{{< tab name="CoreDNS (< 1.4.0)" category-value="coredns-prev-1.4.0" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
|
|
@ -183,7 +183,7 @@ EOF
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="CoreDNS (>= 1.4.0)" cookie-value="coredns-after-1.4.0" >}}
|
||||
{{< tab name="CoreDNS (>= 1.4.0)" category-value="coredns-after-1.4.0" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
|
|
@ -364,9 +364,9 @@ The egress gateway used in this configuration cannot also be used for other, non
|
|||
|
||||
If `$CLUSTER2_GW_ADDR` is an IP address, use the `$CLUSTER2_GW_ADDR - IP address` option. If `$CLUSTER2_GW_ADDR` is a hostname, use the `$CLUSTER2_GW_ADDR - hostname` option.
|
||||
|
||||
{{< tabset cookie-name="profile" >}}
|
||||
{{< tabset category-name="profile" >}}
|
||||
|
||||
{{< tab name="$CLUSTER2_GW_ADDR - IP address" cookie-value="option1" >}}
|
||||
{{< tab name="$CLUSTER2_GW_ADDR - IP address" category-value="option1" >}}
|
||||
* Export the `cluster1` egress gateway address:
|
||||
|
||||
{{< text bash >}}
|
||||
|
|
@ -407,7 +407,7 @@ EOF
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="$CLUSTER2_GW_ADDR - hostname" cookie-value="option2" >}}
|
||||
{{< tab name="$CLUSTER2_GW_ADDR - hostname" category-value="option2" >}}
|
||||
If the `${CLUSTER2_GW_ADDR}` is a hostname, you can use `resolution: DNS` for the endpoint resolution:
|
||||
|
||||
{{< text bash >}}
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ If you have installed or are planning to install [Istio CNI](/docs/setup/additio
|
|||
choose one of the following **mutually exclusive** options to check whether
|
||||
Istio CNI is already installed and to upgrade it:
|
||||
|
||||
{{< tabset cookie-name="controlplaneupdate" >}}
|
||||
{{< tab name="Kubernetes rolling update" cookie-value="k8supdate" >}}
|
||||
{{< tabset category-name="controlplaneupdate" >}}
|
||||
{{< tab name="Kubernetes rolling update" category-value="k8supdate" >}}
|
||||
|
||||
You can use Kubernetes’ rolling update mechanism to upgrade the Istio CNI components.
|
||||
This is suitable for cases where `kubectl apply` was used to deploy Istio CNI.
|
||||
|
|
@ -65,7 +65,7 @@ This is suitable for cases where `kubectl apply` was used to deploy Istio CNI.
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Helm upgrade" cookie-value="helmupgrade" >}}
|
||||
{{< tab name="Helm upgrade" category-value="helmupgrade" >}}
|
||||
|
||||
If you installed Istio CNI using [Helm and Tiller](/docs/setup/install/helm/#option-2-install-with-helm-and-tiller-via-helm-install),
|
||||
the preferred upgrade option is to let Helm take care of the upgrade.
|
||||
|
|
@ -112,8 +112,8 @@ Pilot, Galley, Policy, Telemetry and Sidecar injector.
|
|||
Choose one of the following **mutually exclusive** options
|
||||
to update the control plane:
|
||||
|
||||
{{< tabset cookie-name="controlplaneupdate" >}}
|
||||
{{< tab name="Kubernetes rolling update" cookie-value="k8supdate" >}}
|
||||
{{< tabset category-name="controlplaneupdate" >}}
|
||||
{{< tab name="Kubernetes rolling update" category-value="k8supdate" >}}
|
||||
You can use Kubernetes’ rolling update mechanism to upgrade the control plane components.
|
||||
This is suitable for cases where `kubectl apply` was used to deploy the Istio components,
|
||||
including configurations generated using
|
||||
|
|
@ -144,7 +144,7 @@ critical issue with the new control plane, you can rollback the changes by apply
|
|||
yaml files from the old version.
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Helm upgrade" cookie-value="helmupgrade" >}}
|
||||
{{< tab name="Helm upgrade" category-value="helmupgrade" >}}
|
||||
If you installed Istio using [Helm and Tiller](/docs/setup/install/helm/#option-2-install-with-helm-and-tiller-via-helm-install),
|
||||
the preferred upgrade option is to let Helm take care of the upgrade.
|
||||
|
||||
|
|
|
|||
|
|
@ -45,9 +45,9 @@ which talks to a MongoDB backend using TCP, and then apply the authorization pol
|
|||
|
||||
1. Install `v2` of the `ratings` workload with the `bookinfo-ratings-v2` service account:
|
||||
|
||||
{{< tabset cookie-name="sidecar" >}}
|
||||
{{< tabset category-name="sidecar" >}}
|
||||
|
||||
{{< tab name="With automatic sidecar injection" cookie-value="auto" >}}
|
||||
{{< tab name="With automatic sidecar injection" category-value="auto" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl apply -f @samples/bookinfo/platform/kube/bookinfo-ratings-v2.yaml@
|
||||
|
|
@ -55,7 +55,7 @@ which talks to a MongoDB backend using TCP, and then apply the authorization pol
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="With manual sidecar injection" cookie-value="manual" >}}
|
||||
{{< tab name="With manual sidecar injection" category-value="manual" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl apply -f <(istioctl kube-inject -f @samples/bookinfo/platform/kube/bookinfo-ratings-v2.yaml@)
|
||||
|
|
@ -88,9 +88,9 @@ which talks to a MongoDB backend using TCP, and then apply the authorization pol
|
|||
|
||||
1. Deploy the MongoDB workload:
|
||||
|
||||
{{< tabset cookie-name="sidecar" >}}
|
||||
{{< tabset category-name="sidecar" >}}
|
||||
|
||||
{{< tab name="With automatic sidecar injection" cookie-value="auto" >}}
|
||||
{{< tab name="With automatic sidecar injection" category-value="auto" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl apply -f @samples/bookinfo/platform/kube/bookinfo-db.yaml@
|
||||
|
|
@ -98,7 +98,7 @@ which talks to a MongoDB backend using TCP, and then apply the authorization pol
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="With manual sidecar injection" cookie-value="manual" >}}
|
||||
{{< tab name="With manual sidecar injection" category-value="manual" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl apply -f <(istioctl kube-inject -f @samples/bookinfo/platform/kube/bookinfo-db.yaml@)
|
||||
|
|
|
|||
|
|
@ -510,9 +510,9 @@ $ kubectl delete -f @samples/sleep/sleep.yaml@
|
|||
|
||||
1. If you want to change the mode, perform the following commands:
|
||||
|
||||
{{< tabset cookie-name="outbound_traffic_policy_mode" >}}
|
||||
{{< tabset category-name="outbound_traffic_policy_mode" >}}
|
||||
|
||||
{{< tab name="change from ALLOW_ANY to REGISTRY_ONLY" cookie-value="REGISTRY_ONLY" >}}
|
||||
{{< tab name="change from ALLOW_ANY to REGISTRY_ONLY" category-value="REGISTRY_ONLY" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl get configmap istio -n istio-system -o yaml | sed 's/mode: ALLOW_ANY/mode: REGISTRY_ONLY/g' | kubectl replace -n istio-system -f -
|
||||
|
|
@ -521,7 +521,7 @@ $ kubectl delete -f @samples/sleep/sleep.yaml@
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="change from REGISTRY_ONLY to ALLOW_ANY" cookie-value="ALLOW_ANY" >}}
|
||||
{{< tab name="change from REGISTRY_ONLY to ALLOW_ANY" category-value="ALLOW_ANY" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl get configmap istio -n istio-system -o yaml | sed 's/mode: REGISTRY_ONLY/mode: ALLOW_ANY/g' | kubectl replace -n istio-system -f -
|
||||
|
|
|
|||
|
|
@ -102,9 +102,9 @@ be done by the egress gateway, as opposed to by the sidecar in the previous exam
|
|||
policy enforcement based on that identity.
|
||||
{{< /idea >}}
|
||||
|
||||
{{< tabset cookie-name="mtls" >}}
|
||||
{{< tabset category-name="mtls" >}}
|
||||
|
||||
{{< tab name="mutual TLS enabled" cookie-value="enabled" >}}
|
||||
{{< tab name="mutual TLS enabled" category-value="enabled" >}}
|
||||
|
||||
{{< text_hack bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
|
|
@ -150,7 +150,7 @@ be done by the egress gateway, as opposed to by the sidecar in the previous exam
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="mutual TLS disabled" cookie-value="disabled" >}}
|
||||
{{< tab name="mutual TLS disabled" category-value="disabled" >}}
|
||||
|
||||
{{< text_hack bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
|
|
|
|||
|
|
@ -118,9 +118,9 @@ First create a `ServiceEntry` to allow direct traffic to an external service.
|
|||
Choose the instructions corresponding to whether or not you have
|
||||
[mutual TLS Authentication](/docs/tasks/security/authentication/mutual-tls/) enabled in Istio.
|
||||
|
||||
{{< tabset cookie-name="mtls" >}}
|
||||
{{< tabset category-name="mtls" >}}
|
||||
|
||||
{{< tab name="mutual TLS enabled" cookie-value="enabled" >}}
|
||||
{{< tab name="mutual TLS enabled" category-value="enabled" >}}
|
||||
|
||||
{{< text_hack bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
|
|
@ -166,7 +166,7 @@ First create a `ServiceEntry` to allow direct traffic to an external service.
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="mutual TLS disabled" cookie-value="disabled" >}}
|
||||
{{< tab name="mutual TLS disabled" category-value="disabled" >}}
|
||||
|
||||
{{< text_hack bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
|
|
@ -326,9 +326,9 @@ You need to specify port 443 with protocol `TLS` in a corresponding `ServiceEntr
|
|||
Choose the instructions corresponding to whether or not you have
|
||||
[mutual TLS Authentication](/docs/tasks/security/authentication/mutual-tls/) enabled in Istio.
|
||||
|
||||
{{< tabset cookie-name="mtls" >}}
|
||||
{{< tabset category-name="mtls" >}}
|
||||
|
||||
{{< tab name="mutual TLS enabled" cookie-value="enabled" >}}
|
||||
{{< tab name="mutual TLS enabled" category-value="enabled" >}}
|
||||
|
||||
{{< text_hack bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
|
|
@ -409,7 +409,7 @@ You need to specify port 443 with protocol `TLS` in a corresponding `ServiceEntr
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="mutual TLS disabled" cookie-value="disabled" >}}
|
||||
{{< tab name="mutual TLS disabled" category-value="disabled" >}}
|
||||
|
||||
{{< text_hack bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
|
|
@ -663,9 +663,9 @@ external service.
|
|||
Choose the instructions corresponding to whether or not you have
|
||||
[mutual TLS Authentication](/docs/tasks/security/authentication/mutual-tls/) enabled in Istio.
|
||||
|
||||
{{< tabset cookie-name="mtls" >}}
|
||||
{{< tabset category-name="mtls" >}}
|
||||
|
||||
{{< tab name="mutual TLS enabled" cookie-value="enabled" >}}
|
||||
{{< tab name="mutual TLS enabled" category-value="enabled" >}}
|
||||
|
||||
{{< text_hack bash >}}
|
||||
$ kubectl apply -n test-egress -f - <<EOF
|
||||
|
|
@ -691,7 +691,7 @@ external service.
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="mutual TLS disabled" cookie-value="disabled" >}}
|
||||
{{< tab name="mutual TLS disabled" category-value="disabled" >}}
|
||||
|
||||
{{< text_hack bash >}}
|
||||
$ kubectl apply -n test-egress -f - <<EOF
|
||||
|
|
|
|||
|
|
@ -425,9 +425,9 @@ The SNI proxy will forward the traffic to port `443`.
|
|||
You may want to enable mutual TLS to let the egress gateway monitor the identity of the source pods and to enable Mixer policy enforcement based on that identity.
|
||||
{{< /idea >}}
|
||||
|
||||
{{< tabset cookie-name="mtls" >}}
|
||||
{{< tabset category-name="mtls" >}}
|
||||
|
||||
{{< tab name="mutual TLS enabled" cookie-value="enabled" >}}
|
||||
{{< tab name="mutual TLS enabled" category-value="enabled" >}}
|
||||
|
||||
{{< text_hack bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
|
|
@ -544,7 +544,7 @@ The SNI proxy will forward the traffic to port `443`.
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="mutual TLS disabled" cookie-value="disabled" >}}
|
||||
{{< tab name="mutual TLS disabled" category-value="disabled" >}}
|
||||
|
||||
{{< text_hack bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
|
|
|
|||
|
|
@ -42,9 +42,9 @@ In this case, you can access the gateway using the service's [node port](https:/
|
|||
|
||||
Choose the instructions corresponding to your environment:
|
||||
|
||||
{{< tabset cookie-name="gateway-ip" >}}
|
||||
{{< tabset category-name="gateway-ip" >}}
|
||||
|
||||
{{< tab name="external load balancer" cookie-value="external-lb" >}}
|
||||
{{< tab name="external load balancer" category-value="external-lb" >}}
|
||||
|
||||
Follow these instructions if you have determined that your environment has an external load balancer.
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ $ export INGRESS_HOST=$(kubectl -n istio-system get service istio-ingressgateway
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="node port" cookie-value="node-port" >}}
|
||||
{{< tab name="node port" category-value="node-port" >}}
|
||||
|
||||
Follow these instructions if you have determined that your environment does not have an external load balancer,
|
||||
so you need to use a node port instead.
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@ description: Basic tabs.
|
|||
skip_sitemap: true
|
||||
---
|
||||
|
||||
{{< tabset cookie-name="test" >}}
|
||||
{{< tabset category-name="test" >}}
|
||||
|
||||
{{< tab name="One" cookie-value="one" >}}
|
||||
{{< tab name="One" category-value="one" >}}
|
||||
One paragraph
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Two" cookie-value="two" >}}
|
||||
{{< tab name="Two" category-value="two" >}}
|
||||
Three
|
||||
|
||||
separate
|
||||
|
|
@ -18,13 +18,13 @@ separate
|
|||
paragraphs
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Three" cookie-value="three" >}}
|
||||
{{< tab name="Three" category-value="three" >}}
|
||||
{{< warning >}}
|
||||
Warning in a tab
|
||||
{{< /warning >}}
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Four" cookie-value="four" >}}
|
||||
{{< tab name="Four" category-value="four" >}}
|
||||
Simple text
|
||||
|
||||
In two paragraphs
|
||||
|
|
@ -34,7 +34,7 @@ Warning in a tab
|
|||
{{< /warning >}}
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Five" cookie-value="five" >}}
|
||||
{{< tab name="Five" category-value="five" >}}
|
||||
Simple text
|
||||
|
||||
{{< text plain >}}
|
||||
|
|
@ -43,7 +43,7 @@ Text block in a tab
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Six" cookie-value="six" >}}
|
||||
{{< tab name="Six" category-value="six" >}}
|
||||
Simple text with _markdown_ in a tab
|
||||
|
||||
{{< warning >}}
|
||||
|
|
@ -58,7 +58,7 @@ And more _markdown_
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Seven" cookie-value="seven" >}}
|
||||
{{< tab name="Seven" category-value="seven" >}}
|
||||
Simple text with _markdown_ in a tab
|
||||
|
||||
{{< text plain >}}
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@ description: Composing tabs and lists.
|
|||
skip_sitemap: true
|
||||
---
|
||||
|
||||
{{< tabset cookie-name="test" >}}
|
||||
{{< tabset category-name="test" >}}
|
||||
|
||||
{{< tab name="One" cookie-value="one" >}}
|
||||
{{< tab name="One" category-value="one" >}}
|
||||
1. One paragraph in a list in a tab
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Two" cookie-value="two" >}}
|
||||
{{< tab name="Two" category-value="two" >}}
|
||||
1. Three
|
||||
|
||||
1. separate
|
||||
|
|
@ -20,7 +20,7 @@ skip_sitemap: true
|
|||
This last bullet with two paragraphs
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Three" cookie-value="three" >}}
|
||||
{{< tab name="Three" category-value="three" >}}
|
||||
1. Simple text in a list in a tab
|
||||
|
||||
A paragraph
|
||||
|
|
@ -36,7 +36,7 @@ skip_sitemap: true
|
|||
1. Third bullet
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Four" cookie-value="four" >}}
|
||||
{{< tab name="Four" category-value="four" >}}
|
||||
1. Simple text with _markdown_ in a list in a tab
|
||||
|
||||
{{< warning >}}
|
||||
|
|
@ -44,7 +44,7 @@ skip_sitemap: true
|
|||
{{< /warning >}}
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Five" cookie-value="five" >}}
|
||||
{{< tab name="Five" category-value="five" >}}
|
||||
1. Simple text in a list in a tab
|
||||
|
||||
{{< text plain >}}
|
||||
|
|
@ -53,7 +53,7 @@ skip_sitemap: true
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Six" cookie-value="six" >}}
|
||||
{{< tab name="Six" category-value="six" >}}
|
||||
1. Simple text with _markdown_ in a list in a tab
|
||||
|
||||
{{< warning >}}
|
||||
|
|
@ -63,7 +63,7 @@ skip_sitemap: true
|
|||
1. Second bullet
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Seven" cookie-value="seven" >}}
|
||||
{{< tab name="Seven" category-value="seven" >}}
|
||||
1. Simple text with _markdown_ in a list in a tab
|
||||
|
||||
{{< text_hack bash >}}
|
||||
|
|
|
|||
|
|
@ -563,17 +563,17 @@ which looks like:
|
|||
如果您要以多种格式显示某些内容,则使用选项卡集并以不同的选项卡显示每种格式会很方便。要插入选项卡式内容,请结合使用 `tabset` 和 `tabs` 注解:
|
||||
|
||||
{{< text markdown >}}
|
||||
{{</* tabset cookie-name="platform" */>}}
|
||||
{{</* tabset category-name="platform" */>}}
|
||||
|
||||
{{</* tab name="One" cookie-value="one" */>}}
|
||||
{{</* tab name="One" category-value="one" */>}}
|
||||
一
|
||||
{{</* /tab */>}}
|
||||
|
||||
{{</* tab name="Two" cookie-value="two" */>}}
|
||||
{{</* tab name="Two" category-value="two" */>}}
|
||||
二
|
||||
{{</* /tab */>}}
|
||||
|
||||
{{</* tab name="Three" cookie-value="three" */>}}
|
||||
{{</* tab name="Three" category-value="three" */>}}
|
||||
三
|
||||
{{</* /tab */>}}
|
||||
|
||||
|
|
@ -582,17 +582,17 @@ which looks like:
|
|||
|
||||
产生如下输出:
|
||||
|
||||
{{< tabset cookie-name="platform" >}}
|
||||
{{< tabset category-name="platform" >}}
|
||||
|
||||
{{< tab name="One" cookie-value="one" >}}
|
||||
{{< tab name="One" category-value="one" >}}
|
||||
一
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Two" cookie-value="two" >}}
|
||||
{{< tab name="Two" category-value="two" >}}
|
||||
二
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Three" cookie-value="three" >}}
|
||||
{{< tab name="Three" category-value="three" >}}
|
||||
三
|
||||
{{< /tab >}}
|
||||
|
||||
|
|
@ -600,7 +600,7 @@ which looks like:
|
|||
|
||||
每个选项卡的 `name` 属性包含要为该选项卡显示的文本。标签的内容几乎可以是任何常见的 markdown 格式。
|
||||
|
||||
可选的 `cookie-name` 和 `cookie-value` 属性允许选项卡设置在访问页面时保持粘性。当用户选择一个选项卡时,该 cookie 将自动以给定的名称和值保存。如果多个选项卡集使用相同的 cookie 名称和值,则它们的设置将在页面之间自动同步。当站点中有许多标签集具有相同类型的格式时,此功能特别有用。
|
||||
可选的 `category-name` 和 `category-value` 属性允许选项卡设置在访问页面时保持粘性。当用户选择一个选项卡时,该 cookie 将自动以给定的名称和值保存。如果多个选项卡集使用相同的 cookie 名称和值,则它们的设置将在页面之间自动同步。当站点中有许多标签集具有相同类型的格式时,此功能特别有用。
|
||||
|
||||
例如,如果许多选项卡集用于表示 `GCP`、`BlueMix` 和 `AWS` 之间的选择,则它们都可以使用环境的 cookie 名称以及 `gcp`、`bluemix` 和 `aws` 的值。 当用户在一页中选择一个选项卡时,等效选项卡将自动在任何其他选项卡集中选择。
|
||||
|
||||
|
|
|
|||
|
|
@ -608,9 +608,9 @@ to be 443. The egress gateway accepts the MongoDB traffic on the port 443, match
|
|||
the egress gateway monitor the identity of the source pods and to enable Mixer policy enforcement based on that
|
||||
identity.)
|
||||
|
||||
{{< tabset cookie-name="mtls" >}}
|
||||
{{< tabset category-name="mtls" >}}
|
||||
|
||||
{{< tab name="mutual TLS enabled" cookie-value="enabled" >}}
|
||||
{{< tab name="mutual TLS enabled" category-value="enabled" >}}
|
||||
|
||||
{{< text_hack bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
|
|
@ -691,7 +691,7 @@ to be 443. The egress gateway accepts the MongoDB traffic on the port 443, match
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="mutual TLS disabled" cookie-value="disabled" >}}
|
||||
{{< tab name="mutual TLS disabled" category-value="disabled" >}}
|
||||
|
||||
{{< text_hack bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ keywords: [istioctl, debugging, kubernetes]
|
|||
|
||||
入门非常简单。 首先,使用一个命令将最新的 `istioctl` 下载到当前文件夹中(下载最新版本以确保它具有最完整的分析器集):
|
||||
|
||||
{{< tabset cookie-name="platform" >}}
|
||||
{{< tabset category-name="platform" >}}
|
||||
|
||||
{{< tab name="Mac" cookie-value="macos" >}}
|
||||
{{< tab name="Mac" category-value="macos" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ curl https://storage.googleapis.com/istio-build/dev/latest | xargs -I {} curl https://storage.googleapis.com/istio-build/dev/{}/istioctl-{}-osx.tar.gz | tar xvz
|
||||
|
|
@ -24,7 +24,7 @@ $ curl https://storage.googleapis.com/istio-build/dev/latest | xargs -I {} curl
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Linux" cookie-value="linux" >}}
|
||||
{{< tab name="Linux" category-value="linux" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ curl https://storage.googleapis.com/istio-build/dev/latest | xargs -I {} curl https://storage.googleapis.com/istio-build/dev/{}/istioctl-{}-linux.tar.gz | tar xvz
|
||||
|
|
|
|||
|
|
@ -66,9 +66,9 @@ $ istioctl proxy-config endpoints <pod-name> [flags]
|
|||
|
||||
## `Istioctl` 自动补全 {#auto-completion}
|
||||
|
||||
{{< tabset cookie-name="prereqs" >}}
|
||||
{{< tabset category-name="prereqs" >}}
|
||||
|
||||
{{< tab name="macOS" cookie-value="macos" >}}
|
||||
{{< tab name="macOS" category-value="macos" >}}
|
||||
|
||||
如果您使用的是 macOS 操作系统的Bash终端,确认已安装 `bash-completion` 包。使用 macOS 下 [brew](https://brew.sh) 包管理器,您可以通过以下命令检查 `bash-completion` 包是否已经安装:
|
||||
|
||||
|
|
@ -91,7 +91,7 @@ $ brew install bash-completion
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Linux" cookie-value="linux" >}}
|
||||
{{< tab name="Linux" category-value="linux" >}}
|
||||
|
||||
如果您使用基于 Linux 的操作系统,以两种最常见的情况举例,您可以使用 `apt-get install bash-completion` 命令安装基于 Debian 的 Linux 发行版的 base-completion 包,或者使用 `yum install bash-completion` 安装基于 RPM 的 Linux 发行版的包。
|
||||
|
||||
|
|
@ -109,9 +109,9 @@ $ brew install bash-completion
|
|||
|
||||
根据您选择的 shell,按照以下步骤在您的系统开启 `istioctl` 命令补全 :
|
||||
|
||||
{{< tabset cookie-name="profile" >}}
|
||||
{{< tabset category-name="profile" >}}
|
||||
|
||||
{{< tab name="Bash" cookie-value="bash" >}}
|
||||
{{< tab name="Bash" category-value="bash" >}}
|
||||
|
||||
安装 bash 自动补全文件
|
||||
|
||||
|
|
@ -123,7 +123,7 @@ $ source ~/istioctl.bash
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="ZSH" cookie-value="zsh" >}}
|
||||
{{< tab name="ZSH" category-value="zsh" >}}
|
||||
|
||||
安装 ZSH 自动补全文件
|
||||
|
||||
|
|
|
|||
|
|
@ -84,9 +84,9 @@ $ helm repo add istio.io https://storage.googleapis.com/istio-release/releases/{
|
|||
您可以添加一个或多个 `--set <key>=<value>` 来进一步自定义 helm 命令的 [安装选项](/zh/docs/reference/config/installation-options/) 。
|
||||
{{< /tip >}}
|
||||
|
||||
{{< tabset cookie-name="helm_profile" >}}
|
||||
{{< tabset category-name="helm_profile" >}}
|
||||
|
||||
{{< tab name="default" cookie-value="default" >}}
|
||||
{{< tab name="default" category-value="default" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ helm template install/kubernetes/helm/istio --name istio --namespace istio-system | kubectl apply -f -
|
||||
|
|
@ -94,7 +94,7 @@ $ helm template install/kubernetes/helm/istio --name istio --namespace istio-sys
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="demo" cookie-value="demo" >}}
|
||||
{{< tab name="demo" category-value="demo" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ helm template install/kubernetes/helm/istio --name istio --namespace istio-system \
|
||||
|
|
@ -103,7 +103,7 @@ $ helm template install/kubernetes/helm/istio --name istio --namespace istio-sys
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="minimal" cookie-value="minimal" >}}
|
||||
{{< tab name="minimal" category-value="minimal" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ helm template install/kubernetes/helm/istio --name istio --namespace istio-system \
|
||||
|
|
@ -112,7 +112,7 @@ $ helm template install/kubernetes/helm/istio --name istio --namespace istio-sys
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="sds" cookie-value="sds" >}}
|
||||
{{< tab name="sds" category-value="sds" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ helm template install/kubernetes/helm/istio --name istio --namespace istio-system \
|
||||
|
|
@ -121,7 +121,7 @@ $ helm template install/kubernetes/helm/istio --name istio --namespace istio-sys
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Istio CNI enabled" cookie-value="cni" >}}
|
||||
{{< tab name="Istio CNI enabled" category-value="cni" >}}
|
||||
|
||||
安装 [Istio CNI](/zh/docs/setup/additional-setup/cni/) 组件:
|
||||
|
||||
|
|
@ -177,9 +177,9 @@ $ helm template install/kubernetes/helm/istio --name istio --namespace istio-sys
|
|||
[安装选项](/zh/docs/reference/config/installation-options/)。
|
||||
{{< /tip >}}
|
||||
|
||||
{{< tabset cookie-name="helm_profile" >}}
|
||||
{{< tabset category-name="helm_profile" >}}
|
||||
|
||||
{{< tab name="default" cookie-value="default" >}}
|
||||
{{< tab name="default" category-value="default" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ helm install install/kubernetes/helm/istio --name istio --namespace istio-system
|
||||
|
|
@ -187,7 +187,7 @@ $ helm install install/kubernetes/helm/istio --name istio --namespace istio-syst
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="demo" cookie-value="demo" >}}
|
||||
{{< tab name="demo" category-value="demo" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ helm install install/kubernetes/helm/istio --name istio --namespace istio-system \
|
||||
|
|
@ -196,7 +196,7 @@ $ helm install install/kubernetes/helm/istio --name istio --namespace istio-syst
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="minimal" cookie-value="minimal" >}}
|
||||
{{< tab name="minimal" category-value="minimal" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ helm install install/kubernetes/helm/istio --name istio --namespace istio-system \
|
||||
|
|
@ -205,7 +205,7 @@ $ helm install install/kubernetes/helm/istio --name istio --namespace istio-syst
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="sds" cookie-value="sds" >}}
|
||||
{{< tab name="sds" category-value="sds" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ helm install install/kubernetes/helm/istio --name istio --namespace istio-system \
|
||||
|
|
@ -214,7 +214,7 @@ $ helm install install/kubernetes/helm/istio --name istio --namespace istio-syst
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Istio CNI enabled" cookie-value="cni" >}}
|
||||
{{< tab name="Istio CNI enabled" category-value="cni" >}}
|
||||
|
||||
安装 [Istio CNI](/zh/docs/setup/additional-setup/cni/) chart:
|
||||
|
||||
|
|
@ -251,9 +251,9 @@ $ helm install install/kubernetes/helm/istio --name istio --namespace istio-syst
|
|||
|
||||
- 如果你使用 `helm template` 命令安装的 Istio,使用如下命令卸载:
|
||||
|
||||
{{< tabset cookie-name="helm_profile" >}}
|
||||
{{< tabset category-name="helm_profile" >}}
|
||||
|
||||
{{< tab name="default" cookie-value="default" >}}
|
||||
{{< tab name="default" category-value="default" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ helm template install/kubernetes/helm/istio --name istio --namespace istio-system | kubectl delete -f -
|
||||
|
|
@ -262,7 +262,7 @@ $ kubectl delete namespace istio-system
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="demo" cookie-value="demo" >}}
|
||||
{{< tab name="demo" category-value="demo" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ helm template install/kubernetes/helm/istio --name istio --namespace istio-system \
|
||||
|
|
@ -272,7 +272,7 @@ $ kubectl delete namespace istio-system
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="minimal" cookie-value="minimal" >}}
|
||||
{{< tab name="minimal" category-value="minimal" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ helm template install/kubernetes/helm/istio --name istio --namespace istio-system \
|
||||
|
|
@ -282,7 +282,7 @@ $ kubectl delete namespace istio-system
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="sds" cookie-value="sds" >}}
|
||||
{{< tab name="sds" category-value="sds" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ helm template install/kubernetes/helm/istio --name istio --namespace istio-system \
|
||||
|
|
@ -292,7 +292,7 @@ $ kubectl delete namespace istio-system
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Istio CNI enabled" cookie-value="cni" >}}
|
||||
{{< tab name="Istio CNI enabled" category-value="cni" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ helm template install/kubernetes/helm/istio --name istio --namespace istio-system \
|
||||
|
|
|
|||
|
|
@ -99,8 +99,8 @@ Istio 还附带了一个名为 CoreDNS 的服务,它可以为这些服务提
|
|||
在每个要调用远端集群中服务的集群中(通常是所有集群),
|
||||
选择并创建下面这些 ConfigMaps 中的一个,或直接使用现有的做修改。
|
||||
|
||||
{{< tabset cookie-name="platform" >}}
|
||||
{{< tab name="KubeDNS" cookie-value="kube-dns" >}}
|
||||
{{< tabset category-name="platform" >}}
|
||||
{{< tab name="KubeDNS" category-value="kube-dns" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
|
|
@ -117,7 +117,7 @@ EOF
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="CoreDNS (< 1.4.0)" cookie-value="coredns-prev-1.4.0" >}}
|
||||
{{< tab name="CoreDNS (< 1.4.0)" category-value="coredns-prev-1.4.0" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
|
|
@ -153,7 +153,7 @@ EOF
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="CoreDNS (>= 1.4.0)" cookie-value="coredns-after-1.4.0" >}}
|
||||
{{< tab name="CoreDNS (>= 1.4.0)" category-value="coredns-after-1.4.0" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
|
|
@ -321,9 +321,9 @@ service entry 使用的 host 应该采用如下格式:`<name>.<namespace>.glob
|
|||
|
||||
如果 `$CLUSTER2_GW_ADDR` 是 IP 地址,请使用 `$CLUSTER2_GW_ADDR - IP address` 选项。如果 `$CLUSTER2_GW_ADDR` 是域名,请使用 `$CLUSTER2_GW_ADDR - hostname` 选项。
|
||||
|
||||
{{< tabset cookie-name="profile" >}}
|
||||
{{< tabset category-name="profile" >}}
|
||||
|
||||
{{< tab name="$CLUSTER2_GW_ADDR - IP address" cookie-value="option1" >}}
|
||||
{{< tab name="$CLUSTER2_GW_ADDR - IP address" category-value="option1" >}}
|
||||
* 暴露 `cluster1` egress gateway 地址:
|
||||
|
||||
{{< text bash >}}
|
||||
|
|
@ -364,7 +364,7 @@ EOF
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="$CLUSTER2_GW_ADDR - hostname" cookie-value="option2" >}}
|
||||
{{< tab name="$CLUSTER2_GW_ADDR - hostname" category-value="option2" >}}
|
||||
如果 `${CLUSTER2_GW_ADDR}` 是域名,您也可以使用 `resolution: DNS` 实现 endpoint 解析。
|
||||
|
||||
{{< text bash >}}
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ Istio **不支持** 跨版本升级。仅支持从 {{< istio_previous_version >}
|
|||
|
||||
如果您已经安装或计划安装 [Istio CNI](/zh/docs/setup/additional-setup/cni/),请选择以下 **互斥** 选项之一,检查 Istio CNI 是否已经安装并进行升级:
|
||||
|
||||
{{< tabset cookie-name="controlplaneupdate" >}}
|
||||
{{< tab name="Kubernetes rolling update" cookie-value="k8supdate" >}}
|
||||
{{< tabset category-name="controlplaneupdate" >}}
|
||||
{{< tab name="Kubernetes rolling update" category-value="k8supdate" >}}
|
||||
|
||||
您可以使用 Kubernetes 的滚动更新机制来升级 Istio CNI 组件。这适用于使用 `kubectl apply` 部署 Istio CNI 的情况。
|
||||
|
||||
|
|
@ -52,7 +52,7 @@ Istio **不支持** 跨版本升级。仅支持从 {{< istio_previous_version >}
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Helm upgrade" cookie-value="helmupgrade" >}}
|
||||
{{< tab name="Helm upgrade" category-value="helmupgrade" >}}
|
||||
|
||||
如果您已使用 [Helm and Tiller](/zh/docs/setup/install/helm/#option-2-install-with-helm-and-tiller-via-helm-install) 安装 Istio CNI,请优先使用 Helm 升级 Istio CNI。
|
||||
|
||||
|
|
@ -96,8 +96,8 @@ Istio **不支持** 跨版本升级。仅支持从 {{< istio_previous_version >}
|
|||
Pilot, Galley, 策略, 遥测和 Sidecar 注入器。
|
||||
选择下列 **互斥** 选项中的一种升级控制平面:
|
||||
|
||||
{{< tabset cookie-name="controlplaneupdate" >}}
|
||||
{{< tab name="Kubernetes rolling update" cookie-value="k8supdate" >}}
|
||||
{{< tabset category-name="controlplaneupdate" >}}
|
||||
{{< tab name="Kubernetes rolling update" category-value="k8supdate" >}}
|
||||
|
||||
您可以使用 Kubernetes 的滚动升级机制来升级控制平面组件。这适用于使用 `kubectl apply` 部署 Istio 组件的情况,包括使用 [Helm template](/zh/docs/setup/install/helm/#option-1-install-with-helm-via-helm-template) 生成的配置。
|
||||
|
||||
|
|
@ -124,7 +124,7 @@ Pilot, Galley, 策略, 遥测和 Sidecar 注入器。
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Helm upgrade" cookie-value="helmupgrade" >}}
|
||||
{{< tab name="Helm upgrade" category-value="helmupgrade" >}}
|
||||
|
||||
如果您使用 [Helm and Tiller](/zh/docs/setup/install/helm/#option-2-install-with-helm-and-tiller-via-helm-install) 安装 Istio,推荐的方式是使用 Helm 来进行升级。
|
||||
|
||||
|
|
|
|||
|
|
@ -39,9 +39,9 @@ aliases:
|
|||
|
||||
1. 使用 `bookinfo-ratings-v2` 服务账户安装 `ratings` 工作负载的 `v2` 版本:
|
||||
|
||||
{{< tabset cookie-name="sidecar" >}}
|
||||
{{< tabset category-name="sidecar" >}}
|
||||
|
||||
{{< tab name="With automatic sidecar injection" cookie-value="auto" >}}
|
||||
{{< tab name="With automatic sidecar injection" category-value="auto" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl apply -f @samples/bookinfo/platform/kube/bookinfo-ratings-v2.yaml@
|
||||
|
|
@ -49,7 +49,7 @@ aliases:
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="With manual sidecar injection" cookie-value="manual" >}}
|
||||
{{< tab name="With manual sidecar injection" category-value="manual" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl apply -f <(istioctl kube-inject -f @samples/bookinfo/platform/kube/bookinfo-ratings-v2.yaml@)
|
||||
|
|
@ -80,9 +80,9 @@ aliases:
|
|||
|
||||
1. 部署 MongoDB 工作负载:
|
||||
|
||||
{{< tabset cookie-name="sidecar" >}}
|
||||
{{< tabset category-name="sidecar" >}}
|
||||
|
||||
{{< tab name="With automatic sidecar injection" cookie-value="auto" >}}
|
||||
{{< tab name="With automatic sidecar injection" category-value="auto" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl apply -f @samples/bookinfo/platform/kube/bookinfo-db.yaml@
|
||||
|
|
@ -90,7 +90,7 @@ aliases:
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="With manual sidecar injection" cookie-value="manual" >}}
|
||||
{{< tab name="With manual sidecar injection" category-value="manual" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl apply -f <(istioctl kube-inject -f @samples/bookinfo/platform/kube/bookinfo-db.yaml@)
|
||||
|
|
|
|||
|
|
@ -508,9 +508,9 @@ $ kubectl delete -f @samples/sleep/sleep.yaml@
|
|||
|
||||
1. If you want to change the mode, perform the following commands:
|
||||
|
||||
{{< tabset cookie-name="outbound_traffic_policy_mode" >}}
|
||||
{{< tabset category-name="outbound_traffic_policy_mode" >}}
|
||||
|
||||
{{< tab name="change from ALLOW_ANY to REGISTRY_ONLY" cookie-value="REGISTRY_ONLY" >}}
|
||||
{{< tab name="change from ALLOW_ANY to REGISTRY_ONLY" category-value="REGISTRY_ONLY" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl get configmap istio -n istio-system -o yaml | sed 's/mode: ALLOW_ANY/mode: REGISTRY_ONLY/g' | kubectl replace -n istio-system -f -
|
||||
|
|
@ -519,7 +519,7 @@ $ kubectl delete -f @samples/sleep/sleep.yaml@
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="change from REGISTRY_ONLY to ALLOW_ANY" cookie-value="ALLOW_ANY" >}}
|
||||
{{< tab name="change from REGISTRY_ONLY to ALLOW_ANY" category-value="ALLOW_ANY" >}}
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl get configmap istio -n istio-system -o yaml | sed 's/mode: REGISTRY_ONLY/mode: ALLOW_ANY/g' | kubectl replace -n istio-system -f -
|
||||
|
|
|
|||
|
|
@ -94,9 +94,9 @@ aliases:
|
|||
此外,双向 TLS 将允许 egress 网关监控源 pods 的身份,并开启 Mixer 基于该身份标识的强制策略实施。
|
||||
{{< /idea >}}
|
||||
|
||||
{{< tabset cookie-name="mtls" >}}
|
||||
{{< tabset category-name="mtls" >}}
|
||||
|
||||
{{< tab name="mutual TLS enabled" cookie-value="enabled" >}}
|
||||
{{< tab name="mutual TLS enabled" category-value="enabled" >}}
|
||||
|
||||
{{< text_hack bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
|
|
@ -142,7 +142,7 @@ aliases:
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="mutual TLS disabled" cookie-value="disabled" >}}
|
||||
{{< tab name="mutual TLS disabled" category-value="disabled" >}}
|
||||
|
||||
{{< text_hack bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
|
|
|
|||
|
|
@ -98,9 +98,9 @@ Ingress gateway 使您可以定义所有输入流量流经的网格的入口点
|
|||
|
||||
根据在 Istio 中是否启用了[双向 TLS 认证](/zh/docs/tasks/security/authentication/mutual-tls/),选择相应的说明。
|
||||
|
||||
{{< tabset cookie-name="mtls" >}}
|
||||
{{< tabset category-name="mtls" >}}
|
||||
|
||||
{{< tab name="mutual TLS enabled" cookie-value="enabled" >}}
|
||||
{{< tab name="mutual TLS enabled" category-value="enabled" >}}
|
||||
|
||||
{{< text_hack bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
|
|
@ -146,7 +146,7 @@ Ingress gateway 使您可以定义所有输入流量流经的网格的入口点
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="mutual TLS disabled" cookie-value="disabled" >}}
|
||||
{{< tab name="mutual TLS disabled" category-value="disabled" >}}
|
||||
|
||||
{{< text_hack bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
|
|
@ -301,9 +301,9 @@ $ kubectl delete destinationrule egressgateway-for-cnn
|
|||
|
||||
根据在 Istio 中是否启用了[双向 TLS](/zh/docs/tasks/security/authentication/mutual-tls/),选择相应的说明。
|
||||
|
||||
{{< tabset cookie-name="mtls" >}}
|
||||
{{< tabset category-name="mtls" >}}
|
||||
|
||||
{{< tab name="mutual TLS enabled" cookie-value="enabled" >}}
|
||||
{{< tab name="mutual TLS enabled" category-value="enabled" >}}
|
||||
|
||||
{{< text_hack bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
|
|
@ -384,7 +384,7 @@ $ kubectl delete destinationrule egressgateway-for-cnn
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="mutual TLS disabled" cookie-value="disabled" >}}
|
||||
{{< tab name="mutual TLS disabled" category-value="disabled" >}}
|
||||
|
||||
{{< text_hack bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
|
|
@ -611,9 +611,9 @@ $ kubectl delete destinationrule egressgateway-for-cnn
|
|||
|
||||
根据在 Istio 中是否启用了[双向 TLS](/zh/docs/tasks/security/authentication/mutual-tls/),选择相应的说明。
|
||||
|
||||
{{< tabset cookie-name="mtls" >}}
|
||||
{{< tabset category-name="mtls" >}}
|
||||
|
||||
{{< tab name="mutual TLS enabled" cookie-value="enabled" >}}
|
||||
{{< tab name="mutual TLS enabled" category-value="enabled" >}}
|
||||
|
||||
{{< text_hack bash >}}
|
||||
$ kubectl apply -n test-egress -f - <<EOF
|
||||
|
|
@ -639,7 +639,7 @@ $ kubectl delete destinationrule egressgateway-for-cnn
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="mutual TLS disabled" cookie-value="disabled" >}}
|
||||
{{< tab name="mutual TLS disabled" category-value="disabled" >}}
|
||||
|
||||
{{< text_hack bash >}}
|
||||
$ kubectl apply -n test-egress -f - <<EOF
|
||||
|
|
|
|||
|
|
@ -388,9 +388,9 @@ SNI 代理会将流量转发到 `443` 端口。
|
|||
您可能需要启用双向 TLS,以使 egress gateway 监视源 Pod 的身份,并基于该身份启用 Mixer 策略实施。
|
||||
{{< /idea >}}
|
||||
|
||||
{{< tabset cookie-name="mtls" >}}
|
||||
{{< tabset category-name="mtls" >}}
|
||||
|
||||
{{< tab name="mutual TLS enabled" cookie-value="enabled" >}}
|
||||
{{< tab name="mutual TLS enabled" category-value="enabled" >}}
|
||||
|
||||
{{< text_hack bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
|
|
@ -502,7 +502,7 @@ SNI 代理会将流量转发到 `443` 端口。
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="mutual TLS disabled" cookie-value="disabled" >}}
|
||||
{{< tab name="mutual TLS disabled" category-value="disabled" >}}
|
||||
|
||||
{{< text_hack bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
|
|
|
|||
|
|
@ -40,9 +40,9 @@ istio-ingressgateway LoadBalancer 172.21.109.129 130.211.10.121 80:31380/
|
|||
|
||||
选择符合自身环境的指令执行:
|
||||
|
||||
{{< tabset cookie-name="gateway-ip" >}}
|
||||
{{< tabset category-name="gateway-ip" >}}
|
||||
|
||||
{{< tab name="external load balancer" cookie-value="external-lb" >}}
|
||||
{{< tab name="external load balancer" category-value="external-lb" >}}
|
||||
|
||||
若已确定自身环境使用了外部负载均衡器,执行如下指令。
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ $ export INGRESS_HOST=$(kubectl -n istio-system get service istio-ingressgateway
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="node port" cookie-value="node-port" >}}
|
||||
{{< tab name="node port" category-value="node-port" >}}
|
||||
|
||||
若自身环境未使用外部负载均衡器,需要通过 node port 访问。执行如下命令。
|
||||
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@ description: Basic tabs.
|
|||
skip_sitemap: true
|
||||
---
|
||||
|
||||
{{< tabset cookie-name="test" >}}
|
||||
{{< tabset category-name="test" >}}
|
||||
|
||||
{{< tab name="One" cookie-value="one" >}}
|
||||
{{< tab name="One" category-value="one" >}}
|
||||
One paragraph
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Two" cookie-value="two" >}}
|
||||
{{< tab name="Two" category-value="two" >}}
|
||||
Three
|
||||
|
||||
separate
|
||||
|
|
@ -18,13 +18,13 @@ separate
|
|||
paragraphs
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Three" cookie-value="three" >}}
|
||||
{{< tab name="Three" category-value="three" >}}
|
||||
{{< warning >}}
|
||||
Warning in a tab
|
||||
{{< /warning >}}
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Four" cookie-value="four" >}}
|
||||
{{< tab name="Four" category-value="four" >}}
|
||||
Simple text
|
||||
|
||||
In two paragraphs
|
||||
|
|
@ -34,7 +34,7 @@ Warning in a tab
|
|||
{{< /warning >}}
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Five" cookie-value="five" >}}
|
||||
{{< tab name="Five" category-value="five" >}}
|
||||
Simple text
|
||||
|
||||
{{< text plain >}}
|
||||
|
|
@ -43,7 +43,7 @@ Text block in a tab
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Six" cookie-value="six" >}}
|
||||
{{< tab name="Six" category-value="six" >}}
|
||||
Simple text with _markdown_ in a tab
|
||||
|
||||
{{< warning >}}
|
||||
|
|
@ -58,7 +58,7 @@ And more _markdown_
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Seven" cookie-value="seven" >}}
|
||||
{{< tab name="Seven" category-value="seven" >}}
|
||||
Simple text with _markdown_ in a tab
|
||||
|
||||
{{< text plain >}}
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@ description: Composing tabs and lists.
|
|||
skip_sitemap: true
|
||||
---
|
||||
|
||||
{{< tabset cookie-name="test" >}}
|
||||
{{< tabset category-name="test" >}}
|
||||
|
||||
{{< tab name="One" cookie-value="one" >}}
|
||||
{{< tab name="One" category-value="one" >}}
|
||||
1. One paragraph in a list in a tab
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Two" cookie-value="two" >}}
|
||||
{{< tab name="Two" category-value="two" >}}
|
||||
1. Three
|
||||
|
||||
1. separate
|
||||
|
|
@ -20,7 +20,7 @@ skip_sitemap: true
|
|||
This last bullet with two paragraphs
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Three" cookie-value="three" >}}
|
||||
{{< tab name="Three" category-value="three" >}}
|
||||
1. Simple text in a list in a tab
|
||||
|
||||
A paragraph
|
||||
|
|
@ -36,7 +36,7 @@ skip_sitemap: true
|
|||
1. Third bullet
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Four" cookie-value="four" >}}
|
||||
{{< tab name="Four" category-value="four" >}}
|
||||
1. Simple text with _markdown_ in a list in a tab
|
||||
|
||||
{{< warning >}}
|
||||
|
|
@ -44,7 +44,7 @@ skip_sitemap: true
|
|||
{{< /warning >}}
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Five" cookie-value="five" >}}
|
||||
{{< tab name="Five" category-value="five" >}}
|
||||
1. Simple text in a list in a tab
|
||||
|
||||
{{< text plain >}}
|
||||
|
|
@ -53,7 +53,7 @@ skip_sitemap: true
|
|||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Six" cookie-value="six" >}}
|
||||
{{< tab name="Six" category-value="six" >}}
|
||||
1. Simple text with _markdown_ in a list in a tab
|
||||
|
||||
{{< warning >}}
|
||||
|
|
@ -63,7 +63,7 @@ skip_sitemap: true
|
|||
1. Second bullet
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="Seven" cookie-value="seven" >}}
|
||||
{{< tab name="Seven" category-value="seven" >}}
|
||||
1. Simple text with _markdown_ in a list in a tab
|
||||
|
||||
{{< text_hack bash >}}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
{{- if .Parent -}}
|
||||
{{- $name := trim (.Get "name") " " -}}
|
||||
{{- $cookie_value := trim (.Get "cookie-value") " " -}}
|
||||
{{- $category_value := trim (.Get "category-value") " " -}}
|
||||
{{- if not (.Parent.Scratch.Get "tabs") -}}
|
||||
{{- .Parent.Scratch.Set "tabs" slice -}}
|
||||
{{- end -}}
|
||||
{{- $.Parent.Scratch.Add "tabs" (dict "name" $name "cookie_value" $cookie_value "content" .Inner) -}}
|
||||
{{- $.Parent.Scratch.Add "tabs" (dict "name" $name "category_value" $category_value "content" .Inner) -}}
|
||||
{{- else -}}
|
||||
{{- errorf "Missing surrounding tabset for tab (%s)" .Position -}}
|
||||
{{- end -}}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
{{- .Page.Scratch.Add "tabset-counter" 1 -}}
|
||||
{{- $tab_set_id := default (printf "tabset-%s-%d" (.Page.RelPermalink) (.Page.Scratch.Get "tabset-counter") ) | anchorize -}}
|
||||
{{- $tabs := .Scratch.Get "tabs" -}}
|
||||
{{- $cookie_name := trim (.Get "cookie-name") " " -}}
|
||||
{{- $category_name := trim (.Get "category-name") " " -}}
|
||||
|
||||
{{- if .Inner -}}
|
||||
{{- /* We don't use the inner content, but Hugo needs this reference as a trigger to indicate this shortcode has a content area. */ -}}
|
||||
{{- end -}}
|
||||
|
||||
<div id="{{ $tab_set_id }}" role="tablist" class="tabset">
|
||||
<div class="tab-strip" data-cookie-name="{{ $cookie_name }}">
|
||||
<div class="tab-strip" data-category-name="{{ $category_name }}">
|
||||
{{- range $i, $e := $tabs -}}
|
||||
{{- $id := printf "%s-%d" $tab_set_id $i -}}
|
||||
<button {{ if eq $i 0 }}aria-selected="true"{{ else }}tabindex="-1"{{ end }} data-cookie-value="{{ .cookie_value }}"
|
||||
<button {{ if eq $i 0 }}aria-selected="true"{{ else }}tabindex="-1"{{ end }} data-category-value="{{ .category_value }}"
|
||||
aria-controls="{{ $id }}-panel" id="{{ $id }}-tab" role="tab"><span>{{ trim .name " " }}</span>
|
||||
</button>
|
||||
{{- end -}}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ let syntaxColoring = true;
|
|||
// All the voodoo needed to support our fancy code blocks
|
||||
function handleCodeBlocks() {
|
||||
const toolbarShow = "toolbar-show";
|
||||
const syntaxColoringCookie = "syntax-coloring";
|
||||
const syntaxColoringStorageItem = "syntax-coloring";
|
||||
const syntaxColoringItem = "syntax-coloring-item";
|
||||
|
||||
// Add a toolbar to all PRE blocks
|
||||
|
|
@ -343,10 +343,10 @@ function handleCodeBlocks() {
|
|||
}
|
||||
|
||||
function handleSyntaxColoringOption(): void {
|
||||
const cookieValue = readCookie(syntaxColoringCookie);
|
||||
if (cookieValue === "true") {
|
||||
const setting = readLocalStorage(syntaxColoringStorageItem);
|
||||
if (setting === "true") {
|
||||
syntaxColoring = true;
|
||||
} else if (cookieValue === "false") {
|
||||
} else if (setting === "false") {
|
||||
syntaxColoring = false;
|
||||
}
|
||||
|
||||
|
|
@ -360,7 +360,7 @@ function handleCodeBlocks() {
|
|||
}
|
||||
|
||||
listen(getById(syntaxColoringItem), click, () => {
|
||||
createCookie(syntaxColoringCookie, syntaxColoring ? "false" : "true");
|
||||
localStorage.setItem(syntaxColoringStorageItem, syntaxColoring ? "false" : "true");
|
||||
location.reload();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ let trackedPages: any = null;
|
|||
let visitedPages: any = null;
|
||||
|
||||
function loadVisitedPages(): void {
|
||||
const blob = localStorage.getItem("visitedPages");
|
||||
const blob = readLocalStorage("visitedPages");
|
||||
if (blob != null) {
|
||||
visitedPages = JSON.parse(blob);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,11 +12,11 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
function selectTabsets(cookieName: string, cookieValue: string): void {
|
||||
function selectTabsets(categoryName: string, categoryValue: string): void {
|
||||
document.querySelectorAll(".tabset").forEach(tabset => {
|
||||
tabset.querySelectorAll(".tab-strip").forEach(o => {
|
||||
const strip = o as HTMLElement;
|
||||
if (strip.dataset.cookieName === cookieName) {
|
||||
if (strip.dataset.categoryName === categoryName) {
|
||||
strip.querySelectorAll<HTMLElement>("[role=tab]").forEach(tab => {
|
||||
const attr = tab.getAttribute(ariaControls);
|
||||
if (!attr) {
|
||||
|
|
@ -28,7 +28,7 @@ function selectTabsets(cookieName: string, cookieValue: string): void {
|
|||
return;
|
||||
}
|
||||
|
||||
if (tab.dataset.cookieValue === cookieValue) {
|
||||
if (tab.dataset.categoryValue === categoryValue) {
|
||||
tab.setAttribute(ariaSelected, "true");
|
||||
tab.removeAttribute(tabIndex);
|
||||
panel.removeAttribute("hidden");
|
||||
|
|
@ -51,7 +51,7 @@ function handleTabs(): void {
|
|||
return;
|
||||
}
|
||||
|
||||
const cookieName = strip.dataset.cookieName;
|
||||
const categoryName = strip.dataset.categoryName;
|
||||
const panels = tabset.querySelectorAll<HTMLElement>("[role=tabpanel]");
|
||||
|
||||
const tabs: HTMLElement[] = [];
|
||||
|
|
@ -86,10 +86,10 @@ function handleTabs(): void {
|
|||
});
|
||||
}
|
||||
|
||||
if (cookieName) {
|
||||
const cookieValue = readCookie(cookieName);
|
||||
if (cookieValue) {
|
||||
selectTabsets(cookieName, cookieValue);
|
||||
if (categoryName) {
|
||||
const categoryValue = readLocalStorage(categoryName);
|
||||
if (categoryValue) {
|
||||
selectTabsets(categoryName, categoryValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -99,11 +99,11 @@ function handleTabs(): void {
|
|||
listen(tab, "focus", () => {
|
||||
activateTab(tab);
|
||||
|
||||
if (cookieName) {
|
||||
const cookieValue = tab.dataset.cookieValue;
|
||||
if (cookieValue) {
|
||||
createCookie(cookieName, cookieValue);
|
||||
selectTabsets(cookieName, cookieValue);
|
||||
if (categoryName) {
|
||||
const categoryValue = tab.dataset.categoryValue;
|
||||
if (categoryValue) {
|
||||
localStorage.setItem(categoryName, categoryValue);
|
||||
selectTabsets(categoryName, categoryValue);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -111,11 +111,11 @@ function handleTabs(): void {
|
|||
listen(tab, "click", () => {
|
||||
activateTab(tab);
|
||||
|
||||
if (cookieName) {
|
||||
const cookieValue = tab.dataset.cookieValue;
|
||||
if (cookieValue) {
|
||||
createCookie(cookieName, cookieValue);
|
||||
selectTabsets(cookieName, cookieValue);
|
||||
if (categoryName) {
|
||||
const categoryValue = tab.dataset.categoryValue;
|
||||
if (categoryValue) {
|
||||
localStorage.setItem(categoryName, categoryValue);
|
||||
selectTabsets(categoryName, categoryValue);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
// Copyright 2019 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.
function handleThemes(): void {
// reapply this in case the first call didn't 'stick' due to timing
applyStyleSheet(cookieValue);
listen(getById(lightThemeItem), click, () => {
applyStyleSheet(lightTheme);
createCookie(styleCookie, lightTheme);
return false;
});
listen(getById(darkThemeItem), click, () => {
applyStyleSheet(darkTheme);
createCookie(styleCookie, darkTheme);
return false;
});
}
handleThemes();
|
||||
// Copyright 2019 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.
function handleThemes(): void {
// reapply this in case the first call didn't 'stick' due to timing
applyStyleSheet(currentTheme);
listen(getById(lightThemeItem), click, () => {
applyStyleSheet(lightTheme);
createCookie(themeStorageItem, lightTheme);
return false;
});
listen(getById(darkThemeItem), click, () => {
applyStyleSheet(darkTheme);
createCookie(themeStorageItem, darkTheme);
return false;
});
}
handleThemes();
|
||||
|
|
@ -1 +1 @@
|
|||
// Copyright 2019 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.
const darkThemeClass = "dark-theme";
const darkTheme = "Dark Theme";
const darkThemeItem = "dark-theme-item";
const lightTheme = "Light Theme";
const lightThemeItem = "light-theme-item";
const styleCookie = "style";
function applyStyleSheet(theme: string | null): void {
// convert legacy cookie values
if (theme === "dark") {
theme = darkTheme;
} else if (theme === "light") {
theme = lightTheme;
}
if (theme === darkTheme) {
document.documentElement.classList.add(darkThemeClass);
} else {
document.documentElement.classList.remove(darkThemeClass);
}
// set the active theme menu item
let item = document.getElementById(lightThemeItem);
if (item) {
if (theme === darkTheme) {
item.classList.remove(active);
} else {
item.classList.add(active);
}
}
item = document.getElementById(darkThemeItem);
if (item) {
if (theme === darkTheme) {
item.classList.add(active);
} else {
item.classList.remove(active);
}
}
}
if (theme === "dark") {
theme = darkTheme;
const ca = document.cookie.split(";");
for (let c of ca) {
while (c.charAt(0) === " ") {
c = c.substring(1, c.length);
}
if (c.indexOf(nameEQ) === 0) {
function applyStyleSheet(theme: string | null): void {
}
}
return null;
}
function readSystemDefault(): string | null {
if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
return darkTheme;
} else if (window.matchMedia("(prefers-color-scheme: light)").matches) {
return lightTheme;
}
return null;
}
let cookieValue = readCookie(styleCookie);
if (cookieValue === null) {
cookieValue = readSystemDefault();
}
applyStyleSheet(cookieValue);
|
||||
// Copyright 2019 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.
const darkThemeClass = "dark-theme";
const darkTheme = "Dark Theme";
const darkThemeItem = "dark-theme-item";
const lightTheme = "Light Theme";
const lightThemeItem = "light-theme-item";
const themeStorageItem = "style";
function applyStyleSheet(theme: string | null): void {
// convert legacy cookie values
if (theme === "dark") {
theme = darkTheme;
} else if (theme === "light") {
theme = lightTheme;
}
if (theme === darkTheme) {
document.documentElement.classList.add(darkThemeClass);
} else {
document.documentElement.classList.remove(darkThemeClass);
}
// set the active theme menu item
let item = document.getElementById(lightThemeItem);
if (item) {
if (theme === darkTheme) {
item.classList.remove(active);
} else {
item.classList.add(active);
}
}
item = document.getElementById(darkThemeItem);
if (item) {
if (theme === darkTheme) {
item.classList.add(active);
} else {
item.classList.remove(active);
}
}
}
function readLocalStorage(name: string): string | null {
// convert legacy cookie values
if (theme === "dark") {
// convert legacy cookie values
theme = darkTheme;
return value;
}
// if couldn't find in local storage, fall back to the legacy cookies
const nameEQ = name + "=";
const ca = document.cookie.split(";");
for (let c of ca) {
while (c.charAt(0) === " ") {
c = c.substring(1, c.length);
}
if (c.indexOf(nameEQ) === 0) {
value = c.substring(nameEQ.length, c.length);
// migrate the cookie value to localStorage
localStorage.setItem(name, value);
if (theme === "dark") {
function applyStyleSheet(theme: string | null): void {
document.cookie = name + "= ; expires = Thu, 01 Jan 1970 00:00:00 GMT";
return value;
}
}
return null;
}
function readSystemDefault(): string | null {
if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
return darkTheme;
} else if (window.matchMedia("(prefers-color-scheme: light)").matches) {
return lightTheme;
}
return null;
}
let currentTheme = readLocalStorage(themeStorageItem);
if (currentTheme === null) {
currentTheme = readSystemDefault();
}
applyStyleSheet(currentTheme);
|
||||
Loading…
Reference in New Issue