Skip to content

Commit aac5a57

Browse files
authored
Merge pull request #43723 from skrthomas/bugzilla2028564
BZ2028564:adding CLI procedure for deploying kmstate operator
2 parents f11fef0 + 7f1194e commit aac5a57

File tree

2 files changed

+104
-1
lines changed

2 files changed

+104
-1
lines changed
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
// This is included in the following assemblies:
2+
//
3+
// networking/k8s_nmstate/k8s-nmstate-about-the-kubernetes-nmstate-operator.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="installing-the-kubernetes-nmstate-operator-CLI_{context}"]
7+
= Installing the Kubernetes NMState Operator using the CLI
8+
You can also install the Kubernetes NMState Operator by using the {product-title} CLI (oc).
9+
10+
.Prerequisites
11+
12+
* You have installed the OpenShift CLI (`oc`).
13+
14+
* You are logged in as a user with `cluster-admin` privileges.
15+
16+
.Procedure
17+
18+
. Create the `nmstate` Operator namespace:
19+
+
20+
[source,terminal]
21+
----
22+
$ cat << EOF | oc apply -f -
23+
apiVersion: v1
24+
kind: Namespace
25+
metadata:
26+
labels:
27+
kubernetes.io/metadata.name: openshift-nmstate
28+
name: openshift-nmstate
29+
name: openshift-nmstate
30+
spec:
31+
finalizers:
32+
- kubernetes
33+
EOF
34+
----
35+
36+
. Create the `OperatorGroup`:
37+
+
38+
[source,terminal]
39+
----
40+
$ cat << EOF | oc apply -f -
41+
apiVersion: operators.coreos.com/v1
42+
kind: OperatorGroup
43+
metadata:
44+
annotations:
45+
olm.providedAPIs: NMState.v1.nmstate.io
46+
generateName: openshift-nmstate-
47+
name: openshift-nmstate-tn6k8
48+
namespace: openshift-nmstate
49+
spec:
50+
targetNamespaces:
51+
- openshift-nmstate
52+
EOF
53+
----
54+
. Subscribe to the `nmstate` Operator:
55+
+
56+
[source,terminal]
57+
----
58+
$ cat << EOF| oc apply -f -
59+
apiVersion: operators.coreos.com/v1alpha1
60+
kind: Subscription
61+
metadata:
62+
labels:
63+
operators.coreos.com/kubernetes-nmstate-operator.openshift-nmstate: ""
64+
name: kubernetes-nmstate-operator
65+
namespace: openshift-nmstate
66+
spec:
67+
channel: stable
68+
installPlanApproval: Automatic
69+
name: kubernetes-nmstate-operator
70+
source: redhat-operators
71+
sourceNamespace: openshift-marketplace
72+
EOF
73+
----
74+
75+
. Create instance of the `nmstate` operator:
76+
+
77+
[source,terminal]
78+
----
79+
$ cat << EOF | oc apply -f -
80+
apiVersion: nmstate.io/v1
81+
kind: NMState
82+
metadata:
83+
name: nmstate
84+
EOF
85+
----
86+
87+
.Verification
88+
Confirm that the deployment for the `nmstate` operator is running:
89+
90+
[source,terminal]
91+
----
92+
oc get clusterserviceversion -n openshift-nmstate \
93+
-o custom-columns=Name:.metadata.name,Phase:.status.phase
94+
----
95+
96+
.Example output
97+
[source, terminal]
98+
----
99+
Name Phase
100+
kubernetes-nmstate-operator.4.10.0-202203120157 Succeeded
101+
----

networking/k8s_nmstate/k8s-nmstate-about-the-k8s-nmstate-operator.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,7 @@ Red Hat supports the Kubernetes NMState Operator in production environments on b
1616
include::snippets/technology-preview.adoc[]
1717

1818
Before you can use NMState with {product-title}, you must install the Kubernetes NMState Operator.
19-
19+
[id="{context}_installation_and_deployment"]
20+
=== Installing the nmstate operator
2021
include::modules/k8s-nmstate-installing-the-kubernetes-nmstate-operator.adoc[leveloffset=+1]
22+
include::modules/k8s-nmstate-deploying-nmstate-CLI.adoc[leveloffset=+2]

0 commit comments

Comments
 (0)