File tree Expand file tree Collapse file tree 2 files changed +27
-25
lines changed
docs/tasks/access-application-cluster
examples/service/networking Expand file tree Collapse file tree 2 files changed +27
-25
lines changed Original file line number Diff line number Diff line change @@ -134,28 +134,12 @@ weight: 100
134
134
135
135
1. 以下の内容で` example-ingress.yaml` を作成します。
136
136
137
- ` ` ` yaml
138
- apiVersion: networking.k8s.io/v1beta1
139
- kind: Ingress
140
- metadata:
141
- name: example-ingress
142
- annotations:
143
- nginx.ingress.kubernetes.io/rewrite-target: /$1
144
- spec:
145
- rules:
146
- - host: hello-world.info
147
- http:
148
- paths:
149
- - path: /
150
- backend:
151
- serviceName: web
152
- servicePort: 8080
153
- ` ` `
137
+ {{< codenew file=" service/networking/example-ingress.yaml" > }}
154
138
155
139
1. 次のコマンドを実行して、Ingressリソースを作成します。
156
140
157
141
` ` ` shell
158
- kubectl apply -f example-ingress.yaml
142
+ kubectl apply -f https://kubernetes.io/examples/service/networking/ example-ingress.yaml
159
143
` ` `
160
144
161
145
出力は次のようになります。
@@ -175,8 +159,8 @@ weight: 100
175
159
{{< /note > }}
176
160
177
161
` ` ` shell
178
- NAME HOSTS ADDRESS PORTS AGE
179
- example-ingress hello-world.info 172.17.0.15 80 38s
162
+ NAME CLASS HOSTS ADDRESS PORTS AGE
163
+ example-ingress < none > hello-world.info 172.17.0.15 80 38s
180
164
` ` `
181
165
182
166
1. 次の行を` /etc/hosts` ファイルの最後に書きます。
@@ -241,9 +225,12 @@ weight: 100
241
225
242
226
` ` ` yaml
243
227
- path: /v2
228
+ pathType: Prefix
244
229
backend:
245
- serviceName: web2
246
- servicePort: 8080
230
+ service:
231
+ name: web2
232
+ port:
233
+ number: 8080
247
234
` ` `
248
235
249
236
1. 次のコマンドで変更を適用します。
@@ -300,6 +287,3 @@ weight: 100
300
287
* [Ingress](/ja/docs/concepts/services-networking/ingress/)についてさらに学ぶ。
301
288
* [Ingressコントローラー](/ja/docs/concepts/services-networking/ingress-controllers/)についてさらに学ぶ。
302
289
* [Service](/ja/docs/concepts/services-networking/service/)についてさらに学ぶ。
303
-
304
-
305
-
Original file line number Diff line number Diff line change
1
+ apiVersion : networking.k8s.io/v1
2
+ kind : Ingress
3
+ metadata :
4
+ name : example-ingress
5
+ annotations :
6
+ nginx.ingress.kubernetes.io/rewrite-target : /$1
7
+ spec :
8
+ rules :
9
+ - host : hello-world.info
10
+ http :
11
+ paths :
12
+ - path : /
13
+ pathType : Prefix
14
+ backend :
15
+ service :
16
+ name : web
17
+ port :
18
+ number : 8080
You can’t perform that action at this time.
0 commit comments