Coder Social home page Coder Social logo

container-cheatsheet's Introduction

Openshift-Cheatsheet

Approve CSR

oc get csr -o name | sed -e 's/.*\///g' | xargs -I {} oc adm certificate approve {}

oc adm certificate approve $(oc get csr | grep -i pending | awk '{print $1}' | grep -v NAME)

Print out global pull secret

oc get secret pull-secret -n openshift-config -o yaml -o jsonpath='{.data.\.dockerconfigjson}' | base64 -d | jq

See trusted CA

oc get image.config.openshift.io/cluster -o yaml

Check pull secret on OCP nodes

# pull secret on normal cluster
cat /var/lib/kubelet/config.json

# pull secret on ROKS cluster
cat ~/.docker/config.json

# mirror registry file
cat /etc/containers/registries.conf

# trim String - remove first part
echo "delimited.string" | cut -d '.' -f2-

See the syntax for different k8s objects

oc explain pods --recursive

Get Ingress Domain

oc get --namespace=openshift-ingress-operator ingresscontroller/default -o jsonpath='{.status.domain}'

Add SCC

oc adm policy add-scc-to-user anyuid -z my-serviceaccount

Point to specific PVC for image registry and enable

oc patch configs.imageregistry.operator.openshift.io cluster --type merge --patch \
  '{"spec":{"storage":{"pvc":{"claim":"image-registry-storage"}}}}'
  
# Enable
oc patch configs.imageregistry.operator.openshift.io cluster --type merge --patch \
  '{"spec":{"managementState":"Managed"}}'

OpenSSL

Show certs on target host/port

openssl s_client -connect $HOST:$PORT -showcerts

Podman/Docker

Show selected fields

sudo podman ps --format="{{.ID}} {{.Names}} {{.Ports}}"

Save Text with 'cat'

cat << EOF > kafka.properties
bootstrap.servers=kafka:9071
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="test" password="test123";
sasl.mechanism=PLAIN
security.protocol=SASL_PLAINTEXT
EOF

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.