Skip to content

Commit

Permalink
(docs/dualstack): v1.17 updates (#17457)
Browse files Browse the repository at this point in the history
* Add placehold doc updates for dualstack in 1.17

Signed-off-by: Lachlan Evenson <[email protected]>

* Add Downward API and /etc/hosts Pod IP validation

Signed-off-by: Lachlan Evenson <[email protected]>

* remove addressed known issue via k/k pr 85246

Signed-off-by: Lachlan Evenson <[email protected]>

* Remove known issue and add flag as part of k/k 79993

Signed-off-by: Lachlan Evenson <[email protected]>

* remove follow up placeholders

Signed-off-by: Lachlan Evenson <[email protected]>

* Update verbiage

Signed-off-by: Lachlan Evenson <[email protected]>

* Make IP addressing consistent throughout the task

Signed-off-by: Lachlan Evenson <[email protected]>

* Update to status.podIPs

Signed-off-by: Lachlan Evenson <[email protected]>

* Update content/en/docs/tasks/network/validate-dual-stack.md

Use set instead of env

Co-Authored-By: Khaled Henidak (Kal) <[email protected]>
  • Loading branch information
2 people authored and Bob Killen committed Dec 6, 2019
1 parent 6e6f90a commit 5702296
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
3 changes: 1 addition & 2 deletions content/en/docs/concepts/services-networking/dual-stack.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ To enable IPv4/IPv6 dual-stack, enable the `IPv6DualStack` [feature gate](/docs/
* `--feature-gates="IPv6DualStack=true"`
* `--cluster-cidr=<IPv4 CIDR>,<IPv6 CIDR>` eg. `--cluster-cidr=10.244.0.0/16,fc00::/24`
* `--service-cluster-ip-range=<IPv4 CIDR>,<IPv6 CIDR>`
* `--node-cidr-mask-size-ipv4|--node-cidr-mask-size-ipv6` defaults to /24 for IPv4 and /64 for IPv6
* kubelet:
* `--feature-gates="IPv6DualStack=true"`
* kube-proxy:
Expand Down Expand Up @@ -98,9 +99,7 @@ The use of publicly routable and non-publicly routable IPv6 address blocks is ac

## Known Issues

* IPv6 network block assignment uses the default IPv4 CIDR block size (/24)
* Kubenet forces IPv4,IPv6 positional reporting of IPs (--cluster-cidr)
* Dual-stack networking does not function if the `EndpointSlice` feature gate is enabled.

{{% /capture %}}

Expand Down
36 changes: 35 additions & 1 deletion content/en/docs/tasks/network/validate-dual-stack.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,41 @@ kubectl get pods pod01 -o go-template --template='{{range .status.podIPs}}{{prin
a00:100::4
```

You can also validate Pod IPs using the Downward API via the `status.podIPs` fieldPath. The following snippet demonstrates how you can expose the Pod IPs via an environment variable called `MY_POD_IPS` within a container.

```
env:
- name: MY_POD_IPS
valueFrom:
fieldRef:
fieldPath: status.podIPs
```

The following command prints the value of the `MY_POD_IPS` environment variable from within a container. The value is a comma separated list that corresponds to the Pod's IPv4 and IPv6 addresses.
```shell
kubectl exec -it pod01 -- set | grep MY_POD_IPS
```
```
MY_POD_IPS=10.244.1.4,a00:100::4
```

The Pod's IP addresses will also be written to `/etc/hosts` within a container. The following command executes a cat on `/etc/hosts` on a dual stack Pod. From the output you can verify both the IPv4 and IPv6 IP address for the Pod.

```shell
kubectl exec -it pod01 -- cat /etc/hosts
```
```
# Kubernetes-managed hosts file.
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
fe00::0 ip6-mcastprefix
fe00::1 ip6-allnodes
fe00::2 ip6-allrouters
10.244.1.4 pod01
a00:100::4 pod01
```

## Validate Services

Create the following Service without the `ipFamily` field set. When this field is not set, the Service gets an IP from the first configured range via `--service-cluster-ip-range` flag on the kube-controller-manager.
Expand Down Expand Up @@ -123,4 +158,3 @@ my-service ClusterIP fe80:20d::d06b 2001:db8:f100:4002::9d37:c0d7 80:318
{{% /capture %}}

0 comments on commit 5702296

Please sign in to comment.