OpenShift: Difference between revisions
Jump to navigation
Jump to search
Line 15: | Line 15: | ||
sudo oc cluster up --public-hostname=your-server-ip | sudo oc cluster up --public-hostname=your-server-ip | ||
</syntaxhighlight> | </syntaxhighlight> | ||
''' | '''IMPORTANT''' | ||
<br> | |||
Edit the file: openshift.local.clusterup/node/node-config.yml and set dnsIP | Edit the file: openshift.local.clusterup/node/node-config.yml and set dnsIP | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
Line 27: | Line 28: | ||
Also make sure you have the DNS options inside the docker config file | Also make sure you have the DNS options inside the docker config file | ||
Edit /etc/docker/daemon.json and add | Edit /etc/docker/daemon.json and add this but do not forget the comma if it already has something | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
"dns": ["8.8.8.8", "8.8.4.4"] | "dns": ["8.8.8.8", "8.8.4.4"] |
Revision as of 23:27, 23 December 2020
Install
apt-get install docker.io -y
systemctl start docker
systemctl enable docker
systemctl status docker
wget https://github.com/openshift/origin/releases/download/v3.11.0/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz
tar -xvzf openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz
cd openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit
sudo mv oc kubectl /usr/local/bin/
sudo mkdir /opt/openshift
sudo cd /opt/openshift
sudo oc cluster up --public-hostname=your-server-ip
IMPORTANT
Edit the file: openshift.local.clusterup/node/node-config.yml and set dnsIP
dnsIP: "8.8.8.8"
Edit the file openshift.local.clusterup/kubedns/resolv.conf and add
nameserver 8.8.8.8
nameserver 8.8.4.4
Also make sure you have the DNS options inside the docker config file
Edit /etc/docker/daemon.json and add this but do not forget the comma if it already has something
"dns": ["8.8.8.8", "8.8.4.4"]
Start Stop Cluster
sudo oc cluster down
sudo oc cluster up
Pods
OpenShift Pods contain containers. It is recommended one pod per container.
Deployment
There are 3 ways to deploy an openshift container.
- Predefined containers
- Manual
- Dockerfile
- Yaml
- Most flexible
- Openshift Application catalogue
- Predefined application
- Easy to deploy
- Easy to integrate into custom applications
- Source to Image (s2i)
- Fastest to deploy
- Support for several programming language
- Customizable
List of 3.1 commands
- Basic CLI Operations
- types
- login
- logout
- new-project
- new-app
- status
- project
- Application Modification CLI Operations
- get
- describe
- edit
- env
- volume
- label
- expose
- delete
- Build and Deployment CLI Operations
- start-build
- deploy
- rollback
- new-build
- cancel-build
- import-image
- scale
- tag
- Advanced Commands
- create
- update
- process
- run
- export
- policy
- secrets
- Troubleshooting and Debugging CLI Operations
- logs
- exec
- rsh
- rsync
- port-forward
- proxy
oc commands
- sudo oc login
Login so you can do stuff
- sudo oc config view
View configured clusters
- oc project
View current project
- oc status
Show status
- oc get projects
Show all projects
- oc delete project <project_name>
Deleting a project