Skip to content

Commit d48a36e

Browse files
committed
OSDOCS-998: declarative configs for SDN
`oc patch` instances are followed by a TIP that suggests a YAML manifest can be applied as an alternative. `oc create cm --from-file` instance shows the file contents in line under the `data` field. `oc annotate` has some success with namespaces and OVN-K, but fails with Netnamespaces and SDN.
1 parent d52d73e commit d48a36e

6 files changed

+139
-2
lines changed

modules/nw-disabling-multicast.adoc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,23 @@ $ oc annotate {namespace} <namespace> \ <1>
3333
----
3434
+
3535
<1> The `namespace` for the project you want to disable multicast for.
36+
ifeval::["{context}" == "ovn-kubernetes-disabling-multicast"]
37+
+
38+
[TIP]
39+
====
40+
You can alternatively apply the following YAML to delete the annotation:
41+
42+
[source,yaml]
43+
----
44+
apiVersion: v1
45+
kind: Namespace
46+
metadata:
47+
name: <namespace>
48+
annotations:
49+
k8s.ovn.org/multicast-enabled: null
50+
----
51+
====
52+
endif::[]
3653

3754
ifeval::["{context}" == "openshift-sdn-disabling-multicast"]
3855
:!annotation:

modules/nw-egress-ips-node.adoc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,18 @@ $ oc label nodes <node_name> k8s.ovn.org/egress-assignable="" <1>
2222
----
2323
+
2424
<1> The name of the node to label.
25+
+
26+
[TIP]
27+
====
28+
You can alternatively apply the following YAML to add the label to a node:
29+
30+
[source,yaml]
31+
----
32+
apiVersion: v1
33+
kind: Node
34+
metadata:
35+
labels:
36+
k8s.ovn.org/egress-assignable: ""
37+
name: <node_name>
38+
----
39+
====

modules/nw-egress-router-configmap.adoc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,30 @@ $ oc create configmap egress-routes \
5151
----
5252
+
5353
In the previous command, the `egress-routes` value is the name of the `ConfigMap` object to create and `my-egress-destination.txt` is the name of the file that the data is read from.
54+
+
55+
[TIP]
56+
====
57+
You can alternatively apply the following YAML to create the config map:
58+
59+
[source,yaml]
60+
----
61+
apiVersion: v1
62+
kind: ConfigMap
63+
metadata:
64+
name: egress-routes
65+
data:
66+
destination: |
67+
# Egress routes for Project "Test", version 3
68+
69+
80 tcp 203.0.113.25
70+
71+
8080 tcp 203.0.113.26 80
72+
8443 tcp 203.0.113.26 443
73+
74+
# Fallback
75+
203.0.113.27
76+
----
77+
====
5478

5579
. Create an egress router pod definition and specify the `configMapKeyRef` stanza for the `EGRESS_DESTINATION` field in the environment stanza:
5680
+

modules/nw-enabling-multicast.adoc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,23 @@ You can enable multicast between pods for your project.
3131
$ oc annotate {namespace} <namespace> \
3232
{annotation}
3333
----
34+
ifeval::["{context}" == "ovn-kubernetes-enabling-multicast"]
35+
+
36+
[TIP]
37+
====
38+
You can alternatively apply the following YAML to add the annotation:
39+
40+
[source,yaml]
41+
----
42+
apiVersion: v1
43+
kind: Namespace
44+
metadata:
45+
name: <namespace>
46+
annotations:
47+
k8s.ovn.org/multicast-enabled: "true"
48+
----
49+
====
50+
endif::[]
3451

3552
.Verification
3653

modules/nw-nodeport-service-range-edit.adoc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@ $ oc patch network.config.openshift.io cluster --type=merge -p \
2525
}'
2626
----
2727
+
28+
[TIP]
29+
====
30+
You can alternatively apply the following YAML to update the node port range:
31+
32+
[source,yaml]
33+
----
34+
apiVersion: config.openshift.io/v1
35+
kind: Network
36+
metadata:
37+
name: cluster
38+
spec:
39+
serviceNodePortRange: "30000-<port>"
40+
----
41+
====
42+
+
2843
.Example output
2944
[source,terminal]
3045
----

modules/nw-sriov-configuring-operator.adoc

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,22 @@ $ oc patch sriovoperatorconfig default \
106106
--type=merge -n openshift-sriov-network-operator \
107107
--patch '{ "spec": { "enableInjector": <value> } }'
108108
----
109+
+
110+
[TIP]
111+
====
112+
You can alternatively apply the following YAML to update the Operator:
113+
114+
[source,yaml]
115+
----
116+
apiVersion: sriovnetwork.openshift.io/v1
117+
kind: SriovOperatorConfig
118+
metadata:
119+
name: default
120+
namespace: openshift-sriov-network-operator
121+
spec:
122+
enableInjector: <value>
123+
----
124+
====
109125

110126
[id="disable-enable-sr-iov-operator-admission-control-webhook_{context}"]
111127
== Disabling or enabling the SR-IOV Network Operator admission controller webhook
@@ -128,6 +144,22 @@ $ oc patch sriovoperatorconfig default --type=merge \
128144
-n openshift-sriov-network-operator \
129145
--patch '{ "spec": { "enableOperatorWebhook": <value> } }'
130146
----
147+
+
148+
[TIP]
149+
====
150+
You can alternatively apply the following YAML to update the Operator:
151+
152+
[source,yaml]
153+
----
154+
apiVersion: sriovnetwork.openshift.io/v1
155+
kind: SriovOperatorConfig
156+
metadata:
157+
name: default
158+
namespace: openshift-sriov-network-operator
159+
spec:
160+
enableOperatorWebhook: <value>
161+
----
162+
====
131163

132164
[id="configuring-custom-nodeselector_{context}"]
133165
== Configuring a custom NodeSelector for the SR-IOV Network Config daemon
@@ -153,9 +185,26 @@ $ oc patch sriovoperatorconfig default --type=json \
153185
--patch '[{
154186
"op": "replace",
155187
"path": "/spec/configDaemonNodeSelector",
156-
"value": {<node-label>}
188+
"value": {<node_label>}
157189
}]'
158190
----
159191
+
160-
Replace `<node-label>` with a label to apply as in the following example:
192+
Replace `<node_label>` with a label to apply as in the following example:
161193
`"node-role.kubernetes.io/worker": ""`.
194+
+
195+
[TIP]
196+
====
197+
You can alternatively apply the following YAML to update the Operator:
198+
199+
[source,yaml]
200+
----
201+
apiVersion: sriovnetwork.openshift.io/v1
202+
kind: SriovOperatorConfig
203+
metadata:
204+
name: default
205+
namespace: openshift-sriov-network-operator
206+
spec:
207+
configDaemonNodeSelector:
208+
<node_label>
209+
----
210+
====

0 commit comments

Comments
 (0)