Skip to content

Instantly share code, notes, and snippets.

@alaypatel07
Last active May 21, 2020 19:24
Show Gist options
  • Save alaypatel07/d3c81aa0039da23b2bb557101f5f54f6 to your computer and use it in GitHub Desktop.
Save alaypatel07/d3c81aa0039da23b2bb557101f5f54f6 to your computer and use it in GitHub Desktop.
htpasswd -c -B -b users.htpasswd bob bob
oc create secret generic htpass-secret --from-file=htpasswd=./users.htpasswd -n openshift-config
oc patch oauth cluster --type='json' -p '[ { "op": "replace", "path": "/spec", "value": {"identityProviders": [{"htpasswd": {"fileData": {"name": "htpass-secret"}}, "mappingMethod": "claim", "name": "bob_httpassd_provider", "type": "HTPasswd"}]}}]'
oc login -u bob -p bob
oc new-project bob-destination
oc login -u kubeadmin -p $KUBEADMIN_PASSWORD
cat <<EOF | oc create -f -
apiVersion: migration.openshift.io/v1alpha1
kind: MigrationTenant
metadata:
name: migration-controller
namespace: bob-destination
spec:
migration_controller: "true"
migration_ui: "true"
olm_managed: true
version: 1.0 (OLM)
EOF
rm users.htpasswd
@alaypatel07
Copy link
Author

please export KUBECONFIG and KUBEADMIN_PASSWORD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment