Skip to content

Commit df78d66

Browse files
authored
Merge pull request #71854 from ShaunaDiaz/OSDOCS-9692
OSDOCS-9692: adds edit and delete network policy to MicroShift docs
2 parents 6db3f10 + 2270f77 commit df78d66

File tree

6 files changed

+50
-6
lines changed

6 files changed

+50
-6
lines changed

_topic_maps/_topic_map_ms.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,10 @@ Topics:
409409
File: microshift-network-policy-index
410410
- Name: Creating network policies
411411
File: microshift-creating-network-policy
412+
- Name: Editing network policies
413+
File: microshift-editing-network-policy
414+
- Name: Deleting network policies
415+
File: microshift-deleting-network-policy
412416
- Name: Firewall configuration
413417
File: microshift-firewall
414418
- Name: Networking settings for fully disconnected hosts
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="microshift-deleting-network-policy"]
3+
= Deleting a network policy
4+
include::_attributes/common-attributes.adoc[]
5+
include::_attributes/attributes-microshift.adoc[]
6+
:context: microshift-deleting-network-policy
7+
8+
toc::[]
9+
10+
You can delete a network policy from a namespace.
11+
12+
include::modules/nw-networkpolicy-delete-cli.adoc[leveloffset=+1]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="microshift-editing-network-policy"]
3+
= Editing a network policy
4+
include::_attributes/attributes-microshift.adoc[]
5+
include::_attributes/common-attributes.adoc[]
6+
:context: microshift-editing-network-policy
7+
8+
toc::[]
9+
10+
You can edit an existing network policy for a namespace. Typical edits might include changes to the pods to which the policy applies, allowed ingress traffic, and the destination ports on which to accept traffic. The `apiVersion`, `kind`, and `name` fields must not be changed when editing `NetworkPolicy` objects, as these define the resource itself.
11+
12+
//OCP modules, edit using conditionals
13+
include::modules/nw-networkpolicy-edit.adoc[leveloffset=+1]
14+
15+
include::modules/nw-networkpolicy-object.adoc[leveloffset=+1]

modules/nw-networkpolicy-delete-cli.adoc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
// * networking/network_policy/deleting-network-policy.adoc
44
// * networking/multiple_networks/configuring-multi-network-policy.adoc
5+
// * microshift_networking/microshift-network-policy/microshift-editing-network-policy.adoc
56

67
:name: network
78
:role: admin
@@ -17,18 +18,21 @@ endif::[]
1718

1819
You can delete a {name} policy in a namespace.
1920

20-
ifndef::multi[]
21+
ifndef::multi,microshift[]
2122
[NOTE]
2223
====
2324
If you log in with a user with the `cluster-admin` role, then you can delete any network policy in the cluster.
2425
====
25-
endif::multi[]
26+
endif::multi,microshift[]
2627

2728
.Prerequisites
28-
29+
ifndef::microshift[]
2930
* Your cluster uses a network plugin that supports `NetworkPolicy` objects, such as the OVN-Kubernetes network plugin or the OpenShift SDN network plugin with `mode: NetworkPolicy` set. This mode is the default for OpenShift SDN.
31+
endif::microshift[]
3032
* You installed the OpenShift CLI (`oc`).
33+
ifndef::microshift[]
3134
* You are logged in to the cluster with a user with `{role}` privileges.
35+
endif::microshift[]
3236
* You are working in the namespace where the {name} policy exists.
3337

3438
.Procedure
@@ -64,7 +68,9 @@ endif::multi[]
6468
:!name:
6569
:!role:
6670

71+
ifndef::microshift[]
6772
[NOTE]
6873
====
6974
If you log in to the web console with `cluster-admin` privileges, you have a choice of deleting a network policy in any namespace in the cluster directly in YAML or from the policy in the web console through the *Actions* menu.
7075
====
76+
endif::microshift[]

modules/nw-networkpolicy-edit.adoc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Module included in the following assemblies:
22
//
33
// * networking/network_policy/editing-network-policy.adoc
4+
// * microshift_networking/microshift-network-policy/microshift-editing-network-policy.adoc
45

56
:name: network
67
:role: admin
@@ -16,18 +17,21 @@ endif::[]
1617

1718
You can edit a {name} policy in a namespace.
1819

19-
ifndef::multi[]
20+
ifndef::multi,microshift[]
2021
[NOTE]
2122
====
2223
If you log in with a user with the `cluster-admin` role, then you can edit a network policy in any namespace in the cluster.
2324
====
24-
endif::multi[]
25+
endif::multi,microshift[]
2526

2627
.Prerequisites
27-
28+
ifndef::microshift[]
2829
* Your cluster uses a network plugin that supports `NetworkPolicy` objects, such as the OVN-Kubernetes network plugin or the OpenShift SDN network plugin with `mode: NetworkPolicy` set. This mode is the default for OpenShift SDN.
30+
endif::microshift[]
2931
* You installed the OpenShift CLI (`oc`).
32+
ifndef::microshift[]
3033
* You are logged in to the cluster with a user with `{role}` privileges.
34+
endif::microshift[]
3135
* You are working in the namespace where the {name} policy exists.
3236

3337
.Procedure
@@ -95,7 +99,9 @@ endif::multi[]
9599
:!name:
96100
:!role:
97101

102+
ifndef::microshift[]
98103
[NOTE]
99104
====
100105
If you log in to the web console with `cluster-admin` privileges, you have a choice of editing a network policy in any namespace in the cluster directly in YAML or from the policy in the web console through the *Actions* menu.
101106
====
107+
endif::microshift[]

modules/nw-networkpolicy-object.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// * networking/network_policy/editing-network-policy.adoc
66
// * post_installation_configuration/network-configuration.adoc
77
// * microshift_networking/microshift-creating-network-policy.adoc
8+
// * microshift_networking/microshift-network-policy/microshift-editing-network-policy.adoc
89

910
:_mod-docs-content-type: REFERENCE
1011
[id="nw-networkpolicy-object_{context}"]

0 commit comments

Comments
 (0)