Skip to content

shayneczyzewski/cluster-operator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cluster-operator

Development Setup

Initial Setup

  • Install required packages:
    • Fedora: dnf install golang make docker
  • Change docker to allow insecure pulls (required for oc cluster up):
    • Edit /etc/sysconfig/docker
    • Change OPTIONS= to include --insecure-registry 172.30.0.0/16
  • Enable and Start docker:
    • systemctl enable docker
    • systemctl start docker
  • Clone this repo to $HOME/go/src/github.com/openshift/cluster-operator
  • Get cfssl:
    • go get -u github.com/cloudflare/cfssl/cmd/...
  • Download a recent oc client binary from origin/releases (doesn't have to be 3.8):
  • Start an OpenShift cluster:
    • oc cluster up --image="docker.io/openshift/origin" --version "latest"
  • Login to the OpenShift cluster as admin:
    • oc login -u system:admin
  • Grant admin rights to login to the WebUI
    • oc adm policy add-cluster-role-to-user cluster-admin admin

Deploy / Re-deploy Cluster Operator

  • Compile the Go code and creates a docker image which is usable by the oc cluster.
    • make images
  • Before deploying, make sure the following files are available on your local machine:
    • $HOME/.aws/credentials - your AWS credentials
    • $HOME/.ssh/libra.pem - the SSH private key to use for AWS
  • Idempotently deploy cluster operator to the OpenShift cluster.
    • ansible-playbook contrib/ansible/deploy-devel.yaml
  • If your image changed, but the kubernetes config did not, it is often required to delete all pods:
    • oc delete pod --all -n openshift-cluster-operator

Creating a Sample Cluster

  • contrib/examples/create-cluster.sh

When using the create-cluster.sh script, provisioning on AWS is disabled by default. To enable it, you must either set the USE_REAL_AWS variable or specify a real openshift-ansible image to use in the ANSIBLE_IMAGE variable.

  • USE_REAL_AWS=1 contrib/examples/create-cluster.sh
  • ANSIBLE_IMAGE=openshift/origin-ansible:latest contrib/examples/create-cluster.sh

Developing With OpenShift Ansible

You can build your own custom version of [https://github.com/openshift/openshift-ansible](OpenShift Ansible) when working on playbooks and roles from the openshift-ansible repo:

docker build -f images/installer/Dockerfile -t dgoodwin-origin-ansible:latest .

You can then use this image with Cluster Operator via:

ANSIBLE_IMAGE="dgoodwin-origin-ansible:latest" ANSIBLE_IMAGE_PULL_POLICY="Never" contrib/examples/create-cluster.sh

You can run CO OpenShift Ansible playbooks standalone by creating an inventory like:

[OSEv3:children]
masters
nodes
etcd

[OSEv3:vars]
ansible_become=true
ansible_ssh_user=centos
openshift_deployment_type=origin
openshift_release="3.9"
oreg_url=openshift/origin-${component}:v3.9.0
openshift_aws_ami=ami-833d37f9

[masters]

[etcd]

[nodes]

You can then run ansible with the above inventory file and your cluster ID:

ansible-playbook -i ec2-hosts playbooks/cluster-operator/node-config-daemonset.yml -e openshift_aws_clusterid=dgoodwin-cluster

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 91.9%
  • Shell 7.3%
  • Makefile 0.8%