Networking Flashcards
review the configuration of the DNS operator
oc describe dns.operator/default
Expose a service so it is accessible with a given hostname
oc expose service api-frontend –hostname api.apps.acme.com
create a secure edge route with a TLS certificate
oc create route edge
–service api-frontend
–hostname api.apps.acme.com
–key api.key
–cert api.crt
Create the network policy
oc create -n network-policy -f allow-specific.yaml
View the network policies in the network-policy namespace
oc get networkpolicies -n network-policy
apply the name=network-test label to a namespace
oc label namespace network-test name=network-test
label a node with env=dev
oc label node master01 env=dev
change an existing label
oc label node master01 env=prod –overwrite
Remove a label
oc label node master01 env-
see labels assigned to a node
oc get node master02 –show-labels
determine the value of a single label for a node
oc get node -L failure-domain.beta.kubernetes.io/region
Get list of machines
oc get machines -n openshift-machine-api -o wide
Get list of machine sets
oc get machineset -n openshift-machine-api
edit a machine set
oc edit machineset ocp-qz7hf-worker-us-west-1b -n openshift-machine-api
configure app so that its pods only run on nodes with label env=qa
oc patch deployment/myapp –patch \
> ‘{“spec”:{“template”:{“spec”:{“nodeSelector”:{“env”:”dev”}}}}}’