Skip to content

Commit fde2110

Browse files
authored
Merge pull request #29336 from adellape/update_osdk_cli_path
Add OSDK to CLI Tools guide and update mirror path
2 parents f5a1194 + 0e2f9f5 commit fde2110

File tree

4 files changed

+36
-239
lines changed

4 files changed

+36
-239
lines changed

_topic_map.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,9 @@ Topics:
546546
- Name: opm CLI
547547
File: opm-cli
548548
Distros: openshift-enterprise,openshift-webscale,openshift-origin
549+
- Name: Operator SDK
550+
File: operator-sdk
551+
Distros: openshift-enterprise,openshift-webscale,openshift-origin
549552
---
550553
Name: Security and compliance
551554
Dir: security
@@ -1137,7 +1140,7 @@ Topics:
11371140
Topics:
11381141
- Name: About Operator SDK
11391142
File: osdk-about
1140-
- Name: Installing the CLI
1143+
- Name: Installing the Operator SDK CLI
11411144
File: osdk-installing-cli
11421145
- Name: Go-based Operators
11431146
Dir: golang

cli_reference/operator-sdk.adoc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[id="cli-tools-osdk"]
2+
= Installing the Operator SDK CLI
3+
include::modules/common-attributes.adoc[]
4+
:context: cli-tools-osdk
5+
6+
toc::[]
7+
8+
The Operator SDK provides a CLI tool that Operator developers can use to create, build, and deploy a new Operator project. You can install the SDK CLI on your workstation so you are prepared to start authoring your own Operators.
9+
10+
[NOTE]
11+
====
12+
{product-title} 4.7 supports Operator SDK v1.3.0.
13+
====
14+
15+
include::modules/osdk-installing-cli-linux-macos.adoc[leveloffset=+1]
16+
17+
[id="cli-tools-osdk-addtl-resources"]
18+
== Additional resources
19+
20+
See xref:../operators/operator_sdk/osdk-about.adoc#osdk-about[Developing Operators] for full documentation on the Operator SDK.

modules/osdk-installing-cli-linux-macos.adoc

Lines changed: 7 additions & 238 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
//
33
// * operators/operator_sdk/osdk-installing-cli.adoc
44

5+
:osdk_ver: latest
6+
57
[id="osdk-installing-cli-linux-macos_{context}"]
68
= Installing the Operator SDK CLI on Linux or macOS
79

@@ -19,15 +21,15 @@ endif::[]
1921

2022
.Procedure
2123

22-
. Navigate to the link:https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/operator-sdk/4.7.0/[OpenShift mirror site].
24+
. Navigate to the link:https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/operator-sdk/{osdk_ver}/[OpenShift mirror site].
2325

24-
. From the `4.7.0/` directory, download the latest version of the tarball that matches your operating system. Linux tarballs have a `-linux.tar.gz` suffix, and macOS tarballs have a `-darwin.tar.gz` suffix.
26+
. From the `{osdk_ver}` directory, download the latest version of the tarball that matches your operating system. Linux tarballs have a `-linux.tar.gz` suffix, and macOS tarballs have a `-darwin.tar.gz` suffix.
2527

2628
. Unpack the archive:
2729
+
28-
[source,terminal]
30+
[source,terminal,subs="attributes+"]
2931
----
30-
$ tar xvzf operator-sdk-<version>-<os>.tar.gz
32+
$ tar xvf operator-sdk-v1.3.0-ocp-<os>.tar.gz
3133
----
3234

3335
. Make the file executable:
@@ -61,237 +63,4 @@ $ sudo mv operator-sdk-<release_version>-x86_64-linux-gnu /usr/local/bin/operato
6163
$ operator-sdk version
6264
----
6365

64-
////
65-
. Set the release version variable:
66-
+
67-
[source,terminal]
68-
----
69-
$ RELEASE_VERSION=v0.19.4
70-
----
71-
72-
. Download the release binary.
73-
+
74-
--
75-
* For Linux:
76-
+
77-
[source,terminal]
78-
----
79-
$ curl -OJL https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu
80-
----
81-
82-
* For macOS:
83-
+
84-
[source,terminal]
85-
----
86-
$ curl -OJL https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin
87-
----
88-
--
89-
90-
. Verify the downloaded release binary.
91-
92-
.. Download the provided `.asc` file.
93-
+
94-
--
95-
* For Linux:
96-
+
97-
[source,terminal]
98-
----
99-
$ curl -OJL https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu.asc
100-
----
101-
102-
* For macOS:
103-
+
104-
[source,terminal]
105-
----
106-
$ curl -OJL https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin.asc
107-
----
108-
--
109-
110-
.. Place the binary and corresponding `.asc` file into the same directory and run the following command to verify the binary:
111-
+
112-
--
113-
* For Linux:
114-
+
115-
[source,terminal]
116-
----
117-
$ gpg --verify operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu.asc
118-
----
119-
120-
* For macOS:
121-
+
122-
[source,terminal]
123-
----
124-
$ gpg --verify operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin.asc
125-
----
126-
--
127-
+
128-
If you do not have the public key of the maintainer on your workstation, you will get the following error:
129-
+
130-
.Example output with error
131-
[source,terminal]
132-
----
133-
$ gpg: assuming signed data in 'operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin'
134-
$ gpg: Signature made Fri Apr 5 20:03:22 2019 CEST
135-
$ gpg: using RSA key <key_id> <1>
136-
$ gpg: Can't check signature: No public key
137-
----
138-
<1> RSA key string.
139-
+
140-
To download the key, run the following command, replacing `<key_id>` with the RSA key string provided in the output of the previous command:
141-
+
142-
[source,terminal]
143-
----
144-
$ gpg [--keyserver keys.gnupg.net] --recv-key "<key_id>" <1>
145-
----
146-
<1> If you do not have a key server configured, specify one with the `--keyserver` option.
147-
148-
. Install the release binary in your `PATH`:
149-
+
150-
--
151-
* For Linux:
152-
+
153-
[source,terminal]
154-
----
155-
$ chmod +x operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu
156-
----
157-
+
158-
[source,terminal]
159-
----
160-
$ sudo cp operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu /usr/local/bin/operator-sdk
161-
----
162-
+
163-
[source,terminal]
164-
----
165-
$ rm operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu
166-
----
167-
168-
* For macOS:
169-
+
170-
[source,terminal]
171-
----
172-
$ chmod +x operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin
173-
----
174-
+
175-
[source,terminal]
176-
----
177-
$ sudo cp operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin /usr/local/bin/operator-sdk
178-
----
179-
+
180-
[source,terminal]
181-
----
182-
$ rm operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin
183-
----
184-
--
185-
186-
. Verify that the CLI tool was installed correctly:
187-
+
188-
[source,terminal]
189-
----
190-
$ operator-sdk version
191-
----
192-
193-
[id="osdk-installing-cli-homebrew_{context}"]
194-
== Installing from Homebrew
195-
196-
You can install the SDK CLI using Homebrew.
197-
198-
.Prerequisites
199-
200-
- link:https://brew.sh/[Homebrew]
201-
ifdef::openshift-origin[]
202-
- link:https://docs.docker.com/install/[`docker`] v17.03+, link:https://github.com/containers/libpod/blob/master/install.md[`podman`] v1.2.0+, or link:https://github.com/containers/buildah/blob/master/install.md[`buildah`] v1.7+
203-
endif::[]
204-
ifndef::openshift-origin[]
205-
- `docker` v17.03+, `podman` v1.9.3+, or `buildah` v1.7+
206-
endif::[]
207-
- OpenShift CLI (`oc`) v{product-version}+ installed
208-
- Access to a cluster based on Kubernetes v1.12.0+
209-
- Access to a container registry
210-
211-
.Procedure
212-
213-
. Install the SDK CLI using the `brew` command:
214-
+
215-
[source,terminal]
216-
----
217-
$ brew install operator-sdk
218-
----
219-
220-
. Verify that the CLI tool was installed correctly:
221-
+
222-
[source,terminal]
223-
----
224-
$ operator-sdk version
225-
----
226-
227-
[id="osdk-installing-cli-source_{context}"]
228-
== Compiling and installing from source
229-
230-
You can obtain the Operator SDK source code to compile and install the SDK CLI.
231-
232-
.Prerequisites
233-
234-
- link:https://git-scm.com/downloads[Git]
235-
- link:https://golang.org/dl/[Go] v1.13+
236-
ifdef::openshift-origin[]
237-
- link:https://docs.docker.com/install/[`docker`] v17.03+, link:https://github.com/containers/libpod/blob/master/install.md[`podman`] v1.2.0+, or link:https://github.com/containers/buildah/blob/master/install.md[`buildah`] v1.7+
238-
endif::[]
239-
ifndef::openshift-origin[]
240-
- `docker` v17.03+, `podman` v1.9.3+, or `buildah` v1.7+
241-
endif::[]
242-
- OpenShift CLI (`oc`) v{product-version}+ installed
243-
- Access to a cluster based on Kubernetes v1.12.0+
244-
- Access to a container registry
245-
246-
.Procedure
247-
248-
. Clone the `operator-sdk` repository:
249-
+
250-
[source,terminal]
251-
----
252-
$ mkdir -p $GOPATH/src/github.com/operator-framework
253-
----
254-
+
255-
[source,terminal]
256-
----
257-
$ cd $GOPATH/src/github.com/operator-framework
258-
----
259-
+
260-
[source,terminal]
261-
----
262-
$ git clone https://github.com/operator-framework/operator-sdk
263-
----
264-
+
265-
[source,terminal]
266-
----
267-
$ cd operator-sdk
268-
----
269-
270-
. Check out the desired release branch:
271-
+
272-
[source,terminal]
273-
----
274-
$ git checkout master
275-
----
276-
277-
. Compile and install the SDK CLI:
278-
+
279-
[source,terminal]
280-
----
281-
$ make dep
282-
----
283-
+
284-
[source,terminal]
285-
----
286-
$ make install
287-
----
288-
+
289-
This installs the CLI binary `operator-sdk` at *_$GOPATH/bin_*.
290-
291-
. Verify that the CLI tool was installed correctly:
292-
+
293-
[source,terminal]
294-
----
295-
$ operator-sdk version
296-
----
297-
////
66+
:!osdk_ver:

operators/operator_sdk/osdk-installing-cli.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,9 @@ toc::[]
77

88
The Operator SDK provides a CLI tool that Operator developers can use to create, build, and deploy a new Operator project. You can install the SDK CLI on your workstation so you are prepared to start authoring your own Operators.
99

10+
[NOTE]
11+
====
12+
{product-title} 4.7 supports Operator SDK v1.3.0.
13+
====
14+
1015
include::modules/osdk-installing-cli-linux-macos.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)