Monday, December 11, 2017

Minishift v3.6


Install and configure Minishift using Virtual box


C:\Users\Rengs>minishift config set memory 4096
No Minishift instance exists. New memory setting will be applied on next 'minishift start'

C:\Users\Rengs>minishift config set openshift-version v3.6.0


C:\Users\Rengs>minishift config set memory 4096
-- Installing default add-ons ... OK
No Minishift instance exists. New memory setting will be applied on next 'minishift start'

C:\Users\Rengs>minishift --show-libmachine-logs start --vm-driver=virtualbox
-- Starting local OpenShift cluster using 'virtualbox' hypervisor ...
-- Minishift VM will be configured with ...
   Memory:    4 GB
   vCPUs :    2
   Disk size: 20 GB

   Downloading ISO 'https://github.com/minishift/minishift-b2d-iso/releases/download/v1.2.0/minishift-b2d.iso'
 40.00 MiB / 40.00 MiB 

[============================================================] 100.00% 0s
-- Starting Minishift VM ....(minishift) Trying to access option engine-install-url which does not exist
(minishift) THIS ***WILL*** CAUSE UNEXPECTED BEHAVIOR
(minishift) Type assertion did not go smoothly to string for key engine-install-url
(minishift) Trying to access option swarm-master which does not exist
(minishift) THIS ***WILL*** CAUSE UNEXPECTED BEHAVIOR
(minishift) Type assertion did not go smoothly to bool for key swarm-master
(minishift) Trying to access option swarm-host which does not exist
(minishift) THIS ***WILL*** CAUSE UNEXPECTED BEHAVIOR
(minishift) Type assertion did not go smoothly to string for key swarm-host
(minishift) Trying to access option swarm-discovery which does not exist
(minishift) THIS ***WILL*** CAUSE UNEXPECTED BEHAVIOR
(minishift) Type assertion did not go smoothly to string for key swarm-discovery
(minishift) Type assertion did not go smoothly to bool for key virtualbox-host-dns-resolver
Creating CA: C:\Users\Rengs\.minishift\certs\ca.pem
(minishift) Type assertion did not go smoothly to bool for key virtualbox-hostonly-no-dhcp
(minishift) Type assertion did not go smoothly to bool for key virtualbox-no-share
(minishift) Type assertion did not go smoothly to bool for key virtualbox-no-dns-proxy
(minishift) Type assertion did not go smoothly to bool for key virtualbox-no-vtx-check
Creating client certificate: C:\Users\Rengs\.minishift\certs\cert.pem
Running pre-create checks...
Creating machine...
(minishift) Downloading C:\Users\Rengs\.minishift\cache\boot2docker.iso from file://C:/Users/Rengs/.minishift/cache/iso/minishift-b2d.iso...
(minishift) Creating VirtualBox VM...
(minishift) Creating SSH key...
........(minishift) Starting the VM...
(minishift) Check network to re-create if needed...
..(minishift) Waiting for an IP...
.................Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
.Docker is up and running!
 OK
-- Checking for IP address ... OK
-- Checking if external host is reachable from the Minishift VM ...
   Pinging 8.8.8.8 ... OK
-- Checking HTTP connectivity from the VM ...
   Retrieving http://minishift.io/index.html ... OK
-- Checking if persistent storage volume is mounted ... OK
-- Checking available disk space ... 0% OK
-- Downloading OpenShift binary 'oc' version 'v3.6.0'
 33.92 MiB / 33.92 MiB 

[====================================================================] 100.00% 0s
- Downloading OpenShift v3.6.0 checksums ... OK
-- OpenShift cluster will be configured with ...
   Version: v3.6.0
-- Checking `oc` support for startup flags ...
   host-data-dir ... OK
   host-pv-dir ... OK
   host-volumes-dir ... OK
   routing-suffix ... OK
   host-config-dir ... OK
Starting OpenShift using openshift/origin:v3.6.0 ...
Pulling image openshift/origin:v3.6.0
Pulled 1/4 layers, 26% complete
Pulled 1/4 layers, 37% complete
Pulled 1/4 layers, 49% complete
Pulled 1/4 layers, 62% complete
Pulled 1/4 layers, 73% complete
Pulled 2/4 layers, 82% complete
Pulled 3/4 layers, 90% complete
Pulled 3/4 layers, 98% complete
Pulled 4/4 layers, 100% complete
Extracting
Image pull complete
OpenShift server started.

The server is accessible via web console at:
    https://192.168.99.102:8443

You are logged in as:
    User:     developer
    Password: <any value>

To login as administrator:
    oc login -u system:admin


C:\Users\Rengs>oc login https://192.168.99.102:8443 -u developer -p developer
'oc' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Rengs>

C:\Users\Rengs>minishift oc-env
SET PATH=C:\Users\Rengs\.minishift\cache\oc\v3.6.0;%PATH%
REM Run this command to configure your shell:
REM     @FOR /f "tokens=*" %i IN ('minishift oc-env') DO @call %i

C:\Users\Rengs>

C:\Users\Rengs>SET PATH=C:\Users\Rengs\.minishift\cache\oc\v3.6.0;%PATH%

C:\Users\Rengs>@FOR /f "tokens=*" %i IN ('minishift oc-env') DO @call %i

C:\Users\Rengs>
C:\Users\Rengs>oc login https://192.168.99.102:8443 -u developer -p developer
Login successful.

You have access to the following projects and can switch between them with 'oc project <projectname>':

    my-launcher
  * myproject

Using project "myproject".

C:\Users\Rengs>


C:\Users\Rengs>oc get services -n default
NAME              CLUSTER-IP       EXTERNAL-IP   PORT(S)                   AGE
docker-registry   172.30.1.1       <none>        5000/TCP                  1d
kubernetes        172.30.0.1       <none>        443/TCP,53/UDP,53/TCP     1d
router            172.30.200.222   <none>        80/TCP,443/TCP,1936/TCP   1d

https://appdev.openshift.io/docs/minishift-installation.html#installing-a-openshiftlocal







https://appdev.openshift.io/docs/getting-started.html


Set a Docker environment variable to work with docker daemon runining in minishift node.

C:\Users\Rengs>
C:\Users\Rengs>minishift docker-env
SET DOCKER_TLS_VERIFY=1
SET DOCKER_HOST=tcp://192.168.99.100:2376
SET DOCKER_CERT_PATH=C:\Users\Rengs\.minishift\certs
SET DOCKER_API_VERSION=1.24
REM Run this command to configure your shell:
REM     @FOR /f "tokens=*" %i IN ('minishift docker-env') DO @call %i


C:\Users\Rengs>docker pull openshift/jenkins-2-centos7
C:\Users\Rengs>docker pull openshiftio/launchpad-jenkins-slave

C:\Users\Rengs>docker pull sonatype/nexus


C:\Users\Rengs>oc new-project mynexus
Now using project "mynexus" on server "https://192.168.99.100:8443".

You can add applications to this project with the 'new-app' command. For example, try:

    oc new-app centos/ruby-22-centos7~https://github.com/openshift/ruby-ex.git

to build a new example application in Ruby.

C:\Users\Rengs>
C:\Users\Rengs>oc new-app sonatype/nexus
warning: Cannot find git. Ensure that it is installed and in your path. Git is required to work with git repositories.
--> Found Docker image 45945e5 (3 months old) from Docker Hub for "sonatype/nexus"

    * An image stream will be created as "nexus:latest" that will track this image
    * This image will be deployed in deployment config "nexus"
    * Port 8081/tcp will be load balanced by service "nexus"
      * Other containers can access this service through the hostname "nexus"
    * This image declares volumes and will default to use non-persistent, host-local storage.
      You can add persistent volumes later by running 'volume dc/nexus --add ...'

--> Creating resources ...
    imagestream "nexus" created
    deploymentconfig "nexus" created
    service "nexus" created
--> Success
    Run 'oc status' to view your app.

C:\Users\Rengs>
C:\Users\Rengs>oc status
In project mynexus on server https://192.168.99.100:8443

svc/nexus - 172.30.5.23:8081
  dc/nexus deploys istag/nexus:latest
    deployment #1 pending 2 minutes ago


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

C:\Users\Rengs>oc expose svc/nexus

route "nexus" exposed


No comments:

Post a Comment

AWS Autoscaling demo lab Configuring VPC, Public/Private subnets, Internet Gateway (IGW), NAT gateway, etc.,   Crea...