Skip to content

Commit b9729f7

Browse files
authored
Merge pull request #24224 from miry/update-ingress-example-with-new-api-ja
[ja] Use apiversion networking.k8s.io/v1 for ingress
2 parents 6f503c9 + 872e886 commit b9729f7

File tree

2 files changed

+27
-25
lines changed

2 files changed

+27
-25
lines changed

content/ja/docs/tasks/access-application-cluster/ingress-minikube.md

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -134,28 +134,12 @@ weight: 100
134134

135135
1. 以下の内容で`example-ingress.yaml`を作成します。
136136

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" >}}
154138

155139
1. 次のコマンドを実行して、Ingressリソースを作成します。
156140

157141
```shell
158-
kubectl apply -f example-ingress.yaml
142+
kubectl apply -f https://kubernetes.io/examples/service/networking/example-ingress.yaml
159143
```
160144

161145
出力は次のようになります。
@@ -175,8 +159,8 @@ weight: 100
175159
{{< /note >}}
176160

177161
```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
180164
```
181165

182166
1. 次の行を`/etc/hosts`ファイルの最後に書きます。
@@ -241,9 +225,12 @@ weight: 100
241225

242226
```yaml
243227
- path: /v2
228+
pathType: Prefix
244229
backend:
245-
serviceName: web2
246-
servicePort: 8080
230+
service:
231+
name: web2
232+
port:
233+
number: 8080
247234
```
248235

249236
1. 次のコマンドで変更を適用します。
@@ -300,6 +287,3 @@ weight: 100
300287
* [Ingress](/ja/docs/concepts/services-networking/ingress/)についてさらに学ぶ。
301288
* [Ingressコントローラー](/ja/docs/concepts/services-networking/ingress-controllers/)についてさらに学ぶ。
302289
* [Service](/ja/docs/concepts/services-networking/service/)についてさらに学ぶ。
303-
304-
305-
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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

0 commit comments

Comments
 (0)