Skip to content

Commit

Permalink
Update Openshift.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lwindolf authored Nov 28, 2023
1 parent 43f8e44 commit a9462f0
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions cheat-sheet/kubernetes/Openshift.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ Settings are stored in ~/.kube/config
Note: all `kubectl` commands also work with the `oc` client.

oc login [<cluster>]
oc login --username=<user>

oc projects # List projects
oc project <project> # Switch project
oc new-project <project>
oc whoami -t # Get current session API token

oc whoami -t # Get current session API token

Creating application from remote repo

oc new-app https://github.com/name/project
Expand Down Expand Up @@ -91,20 +94,6 @@ Check the API server logs to detect cert errors

oc adm policy add-scc-to-user anyuid -z runasanyuid --as system:admin # Allow a user a new SCC

## Initial Setup

Commands derived from [jaxenter.com](https://jaxenter.com/manage-container-resource-kubernetes-141977.html) for Openshift:

### Set initial admin pwd

Either use

oc login -u system:admin

or create credential on master

sudo htpasswd -b /etc/openshift/openshift-passwd admin <your_pass>

### Print per cluster node resource usage

oc get nodes --no-headers | awk '{print $1}' | xargs -I {} sh -c 'echo {}; oc describe node {} | grep Allocated -A 5 | grep -ve Event -ve Allocated -ve percent -ve -- ; echo'
Expand All @@ -127,10 +116,6 @@ Note that the resulting JSON will have no parameters yet. You'll have to
identify places to replace with parameters (syntax is "${PARAMETER}") and
to declare those parameters.

## Orchestration

- [Using Terraform with Openshift](https://medium.com/@fabiojose/platform-as-code-with-openshift-terraform-1da6af7348ce)

## Configuring Registries

- https://docs.openshift.com/container-platform/4.4/openshift_images/image-configuration.html (whitelisting/blacklisting external registry domains)
Expand Down

0 comments on commit a9462f0

Please sign in to comment.