Archive for the ‘OpenShift’ Category

Openshift tips, tricks and cheats

Posted: 9 January 2017 in OpenShift

Here are a few tips and tricks and stored commands I use when dealing with Openshift.

start/stop openshift

systemctl start atomic-openshift-master

systemctl stop atomic-openshift-master

start/stop docker

systemctl start docker

systemctl stop docker

Login as an administator

oc login -u system:admin

Configure login into an external docker repository

oc secrets new-dockercfg docker-snapshots \
 --docker-server=$EXTERNAL_DOCKER_REPO_HOST:$EXTERNAL_DOCKER_REPO_PORT \
 --docker-username=$LDAP_USERNAME \
 --docker-password=$LDAP_PASSWORD \
 --docker-email=$LDAP_USERNAME@$DOMAIN

Manually login in he private docker repository

export AUTH_TOKEN=`oc whoami -t`
docker login -u $LDAP_USERNAME -e $LDAP_USERNAME@$DOMAIN \
    -p $AUTH_TOKEN $INTERNAL_DOCKER_REPO_HOST:$INTERNAL_DOCKER_REPO_PORT
docker login -u $LDAP_USERNAME -e $LDAP_USERNAME@$DOMAIN \
    -p $LDAP_PASSWORD $EXTERNAL_DOCKER_REPO_HOST:$EXTERNAL_DOCKER_REPO_PORT
Advertisements