Skip to content

Instantly share code, notes, and snippets.

@worldofgeese
Last active June 12, 2020 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save worldofgeese/5632ade748c09d95f7876af6a9c6be52 to your computer and use it in GitHub Desktop.
Save worldofgeese/5632ade748c09d95f7876af6a9c6be52 to your computer and use it in GitHub Desktop.
Getting started with OpenShift

Getting Started with OpenShift

I’m going to show the basics of how to manage an OpenShift cluster using the command-line tool, oc.

Download the tool

Replace linux-aarch64 in the following command with your architecture: linux or macosx

wget https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/linux-aarch64/oc.tar.gz

Windows users:

wget https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/windows/oc.zip -o oc.zip

Unpack and place in your PATH. To check your PATH on Linux or macOS, open the Terminal and run:

echo $PATH

Windows users, extract with 7z x oc.zip and move oc.exe to your Desktop

Login with oc

Sign up for OpenShift Online Starter at https://manage.openshift.com. Click on your user profile name at the top right, then “Copy Login Command”. Paste this login command in your shell.

https://i.imgur.com/6WwT0r5.png

Start new project and app

Source app taken from Red Hat’s Getting Started with Python blogpost.

oc new-project sample-flask-app
oc new-app https://github.com/worldofgeese/os-sample-python.git --name=sample-flask-app

The tool will inspect the source code, locate an appropriate image that can build the source code, create an image stream for the new application image that will be built, then create the correct build configuration, deployment configuration and service definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment