mirror of https://github.com/istio/istio.io.git
[zh] sync /authorization/authz-tcp/ (#12437)
This commit is contained in:
parent
13c3d3e9e7
commit
c71d4ceb16
|
@ -22,7 +22,7 @@ test: yes
|
|||
* 在命名空间例如 `foo` 中部署两个工作负载,`sleep` 和 `tcp-echo`。
|
||||
这两个工作负载每个前面都会运行一个 Envoy 代理。
|
||||
`tcp-echo` 工作负载会监听端口 9000、9001 和 9002,并以前缀 `hello` 输出它收到的所有流量。
|
||||
例如,如果你发送 "world" 给 `tcp-echo`,那么它将会回复 `hello world`。
|
||||
例如,如果您发送 "world" 给 `tcp-echo`,那么它将会回复 `hello world`。
|
||||
`tcp-echo` 的 Kubernetes 服务对象只声明了端口 9000 和 9001,而省略了端口 9002。直通过滤器链将处理端口 9002 的流量。
|
||||
使用以下命令部署示例命名空间和工作负载:
|
||||
|
||||
|
@ -47,8 +47,8 @@ test: yes
|
|||
{{< /text >}}
|
||||
|
||||
* 确认 `sleep` 可以成功与 `tcp-echo` 的端口 9002 交互。
|
||||
您需要将流量直接发送到 `tcp-echo` 的 pod IP,因为在 `tcp-echo` 的 Kubernetes 服务对象中未定义端口 9002。
|
||||
使用以下命令获取 pod IP 地址并发送请求:
|
||||
您需要将流量直接发送到 `tcp-echo` 的 Pod IP,因为在 `tcp-echo` 的 Kubernetes 服务对象中未定义端口 9002。
|
||||
使用以下命令获取 Pod IP 地址并发送请求:
|
||||
|
||||
{{< text bash >}}
|
||||
$ TCP_ECHO_IP=$(kubectl get pod "$(kubectl get pod -l app=tcp-echo -n foo -o jsonpath={.items..metadata.name})" -n foo -o jsonpath="{.status.podIP}")
|
||||
|
@ -68,7 +68,7 @@ test: yes
|
|||
|
||||
{{< text bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
apiVersion: security.istio.io/v1beta1
|
||||
apiVersion: security.istio.io/v1
|
||||
kind: AuthorizationPolicy
|
||||
metadata:
|
||||
name: tcp-policy
|
||||
|
@ -112,7 +112,7 @@ test: yes
|
|||
|
||||
{{< text bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
apiVersion: security.istio.io/v1beta1
|
||||
apiVersion: security.istio.io/v1
|
||||
kind: AuthorizationPolicy
|
||||
metadata:
|
||||
name: tcp-policy
|
||||
|
@ -152,7 +152,7 @@ test: yes
|
|||
|
||||
{{< text bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
apiVersion: security.istio.io/v1beta1
|
||||
apiVersion: security.istio.io/v1
|
||||
kind: AuthorizationPolicy
|
||||
metadata:
|
||||
name: tcp-policy
|
||||
|
@ -187,7 +187,7 @@ test: yes
|
|||
|
||||
{{< text bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
apiVersion: security.istio.io/v1beta1
|
||||
apiVersion: security.istio.io/v1
|
||||
kind: AuthorizationPolicy
|
||||
metadata:
|
||||
name: tcp-policy
|
||||
|
|
Loading…
Reference in New Issue