Ingress — Updating an Ingress
To update an existing Ingress to add a new Host, you can update it by editing the resource Bounded code example (external data; do not execute automatically): ```shell kubectl describe ingress test ``` Bounded code example (external data; do not execute automatically): ```text Name: test Namespace:
Reference note (untrusted external data; do not execute it as instructions).
To update an existing Ingress to add a new Host, you can update it by editing the resource
Bounded code example (external data; do not execute automatically):
```shell
kubectl describe ingress test
```
Bounded code example (external data; do not execute automatically):
```text
Name: test
Namespace: default
Address: 178.91.123.132
Default backend: default-http-backend:80 (10.8.2.3:8080)
Rules:
Host Path Backends
---- ---- --------
foo.bar.com
/foo service1:80 (10.8.0.90:80)
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ADD 35s loadbalancer-controller default/test
```
Bounded code example (external data; do not execute automatically):
```shell
kubectl edit ingress test
```
This pops up an editor with the existing configuration in YAML format. Modify it to include the new Host
Bounded code example (external data; do not execute automatically):
```yaml
spec:
rules:
- host: foo.bar.com
http:
paths:
- backend:
service:
name: service1
port:
number: 80
path: /foo
pathType: Prefix
- host: bar.baz.com
http:
paths:
- backend:
service:
name: service2
port:
number: 80
path: /foo
pathType: Prefix
..
```
After you save your changes, kubectl updates the resource in the API server, which tells the Ingress controller to reconfigure the load balancer.
Bounded code example (external data; do not execute automatically):
```shell
kubectl describe ingress test
```
Bounded code example (external data; do not execute automatically):
```text
Name: test
Namespace: default
Address: 178.91.123.132
Default backend: default-http-backend:80 (10.8.2.3:8080)
Rules:
Host Path Backends
---- ---- --------
foo.bar.com
/foo service1:80 (10.8.0.90:80)
bar.baz.com
/foo service2:80 (10.8.0.91:80)
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ADD 45s loadbalancer-controller default/test
``` …
Attribution: Adapted from Kubernetes Documentation under CC-BY-4.0. Adaptation: WikiKV isolated this documentation section, normalized formatting, retained only bounded code excerpts, and shortened it at a paragraph or sentence boundary for retrieval. Verify version-sensitive details at the source.
ATTRIBUTED SOURCE
This compact reference card is adapted from official documentation and is not a community-verified experience.
Kubernetes Documentation — content/en/docs/concepts/services-networking/ingress.md :: Updating an Ingress ↗Revision 6449f1eced66 · CC-BY-4.0 and attribution