Secret

GNU/Linux Openshift Frequently Used Command

Delete evicted pods from current OpenShift project.

oc get pods | grep Evicted | awk '{print $1}' | xargs oc delete pod

Create an OpenShift secret from the command line.

oc create secret generic gateway1 --from-file=server.p12

GNU/Linux OpenShift Where is My Secret Used?

A simple bash-script for OpenShift to determine which deployment configs make use of a specific secret (within the active project).

#!/bin/bash

oc get dc -o custom-columns="Name:metadata.name,readyReplicas:status.availableReplicas,Volumes:spec.template.spec.volumes,env:spec.template.spec.containers[].env,envFrom:spec.template.spec.containers[].envFrom,Volumes:spec.template.spec.volumes" | grep -E "($1)" | grep -oE "^[a-z0-9-]{3,99}"

$ os-sec-usage.sh secretname