From Fedora Project Wiki

< User:Miabbott

Revision as of 13:38, 11 April 2018 by Miabbott (talk | contribs) (workaround for oc cluster up)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

This testcase ensures it's possible to get an OpenShift Cluster running using 'oc cluster up'

Note.png
Prerequisite
This testcase assumes you have already ran the boot test.

Setup

  1. Ensure you have a booted working Atomic Host

How to test

  1. Install 'origin-clients'
# rpm-ostree install origin-clients
  1. Reboot the host
  2. Due to BZ 1558425, we have to reconfigure the 'cgroupdriver' used by docker:
# cp /usr/lib/systemd/system/docker.service /etc/systemd/system/
# sed -i 's/cgroupdriver=systemd/cgroupdriver=cgroupfs/' /etc/systemd/system/docker.service
# systemctl daemon-reload

  1. Configure insecure registries for docker by editing /etc/containers/registries.conf and adding the CIDR range '172.30.0.0/16' under the 'registries.insecure' section:
  # This is a system-wide configuration file used to
  # keep track of registries for various container backends.
  # It adheres to TOML format and does not support recursive
  # lists of registries.

  # The default location for this configuration file is /etc/containers/registries.conf.

  # The only valid categories are: 'registries.search', 'registries.insecure',
  # and 'registries.block'.

  [registries.search]
  registries = ['docker.io', 'registry.fedoraproject.org', 'registry.access.redhat.com']

  # If you need to access insecure registries, add the registry's fully-qualified name.
  # An insecure registry is one that does not have a valid SSL certificate or only does HTTP.
  [registries.insecure]
  registries = ['172.30.0.0/16']


  # If you need to block pull access from a registry, uncomment the section below
  # and add the registries fully-qualified name.
  #
  # Docker only
  [registries.block]
  registries = []

  1. Restart the 'registries' and 'docker' services
 # systemctl restart registries docker
  1. Use 'oc cluster up' to get the OpenShift Origin cluster running
# oc cluster up
  1. You should see some output similar to this:
# oc cluster up                                                                                                                     
Starting OpenShift using openshift/origin:v3.6.0 ...                                                                                            
Pulling image openshift/origin:v3.6.0                                                                    
Pulled 1/4 layers, 28% complete                                                 
Pulled 2/4 layers, 86% complete                                                 
Pulled 3/4 layers, 92% complete                                                                          
Pulled 4/4 layers, 100% complete                          
Extracting                                                
Image pull complete                                                                                      
OpenShift server started.                               
                                                                                                         
The server is accessible via web console at:                                                             
    https://127.0.0.1:8443                                                                               
                                                                                 
You are logged in as:                                                                                    
    User:     developer                                                                                  
    Password: <any value>                                                                                
                                                          
To login as administrator:                                                                               
    oc login -u system:admin                                                                             
                                                                                                   

  1. Login as the administrator
 # oc login -u system:admin
  1. Switch to 'default' project
 # oc project default
  1. Get the 'status' and all the components
# oc status
In project default on server https://127.0.0.1:8443

svc/docker-registry - 172.30.1.1:5000
  dc/docker-registry deploys docker.io/openshift/origin-docker-registry:v3.6.0 
    deployment #1 deployed 7 minutes ago - 1 pod

svc/kubernetes - 172.30.0.1 ports 443->8443, 53->8053, 53->8053

svc/router - 172.30.192.29 ports 80, 443, 1936
  dc/router deploys docker.io/openshift/origin-haproxy-router:v3.6.0 
    deployment #1 deployed 7 minutes ago - 1 pod

View details with 'oc describe <resource>/<name>' or list everything with 'oc get all'.

# oc get all
NAME                 REVISION   DESIRED   CURRENT   TRIGGERED BY
dc/docker-registry   1          1         1         config
dc/router            1          1         1         config

NAME                   DESIRED   CURRENT   READY     AGE
rc/docker-registry-1   1         1         1         8m
rc/router-1            1         1         1         8m

NAME                  CLUSTER-IP      EXTERNAL-IP   PORT(S)                   AGE
svc/docker-registry   172.30.1.1      <none>        5000/TCP                  8m
svc/kubernetes        172.30.0.1      <none>        443/TCP,53/UDP,53/TCP     8m
svc/router            172.30.192.29   <none>        80/TCP,443/TCP,1936/TCP   8m

NAME                           DESIRED   SUCCESSFUL   AGE
jobs/persistent-volume-setup   1         1            8m

NAME                               READY     STATUS      RESTARTS   AGE
po/docker-registry-1-kbn47         1/1       Running     0          7m
po/persistent-volume-setup-trn7f   0/1       Completed   0          8m
po/router-1-hgl3k                  1/1       Running     0          7m

# oc get nodes
NAME        STATUS    AGE       VERSION
localhost   Ready     8m        v1.6.1+5115d708d7


Expected Results

  1. Verify that the status of the OpenShift cluster shows the registry and router deployed
  2. Verify that all of the dc/rc/svcs/po are Running/Ready
  3. Verify that the localhost node is Ready