Skip to content

Commit af9c804

Browse files
committed
Updates from reviewing networking sections
1 parent 26b8bc2 commit af9c804

10 files changed

+116
-126
lines changed

modules/nw-annotating-a-route-with-a-cookie-name.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ $ oc annotate route <route_name> router.openshift.io/<cookie_name>="-<cookie_ann
2424
----
2525
+
2626
For example, to annotate the cookie name of `my_cookie` to the `my_route` with
27-
the annotation of `my_cookie_anno`:
27+
the annotation of `my_cookie_annotation`:
2828
+
2929
----
30-
$ oc annotate route my_route router.openshift.io/my_cookie="-my_cookie_anno"
30+
$ oc annotate route my_route router.openshift.io/my_cookie="-my_cookie_annotation"
3131
----
3232

3333
. Save the cookie, and access the route:

modules/nw-enabling-hsts.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,5 @@ services to include this site in their HSTS preload lists. For example, sites
5252
such as Google can construct a list of sites that have `preload` set. Browsers
5353
can then use these lists to determine which sites they can communicate with
5454
over HTTPS,
55-
before they have interacted with the site. Without `preload` set, browsers need
56-
to have interacted with the site over HTTPS to get the header.
55+
before they have interacted with the site. Without `preload` set, browsers must
56+
have interacted with the site over HTTPS to get the header.

modules/nw-ne-openshift-dns.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ service IPs, and more so the front-end Pods can communicate with the back-end
1111
services. If the service is deleted and recreated, a new IP address can be
1212
assigned to the service, and requires the front-end Pods to be recreated to pick
1313
up the updated values for the service IP environment variable. Additionally, the
14-
back-end service has to be created before any of the front-end Pods to ensure that
14+
back-end service must be created before any of the front-end Pods to ensure that
1515
the service IP is generated properly, and that it can be provided to the
1616
front-end Pods as an environment variable.
1717

modules/nw-throughput-troubleshoot.adoc

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,10 @@ traffic from other Pods, storage devices, or the data plane.
2525
$ tcpdump -s 0 -i any -w /tmp/dump.pcap host <podip 1> && host <podip 2> <1>
2626
----
2727
+
28-
<1> `podip` is the IP address for the Pod. Run the following command to get
29-
the IP address of the Pods:
28+
<1> `podip` is the IP address for the Pod. Run the `oc get pod <pod_name> -o wide` command to get
29+
the IP address of a Pod.
3030
+
31-
----
32-
$ oc get pod <podname> -o wide
33-
----
34-
+
35-
tcpdump generates a file at [filename]`/tmp/dump.pcap` containing all traffic between
31+
tcpdump generates a file at `/tmp/dump.pcap` containing all traffic between
3632
these two Pods. Ideally, run the analyzer shortly
3733
before the issue is reproduced and stop the analyzer shortly after the issue
3834
is finished reproducing to minimize the size of the file.

modules/nw-using-cookies-keep-route-statefulness.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010

1111
{product-title} provides sticky sessions, which enables stateful application
1212
traffic by ensuring all traffic hits the same endpoint. However, if the endpoint
13-
pod terminates, whether through restart, scaling, or a change in configuration,
13+
Pod terminates, whether through restart, scaling, or a change in configuration,
1414
this statefulness can disappear.
1515

1616
{product-title} can use cookies to configure session persistence. The router
1717
selects an endpoint to handle any user requests, and creates a cookie for the
1818
session. The cookie is passed back in the response to the request and the user
1919
sends the cookie back with the next request in the session. The cookie tells the
2020
router which endpoint is handling the session, ensuring that client requests use
21-
the cookie so that they are routed to the same pod.
21+
the cookie so that they are routed to the same Pod.

modules/nw_multinetwork-creating-first-attachments.adoc

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,34 @@
33
// * networking/managing_multinetworking.adoc
44

55
[id="multinetwork-creating-first-attachments-{context}"]
6-
= Creating additional network interfaces for the first time
6+
= Creating additional network interfaces
77

8-
Additional interfaces for pods are defined in CNI configurations that are stored as Custom Resources (CRs).
8+
Additional interfaces for Pods are defined in CNI configurations that are stored as Custom Resources (CRs).
99
These CRs can be created, listed, edited, and deleted using the `oc` tool.
1010

11-
The procedure below configures a `macvlan` interface on a pod. This configuration might not apply to all production environments, but you use the same procedure for other CNI plug-ins.
11+
The procedure below configures a `macvlan` interface on a Pod. This configuration might not apply to all production environments, but you use the same procedure for other CNI plug-ins.
1212

1313
== Creating a CNI configuration for an additional interface as a CR
1414

1515
[NOTE]
1616
====
17-
If you want to attach an additional interface to a pod, the CR that defines the interface must be in the same project (namespace) as the pod.
17+
If you want to attach an additional interface to a Pod, the CR that defines the interface must be in the same project (namespace) as the Pod.
1818
====
1919

20-
. Create a project to store CNI configurations as CRs and the pods that will use the CRs.
20+
. Create a project to store CNI configurations as CRs and the Pods that will use the CRs.
2121
+
2222
----
2323
$ oc new-project multinetwork-example
24-
$ oc project multinetwork-example
2524
----
2625

27-
. Create the CR that will define an additional network interface. Create a YAML file:
26+
. Create the CR that will define an additional network interface. Create a YAML file called `macvlan-conf.yaml` with the following contents:
2827
+
2928
[source,yaml]
3029
----
3130
apiVersion: "k8s.cni.cncf.io/v1"
32-
kind: NetworkAttachmentDefinition <2>
31+
kind: NetworkAttachmentDefinition <1>
3332
metadata:
34-
name: macvlan-conf <1>
33+
name: macvlan-conf <2>
3534
spec:
3635
config: '{ <3>
3736
"cniVersion": "0.3.0",
@@ -51,29 +50,29 @@ spec:
5150
}'
5251
----
5352
+
54-
<1> `name` maps to the annotation, which is used in the next step.
55-
<2> `kind: NetworkAttachmentDefinition`. This is the name for the CR where this configuration will be stored. It is a custom extension of Kubernetes that defines how networks are attached to pods.
53+
<1> `kind: NetworkAttachmentDefinition`. This is the name for the CR where this configuration will be stored. It is a custom extension of Kubernetes that defines how networks are attached to Pods.
54+
<2> `name` maps to the annotation, which is used in the next step.
5655
<3> `config`: The CNI configuration is packaged in the `config` field.
57-
56+
+
5857
The configuration above is specific to a plug-in, which enables `macvlan`. Note the `type` line in the CNI configuration portion.
59-
Aside from the IPAM (IP address management) parameters for networking, in this example the `master` field must reference a network interface that resides on the node(s) hosting the pod(s).
58+
Aside from the IPAM (IP address management) parameters for networking, in this example the `master` field must reference a network interface that resides on the node(s) hosting the Pod(s).
6059

6160
. Run the following command to create the CR:
6261
+
6362
----
64-
oc create -f macvlan-conf.yaml
63+
$ oc create -f macvlan-conf.yaml
6564
----
6665

6766
[NOTE]
6867
====
6968
This example is based on a `macvlan` CNI plug-in. Note that in AWS environments, macvlan traffic might be filtered and, therefore, might not reach the desired destination.
7069
====
7170

72-
== Managing the CRs for Additional Interfaces
71+
== Managing the CRs for additional interfaces
7372

74-
You can manage the CRs for additional interfaces using the `oc` tool.
73+
You can manage the CRs for additional interfaces using the `oc` CLI.
7574

76-
To list the CRs for additional interfaces, execute:
75+
Use the following command to list the CRs for additional interfaces:
7776

7877
----
7978
$ oc get network-attachment-definitions.k8s.cni.cncf.io
@@ -85,9 +84,9 @@ Use the following command to delete CRs for additional interfaces:
8584
$ oc delete network-attachment-definitions.k8s.cni.cncf.io macvlan-conf
8685
----
8786

88-
== Create an annotated pod that uses the CR
87+
== Creating an annotated Pod that uses the CR
8988

90-
To create a pod which uses the additional interface, use an `annotation` that refers to the CR, create a YAML file for a pod:
89+
To create a Pod that uses the additional interface, use an annotation that refers to the CR. Create a YAML file called `samplepod.yaml` for a Pod with the following contents:
9190

9291
[source,yaml]
9392
----
@@ -106,13 +105,13 @@ spec:
106105

107106
<1> The `annotations` field contains `k8s.v1.cni.cncf.io/networks: macvlan-conf`, which correlates to the `name` field in the CR defined earlier.
108107

109-
Run the following command to create the `samplepod` pod:
108+
Run the following command to create the `samplepod` Pod:
110109

111110
----
112-
oc create -f samplepod.yaml
111+
$ oc create -f samplepod.yaml
113112
----
114113

115-
To verify that an additional network interface has been created and attached to the pod, use the following command to list the IPv4 address information:
114+
To verify that an additional network interface has been created and attached to the Pod, use the following command to list the IPv4 address information:
116115

117116
----
118117
$ oc exec -it samplepod -- ip -4 addr
@@ -121,7 +120,6 @@ $ oc exec -it samplepod -- ip -4 addr
121120
Three interfaces are listed in the output:
122121

123122
----
124-
$ oc exec -it samplepod -- ip -4 addr
125123
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000 <1>
126124
inet 127.0.0.1/8 scope host lo
127125
valid_lft forever preferred_lft forever
@@ -133,34 +131,34 @@ $ oc exec -it samplepod -- ip -4 addr
133131
valid_lft forever preferred_lft forever
134132
----
135133

136-
<1> `lo`: a loopback interface.
137-
<2> `eth0`: the interface that connects to the cluster-wide default network.
138-
<3> `net1`: the new interface that you just created.
134+
<1> `lo`: A loopback interface.
135+
<2> `eth0`: The interface that connects to the cluster-wide default network.
136+
<3> `net1`: The new interface that you just created.
139137

140-
=== Attaching multiple interfaces to a pod
138+
=== Attaching multiple interfaces to a Pod
141139

142-
To attach more than one additional interface to a pod, specify multiple names, in comma-delimited format, in the `annotation` field in the pod definition.
140+
To attach more than one additional interface to a Pod, specify multiple names, in comma-delimited format, in the `annotations` field in the Pod definition.
143141

144-
The following `annotation` field in a pod definition specifies different CRs for the additional interfaces:
142+
The following `annotations` field in a Pod definition specifies different CRs for the additional interfaces:
145143

146144
[source,yaml]
147145
----
148146
annotations:
149147
k8s.v1.cni.cncf.io/networks: macvlan-conf, tertiary-conf, quaternary-conf
150148
----
151149

152-
The following `annotation` field in a pod definition specifies the same CR for the additional interfaces:
150+
The following `annotations` field in a Pod definition specifies the same CR for the additional interfaces:
153151

154152
[source,yaml]
155153
----
156154
annotations:
157-
k8s.v1.cni.cncf.io/networks: macvlan-conf, macvlan-conf.
155+
k8s.v1.cni.cncf.io/networks: macvlan-conf, macvlan-conf
158156
----
159157

160-
== View the interface configuration in a running pod
158+
== Viewing the interface configuration in a running Pod
161159

162-
Once the pod is running, you can can review the configurations of the additional interfaces created.
163-
To view the sample pod from the earlier example, execute the following command.
160+
After the Pod is running, you can review the configurations of the additional interfaces created.
161+
To view the sample Pod from the earlier example, execute the following command.
164162

165163
----
166164
$ oc describe pod samplepod
@@ -192,16 +190,16 @@ Annotations:
192190
----
193191

194192
<1> `name` refers to the custom resource name, `macvlan-conf`.
195-
<2> `interface` refers to the name of the interface in the pod.
196-
<3> `ips` is a list of IP addresses as assigned to the pod.
193+
<2> `interface` refers to the name of the interface in the Pod.
194+
<3> `ips` is a list of IP addresses as assigned to the Pod.
197195
<4> `mac` is the MAC address of the interface.
198196
<5> `dns` refers DNS for the interface.
199197

200-
The first annotation, `k8s.v1.cni.cncf.io/networks: macvlan-conf`, refers to the CR created in the example. This annotation was specified in the pod definition.
198+
The first annotation, `k8s.v1.cni.cncf.io/networks: macvlan-conf`, refers to the CR created in the example. This annotation was specified in the Pod definition.
201199

202200
The second annotation is `k8s.v1.cni.cncf.io/networks-status`.
203201
There are two interfaces listed under `k8s.v1.cni.cncf.io/networks-status`.
204202

205203
* The first interface describes the interface for the default network, `openshift-sdn`. This interface is created as `eth0`. It is used for communications within the cluster.
206204

207-
* The second interface is the additional interface that you created, `net1`. The output above lists some key values that were configured when the interface was created, for example, the IP addresses that were assigned to the pod.
205+
* The second interface is the additional interface that you created, `net1`. The output above lists some key values that were configured when the interface was created, for example, the IP addresses that were assigned to the Pod.

modules/nw_multinetwork-host-device.adoc

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[id="multinetwork-host-device-{context}"]
66
= Configuring additional interfaces using host devices
77

8-
The host-device plug-in connects an existing network device on a node directly to a pod.
8+
The host-device plug-in connects an existing network device on a node directly to a Pod.
99

1010
The code below creates a dummy device using a dummy module to back a virtual device, and assigns the dummy device `name` to `exampledevice0`.
1111

@@ -15,18 +15,16 @@ $ lsmod | grep dummy
1515
| ip link set name exampledevice0 dev dummy0
1616
----
1717

18-
19-
2018
.Procedure
2119

22-
. To connect the dummy network device to a pod, label the host, so that you can assign a pod to the node where the device exists.
20+
. To connect the dummy network device to a Pod, label the host, so that you can assign a Pod to the node where the device exists.
2321
+
2422
----
25-
$ oc label nodes {your-worker-node-name} exampledevice=true
23+
$ oc label nodes <your-worker-node-name> exampledevice=true
2624
$ oc get nodes --show-labels
2725
----
2826

29-
. Create a YAML file for a custom resource to refer to this configuration:
27+
. Create a YAML file called `hostdevice-example.yaml` for a custom resource to refer to this configuration:
3028
+
3129
[source,yaml]
3230
----
@@ -45,11 +43,10 @@ spec:
4543
. Run the following command to create the `hostdevice-example` CR:
4644
+
4745
----
48-
oc create -f hostdevice-example.yaml
46+
$ oc create -f hostdevice-example.yaml
4947
----
5048

51-
52-
. Create a YAML file for a pod which refers to this name in the annotation. Include `nodeSelector` to assign the pod to the machine where you created the alias.
49+
. Create a YAML file for a Pod which refers to this name in the annotation. Include `nodeSelector` to assign the Pod to the machine where you created the alias.
5350
+
5451
[source,yaml]
5552
----
@@ -68,10 +65,10 @@ spec:
6865
exampledevice: "true"
6966
----
7067

71-
. Run the following command to create the `hostdevicesamplepod` pod:
68+
. Run the following command to create the `hostdevicesamplepod` Pod:
7269
+
7370
----
74-
oc create -f hostdevicesamplepod.yaml
71+
$ oc create -f hostdevicesamplepod.yaml
7572
----
7673

7774
. View the additional interface that you created:

0 commit comments

Comments
 (0)