openshift-release

Deploy OpenShift for e2e testing

Standard setup for an e2e test environment on supported clusters is provided in this directory. Subdirectories contain the default profiles. The deployment uses the openshift/origin-ansible:latest image to launch clusters.

Prerequisites:

Profiles

In each profile, see vars-origin.yaml for the default settings (which is common across all profiles) and vars.yaml for the variables that differ.

Configure a profile

This is the typical workflow to configure the development profile gcp-dev (but would apply to any other profile).

Clone the shared secrets repo to $SHARED_SECRETS:

git clone git@github.com:openshift/shared-secrets.git $SHARED_SECRETS

Copy secrets to their well-known locations in the profile directory:

cp $SHARED_SECRETS/gce/aos-serviceaccount.json $RELEASE_TOOLS/gcp-dev/gce.json

cp $SHARED_SECRETS/gce/cloud-user@gce.pem $RELEASE_TOOLS/gcp-dev/ssh-privatekey

cp $SHARED_SECRETS/mirror/ops-mirror.pem $RELEASE_TOOLS/gcp-dev/ops-mirror.pem

Configure installer variables

Add new installer variables to a file such as gcp-dev/zz_vars.yaml (any YAML file in the profile directory will be treated as a variables file, and for now, the zz_ prefix ensures that your variables will override any predefined ones). Keep in mind that the precedence order of the variable files in the profile is unspecified: to override variables in vars.yaml or vars-origin.yaml just modify those files directly for now.

Usage

You can set an alternate profile by passing PROFILE=gcp on the make arguments.

# launch cluster using the latest RPMs
$ make WHAT=mycluster up

# after cluster is launched, admin.kubeconfig is copied locally
$ KUBECONFIG=gcp-dev/admin.kubeconfig oc status

# teardown cluster
$ make WHAT=mycluster down

# get a shell in the ansible environment
$ make WHAT=mycluster sh

# launch a different profile
$ make WHAT=mycluster PROFILE=gcp-ha

Advanced configuration

The following ansible variables are commonly used:

The following environment variables can be provided:

The following files can be added to a profile:

Pushing images to the cluster registry

  1. Add the cluster’s registry (e.g. docker-registry-default.apps.$WHAT.origin-gce.dev.openshift.com) to the local Docker daemon’s insecure registry list.

  2. Log in to the cluster’s registry using an SA from the namespace which should receive the image:

     oc sa get-token -n openshift builder | docker login -u builder --password-stdin docker-registry-default.apps.$WHAT.origin-gce.dev.openshift.com
    
  3. Tag an image pointing at the cluster registry in the desired namespace:

     docker tag github.com/openshift/origin:b42d282 docker-registry-default.apps.$WHAT.origin-gce.dev.openshift.com/openshift/origin:b42d282
    
  4. Push an image to the cluster registry:

     docker push docker-registry-default.apps.$WHAT.origin-gce.dev.openshift.com/openshift/origin:b42d282