You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use apiversion networking.k8s.io/v1 for ingress in ZH version
There is a warning deprecation message for kubernetes v1.19:
```
Warning: networking.k8s.io/v1beta1 Ingress is deprecated in v1.19+, unavailable in v1.22+; use networking.k8s.io/v1 Ingress
```
Switched apiversion in the example to `networking.k8s.io/v1`
Copy file name to clipboardExpand all lines: content/zh/docs/tasks/access-application-cluster/ingress-minikube.md
+45-39Lines changed: 45 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ weight: 100
12
12
<!-- overview -->
13
13
14
14
<!--
15
-
An [Ingress](/docs/concepts/services-networking/ingress/) is an API object that defines rules which allow external access
15
+
An [Ingress](/docs/concepts/services-networking/ingress/) is an API object that defines rules which allow external access
16
16
to services in a cluster. An [Ingress controller](/docs/concepts/services-networking/ingress-controllers/) fulfills the rules set in the Ingress.
17
17
18
18
This page shows you how to set up a simple Ingress which routes requests to Service web or web2 depending on the HTTP URI.
@@ -65,7 +65,7 @@ This page shows you how to set up a simple Ingress which routes requests to Serv
65
65
minikube addons enable ingress
66
66
```
67
67
68
-
<!--
68
+
<!--
69
69
1. Verify that the NGINX Ingress controller is running
70
70
-->
71
71
2. 检查验证 NGINX Ingress 控制器处于运行状态:
@@ -104,39 +104,39 @@ This page shows you how to set up a simple Ingress which routes requests to Serv
104
104
105
105
<!--Output:-->
106
106
输出:
107
-
107
+
108
108
```
109
109
deployment.apps/web created
110
110
```
111
111
112
112
<!--
113
-
1. Expose the Deployment:
113
+
1. Expose the Deployment:
114
114
-->
115
115
2. 将 Deployment 暴露出来:
116
116
117
117
```shell
118
118
kubectl expose deployment web --type=NodePort --port=8080
119
119
```
120
-
120
+
121
121
<!-- Output: -->
122
-
输出:
123
-
122
+
输出:
123
+
124
124
```
125
125
service/web exposed
126
126
```
127
127
128
-
<!--
128
+
<!--
129
129
1. Verify the Service is created and is available on a node port:
130
130
-->
131
131
3. 验证 Service 已经创建,并且可能从节点端口访问:
132
132
133
133
```shell
134
134
kubectl get service web
135
-
```
136
-
135
+
```
136
+
137
137
<!-- Output: -->
138
138
输出:
139
-
139
+
140
140
```shell
141
141
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
142
142
web NodePort 10.104.133.249 <none> 8080:31637/TCP 12m
@@ -150,14 +150,14 @@ This page shows you how to set up a simple Ingress which routes requests to Serv
150
150
```shell
151
151
minikube service web --url
152
152
```
153
-
153
+
154
154
<!-- Output: -->
155
155
输出:
156
-
156
+
157
157
```shell
158
158
http://172.17.0.15:31637
159
159
```
160
-
160
+
161
161
<!--
162
162
Katacoda environment only: at the top of the terminal panel, click the plus sign, and then click **Select port to view on Host 1**. Enter the NodePort, in this case `31637`, and then click **Display Port**.
163
163
-->
@@ -166,18 +166,18 @@ This page shows you how to set up a simple Ingress which routes requests to Serv
166
166
然后点击 **Select port to view on Host 1**。
167
167
输入节点和端口号(这里是`31637`),之后点击 **Display Port**。
168
168
{{< /note >}}
169
-
169
+
170
170
<!-- Output: -->
171
171
输出:
172
-
172
+
173
173
```shell
174
174
Hello, world!
175
175
Version: 1.0.0
176
176
Hostname: web-55b8c6998d-8k564
177
177
```
178
-
179
-
<!--
180
-
You can now access the sample app via the Minikube IP address and NodePort. The next step lets you access
178
+
179
+
<!--
180
+
You can now access the sample app via the Minikube IP address and NodePort. The next step lets you access
181
181
the app using the Ingress resource.
182
182
-->
183
183
你现在应该可以通过 Minikube 的 IP 地址和节点端口来访问示例应用了。
@@ -198,7 +198,7 @@ The following file is an Ingress resource that sends traffic to your Service via
198
198
1. 根据下面的 YAML 创建文件 `example-ingress.yaml`:
199
199
200
200
```yaml
201
-
apiVersion: networking.k8s.io/v1beta1
201
+
apiVersion: networking.k8s.io/v1
202
202
kind: Ingress
203
203
metadata:
204
204
name: example-ingress
@@ -210,45 +210,48 @@ The following file is an Ingress resource that sends traffic to your Service via
210
210
http:
211
211
paths:
212
212
- path: /
213
+
pathType: Prefix
213
214
backend:
214
-
serviceName: web
215
-
servicePort: 8080
215
+
service:
216
+
name: web
217
+
port:
218
+
number: 8080
216
219
```
217
220
218
221
<!--
219
222
1. Create the Ingress resource by running the following command:
0 commit comments