Created
February 27, 2020 14:23
-
-
Save cwilkers/3585c0a619f8562aa22d7ff65c07bc38 to your computer and use it in GitHub Desktop.
Fix for reaching image registry with unknown CA from devel ocp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
REGISTRY=registry-proxy.engineering.redhat.com | |
true | openssl s_client -showcerts -connect ${REGISTRY}:443 2>/dev/null | openssl x509 > ca.crt | |
oc create configmap registry-cas -n openshift-config --from-file=${REGISTRY}=ca.crt | |
oc patch image.config.openshift.io/cluster --patch '{"spec":{"additionalTrustedCA":{"name":"registry-cas"}}}' --type=merge | |
oc patch configs.imageregistry.operator.openshift.io cluster --type merge --patch '{"spec":{"storage":{"emptyDir":{}}}}' | |
oc patch configs.imageregistry.operator.openshift.io cluster --type merge --patch '{"spec":{"managementState":"Managed"}}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment