Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gautric/k8s-ocp-tips
https://github.com/gautric/k8s-ocp-tips
k8s kubernetes ocp openshift tips
Last synced: 10 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/gautric/k8s-ocp-tips
- Owner: gautric
- Created: 2021-06-23T12:49:27.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-09T14:12:07.000Z (about 2 years ago)
- Last Synced: 2024-10-20T08:59:02.947Z (18 days ago)
- Topics: k8s, kubernetes, ocp, openshift, tips
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
Awesome Lists containing this project
README
# Kubernetes & Openshift Tips (K8S OCP)
## Openshift Registry URL
#### Open the route footnote:nca[need clusteradmin role]
oc patch configs.imageregistry.operator.openshift.io/cluster --patch '{"spec":{"defaultRoute":true}}' --type=merge#### Retrieve the route
oc get route default-route -n openshift-image-registry --template='{{.spec.host }}'REGISTRY_ROUTE=$(oc get route default-route -n openshift-image-registry --template='{{.spec.host }}')
#### Login with docker/podman CLI
podman login -u $(oc whoami) -p $(oc whoami -t) --tls-verify=false ${REGISTRY_ROUTE}
docker login -u $(oc whoami) -p $(oc whoami -t) ${REGISTRY_ROUTE}
#### Tag Image locally
docker tag ${IMAGE_NAME}:latest ${IMAGE_NAME}:${IMAGE_VERSION}docker tag ${IMAGE_NAME}:${IMAGE_VERSION} ${REGISTRY_ROUTE}/${NAMESPACE}/${IMAGE_NAME}:${IMAGE_VERSION}
#### Push to Openshift Registry
docker push ${REGISTRY_ROUTE}/${NAMESPACE}/${IMAGE_NAME}:${IMAGE_VERSION}
### ServiceAccount role
#### Add admin Role to SA
oc adm policy add-role-to-user admin system:serviceaccount:${NAMESPACE}:default -n ${NAMESPACE}
### OpenShift
#### Check Openshift version
kubectl get clusterversion version -o yaml
#### Retrieve YAML from OC client command
--dry-run=client -o yaml
### Operator
#### List all Operator available
kubectl get packagemanifests -n openshift-marketplace
#### Describe Operatorkubectl describe packagemanifests ${OPT_NAME} -n openshift-marketplace
### Logs
oc logs -f ${POD}### Build
oc start-build ${BUILD_CONFIG} --follow
### Secret
oc get secret/${SECRET} -o json | jq '.data["tls.crt"]' -r | base64 -d### Delete
oc delete all,configmap,pvc,serviceaccount,rolebinding,dc,bc --selector app=${APP}
### Deployment#### Get the deployment name
kubectl get deployment
#### Restart the deployment
kubectl rollout restart deployment
### Helm#### Create Helm Chart
helm create
#### Create Helm Chart
helm install . --namespace#### Debug Helm Chart
helm install . --namespace --dry-run --debug#### Delete Helm Chart
helm delete --namespace