Skip to content

Commit 71ed8ef

Browse files
authored
Merge pull request #549 from agrare/update_openshift_dev_guide
Update openshift developer setup guide
2 parents 50482b4 + aba5144 commit 71ed8ef

File tree

1 file changed

+9
-109
lines changed

1 file changed

+9
-109
lines changed

providers/openshift.md

+9-109
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ provider for ManageIQ:
55

66
- using [openshift-ansible](https://github.com/openshift/openshift-ansible) to
77
deploy RPM packages on a cluster
8-
- using [minishift](https://github.com/minishift/minishift) to deploy
8+
- using [CodeReady Containers](https://github.com/crc-org/crc) to deploy
99
openshift source to a vm
1010

1111
You can also use `oc cluster up` and configure it yourself (instructions not
@@ -38,14 +38,14 @@ example file for a cluster composed of two machines (Master and Node):
3838
[OSEv3:children]
3939
masters
4040
nodes
41-
41+
4242
[OSEv3:vars]
4343
ansible_ssh_user=root
4444
deployment_type=origin
45-
45+
4646
[masters]
4747
master_hostname openshift_scheduleable=True
48-
48+
4949
[nodes]
5050
master_hostname
5151
node_hostname
@@ -61,82 +61,6 @@ logging use `openshift_hosted_metrics_deploy=True` and
6161
$ ansible-playbook playbooks/byo/config.yml -i path/to/inventory/file
6262
```
6363

64-
65-
### Running with minishift
66-
67-
68-
For a simple single host setup for working with the openshift provider locally,
69-
you can use [`minishift`](https://github.com/minishift/minishift) to run a
70-
local openshift 3.x instance.
71-
72-
73-
#### Requirements
74-
75-
* [`minishift`](https://github.com/minishift/minishift) >= 1.0.0.rc1 ([Installation Instructions](https://docs.openshift.org/latest/minishift/getting-started/installing.html#installing-instructions))
76-
* Virtualization host of your choice (see supported hypervisors [here](https://docs.openshift.org/latest/minishift/getting-started/installing.html#install-prerequisites))
77-
78-
79-
#### Quickstart
80-
81-
Since VirtualBox is a consistent hypervisor across all platforms, this guide
82-
will assume that is being used, and updates to some commands might be
83-
necessary (most commands should be virtualization software agnostic and work
84-
regardless of the hypervisor).
85-
86-
1. Download and enable the manageiq addon for minishift:
87-
88-
```console
89-
$ mkdir -p ~/minishift/addons
90-
$ git clone https://gist.github.com/e2fac8be87ea0e9f429b6f5d75e02176 ~/minishift/addons/manageiq
91-
$ minishift addons install --force ~/minishift/addons/manageiq
92-
$ minishift addons enable manageiq
93-
```
94-
95-
2. Start minishift:
96-
97-
```console
98-
$ minishift start --vm-driver virtualbox --openshift-version "v3.6.1"
99-
```
100-
101-
You might want to add `--metrics --memory 5G`. As of this writing that only supports hawkular and doesn't work on 3.7.0.
102-
103-
See https://hub.docker.com/r/openshift/origin/tags/ for possible versions.
104-
105-
3. Grab the minishift IP:
106-
107-
```console
108-
$ minishift ip
109-
```
110-
111-
4. Add `oc` and/or `docker` to your PATH, configured to the cluster (auto-detects correct shell):
112-
113-
```console
114-
$ eval $(minishift oc-env)
115-
$ eval $(minishift docker-env)
116-
```
117-
118-
5. Grab the token to access openshift through `manageiq`:
119-
120-
```console
121-
$ oc login -u system:admin
122-
$ oc sa get-token -n management-infra management-admin
123-
```
124-
125-
6. Configure a provider in ManageIQ, filling in your token and IP where
126-
appropriate:
127-
128-
```console
129-
$ bin/rails c
130-
irb> token = '<<YOUR_TOKEN_FROM_ABOVE_HERE>>'
131-
irb> host = '<<YOUR_IP_FROM_ABOVE_HERE>>'
132-
irb> os = ManageIQ::Providers::Openshift::ContainerManager
133-
irb> os.create(:name => "Minishift", :hostname => host, :port => 8443, :ipaddress => host, :zone => Zone.first, :storage_profiles => [], :security_protocol => "ssl-without-validation")
134-
irb> os.last.update_authentication(:bearer => {:auth_key => token, :save => true})
135-
```
136-
137-
Or through the UI if you prefer.
138-
139-
14064
### Running with CodeReady Containers
14165

14266

@@ -147,20 +71,20 @@ vm openshift on your development machine) but is an OpenShift v4 cluster.
14771

14872
#### Requirements
14973

150-
* [`CodeReady Containers`](https://github.com/code-ready/crc) ([Installation Instructions](https://code-ready.github.io/crc/#installation_gsg))
151-
* A compatible [Operating System](https://code-ready.github.io/crc/#minimum-system-requirements-operating-system_gsg) and the [Required software packages](https://code-ready.github.io/crc/#required-software-packages_gsg)
74+
* [`CodeReady Containers`](https://github.com/crc-org/crc) ([Installation Instructions](https://crc.dev/crc/getting_started/getting_started/installing/))
75+
* A compatible [Operating System](https://crc.dev/crc/getting_started/getting_started/installing/#_operating_system_requirements)
15276

15377
#### Quickstart
15478

155-
1. [Download](https://cloud.redhat.com/openshift/install/crc/installer-provisioned) ane extract the latest release of CRC
79+
1. [Download](https://console.redhat.com/openshift/create/local) ane extract the latest release of CRC
15680

15781
```console
15882
tar xfJ crc-linux-amd64.tar.xz
15983
```
16084
2. Copy the crc binary to a location on your PATH
16185

16286
```console
163-
sudo cp crc-linux-1.8.0-amd64/crc /usr/local/bin
87+
sudo install crc-linux-2.39.0-amd64/crc /usr/local/bin/crc
16488
which crc
16589
/usr/local/bin/crc
16690
```
@@ -184,31 +108,7 @@ vm openshift on your development machine) but is an OpenShift v4 cluster.
184108
oc login -u kubeadmin -p KUBEADMING_PASSWORD https://api.crc.testing:6443
185109
```
186110

187-
5. Now you can setup the management-infra/management-admin service account for use with ManageIQ
188-
```console
189-
git clone https://gist.github.com/e2fac8be87ea0e9f429b6f5d75e02176 /tmp/manageiq_crc
190-
oc adm new-project management-infra --description="Management-Infrastructure"
191-
oc create serviceaccount management-admin -n management-infra
192-
oc create -f /tmp/manageiq_crc/management-infra-admin-cluster-role.json
193-
oc policy add-role-to-user -n management-infra admin -z management-admin
194-
oc policy add-role-to-user -n management-infra management-infra-admin -z management-admin
195-
oc adm policy add-cluster-role-to-user cluster-reader system:serviceaccount:management-infra:management-admin
196-
oc adm policy add-scc-to-user privileged system:serviceaccount:management-infra:management-admin
197-
oc adm policy add-cluster-role-to-user system:image-puller system:serviceaccount:management-infra:inspector-admin
198-
oc adm policy add-scc-to-user privileged system:serviceaccount:management-infra:inspector-admin
199-
oc adm policy add-cluster-role-to-user self-provisioner system:serviceaccount:management-infra:management-admin
200-
```
201-
202-
6. Grab the console IP address and token to acess CRC through `ManageIQ`
203-
```console
204-
cluster_ip=$(crc ip)
205-
service_account_token=$(oc sa get-token -n management-infra management-admin)
206-
```
207-
208-
7. Configure a provider in ManageIQ
209-
```console
210-
rails r "ManageIQ::Providers::Openshift::ContainerManager.create!(:name => 'CRC', :hostname => '$cluster_ip', :port => 6443, :zone => Zone.visible.first, :security_protocol => 'ssl-without-validation').update_authentication(:bearer => {:auth_key => '$service_account_token'})"
211-
```
111+
5. Now you can setup the project and service account for use with ManageIQ by following the documentation: https://www.manageiq.org/docs/reference/latest/managing_providers/containers_providers/red_hat_openshift_providers.html
212112

213113
### Automated script to record new VCR
214114

0 commit comments

Comments
 (0)