Skip to content

Latest commit

 

History

History
202 lines (168 loc) · 7.31 KB

README.adoc

File metadata and controls

202 lines (168 loc) · 7.31 KB

ocp-workshop standard config

Running Ansible Playbook

  • You can run the playbook with the following arguments to overwrite the default variable values:

    # Generic Vars
    ENVTYPE="ocp-workshop"
    GUID=ocpwtest1
    
    # Cloud Provider Settings
    KEYNAME=ocpkey
    REGION=ap-southeast-2
    CLOUDPROVIDER=ec2
    HOSTZONEID='Z3IHLWJZOU9SRT'
    BASESUFFIX='.example.opentlc.com'
    
    # OCP Vars
    NODE_COUNT=2
    REPO_VERSION=3.11
    OSRELEASE=3.11.16
    
    
    ansible-playbook ansible/main.yml \
      -e "guid=${GUID}" \
      -e "env_type=${ENVTYPE}" \
      -e "osrelease=${OSRELEASE}" \
      -e "repo_version=${REPO_VERSION}" \
      -e "cloud_provider=${CLOUDPROVIDER}" \
      -e "aws_region=${REGION}" \
      -e "HostedZoneId=${HOSTZONEID}" \
      -e "key_name=${KEYNAME}" \
      -e "subdomain_base_suffix=${BASESUFFIX}" \
      -e "node_instance_count=2" \
      -e "email=name@example.com" -e"output_dir=/opt/workdir" -e"output_dir=/opt/workdir" -e@../secret.yml -vv
Note
For 3.11 and above, you need to specify redhat_registry_user and redhat_registry_password it’s recommended to keep those in your "secret.yml" file

+

redhat_registry_user: "you_rhn_account@example.com"
redhat_registry_password: "password_to_your_rhn_accunt_or_token"
  • Additional Vars:

           -e "docker_version=1.13.1" \
           -e "bastion_instance_type=t2.large" -e "master_instance_type=c4.xlarge" \
           -e "infranode_instance_type=c4.4xlarge" -e "node_instance_type=c4.4xlarge" \
           -e "nfs_instance_type=m3.large" -e "node_instance_count=5" \
      -e "install_idm=htpasswd"

To Delete an environment

# Generic Vars
ENVTYPE="ocp-workshop"
GUID=ocpwtest1

# Cloud Provider Settings
REGION=ap-southeast-2
CLOUDPROVIDER=ec2
#To Destroy an Env
ansible-playbook  ./ansible/configs/${ENVTYPE}/destroy_env.yml -e "aws_region=${REGION}"   -e "guid=${GUID}" -e "env_type=${ENVTYPE}"  -e "cloud_provider=${CLOUDPROVIDER}"   -e@../secret.yml -vv

Advanced Development Workshop

REGION=us-east-1
KEYNAME=ocpkey
GUID=rdu
ENVTYPE="ocp-workshop"
CLOUDPROVIDER=ec2
HOSTZONEID='Z186MFNM7DX4NF'
REPO_PATH='https://admin.example.com/repos/ocp/3.5/'
DEPLOYER_REPO_PATH=/opt/ansible_agnostic_deployer/ansible
BASESUFFIX='.openshift.opentlc.com'
REPO_VERSION=3.5
ansible-playbook ${DEPLOYER_REPO_PATH}/main.yml \
  -e "guid=${GUID}" \
  -e "env_type=${ENVTYPE}" \
  -e "cloud_provider=${CLOUDPROVIDER}" -e "aws_region=${REGION}" \
  -e "HostedZoneId=${HOSTZONEID}" -e "key_name=${KEYNAME}" \
  -e "subdomain_base_suffix=${BASESUFFIX}" \
  -e "bastion_instance_type=t2.large" -e "master_instance_type=c4.xlarge" \
  -e "infranode_instance_type=c4.4xlarge" -e "node_instance_type=c4.4xlarge" \
  -e "nfs_instance_type=t2.large" -e "node_instance_count=${NODE_COUNT}" \
  -e "install_idm=htpasswd" -e "software_to_deploy=openshift" \
  -e "email=name@example.com" \
  -e "own_repo_path=${REPO_PATH}" -e"repo_method=rhn" -e"ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \
  -e "osrelease=3.5.5.31" -e "repo_version=${REPO_VERSION}" -e "docker_version=1.12.6" \
    --skip-tags=remove_self_provisioners,opentlc-integration

IPA registration

You can either provide ipa_host_password or a couple ipa_kerberos_user/ipa_kerberos_password to register the host to the ipa server. See roles/bastion-opentlc-ipa.

CNS/Glusterfs

If you set this variable, 3 support nodes will be deployed and used for glusterfs:

-e install_glusterfs=true
Note
This will discard NFS PVs for logging (elasticsearch) and metrics (cassandra). Instead storage for those pods will be 'EmptyDir'. Proper persistent storage setup is left to user as a post-install step.

Tested on OCP 3.7. See examples in tools/examples

Scale Up

Use the scaleup.yml playbook. Increase node_instance_count and new_node_instance_count accordingly. For example, if your previous node_instance_count was 2:

REGION=us-west-1
KEYNAME=ocpkey
GUID=na1
ENVTYPE="ocp-workshop"
CLOUDPROVIDER=ec2
HOSTZONEID='Z186MFNM7DX4NF'
REPO_PATH='https://admin.example.com/repos/ocp/3.5/'
MINOR_VERSION="3.5.5.15"
INSTALLIPA=false
BASESUFFIX='.openshift.opentlc.com'
REPO_VERSION=3.5
NODE_COUNT=4
NEW_NODE_COUNT=2
ansible-playbook ./configs/${ENVTYPE}/scaleup.yml \
                         -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \
                         -e "HostedZoneId=${HOSTZONEID}" \
                         -e "bastion_instance_type=t2.large" \
                         -e "cloud_provider=${CLOUDPROVIDER}" \
                         -e "guid=${GUID}" \
                         -e "infranode_instance_type=m4.4xlarge" \
                         -e "install_idm=htpasswd" \
                         -e user_password=PASSWORD \
                         -e admin_password=PASSWORD \
                         -e admin_user=admin \
                         -e "install_ipa_client=${INSTALLIPA}" \
                         -e "nfs_instance_type=m3.large" \
                         -e "osrelease=${MINOR_VERSION}" \
                         -e "own_repo_path=${REPO_PATH}" \
                         -e "email=name@example.com" \
                         -e "repo_method=file" \
                         -e "subdomain_base_suffix=${BASESUFFIX}" \
                         --skip-tags=remove_self_provisioners,install_zabbix \
                         -e "aws_region=${REGION}" \
                         -e "docker_version=1.12.6" \
                         -e "env_type=${ENVTYPE}" \
                         -e "key_name=${KEYNAME}" \
                         -e "master_instance_type=m4.xlarge" \
                         -e "node_instance_count=${NODE_COUNT}" \
                         -e "new_node_instance_count=${NEW_NODE_COUNT}" \
                         -e "node_instance_type=c4.4xlarge" \
                         -e "repo_version=${REPO_VERSION}"

Add new users on the bastion

For managing users on the bastion, you can override the mgr_users variable. The default is located in {{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/mgr_users.yml, and looks like :

Default mgr_users.yml
mgr_users:
  - name: opentlc-mgr
    home: /home/opentlc-mgr
    authorized_keys:
      - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC4OojwKH74UWVOY92y87Tb/b56CMJoWbz2gyEYsr3geOc2z/n1pXMwPfiC2KT7rALZFHofc+x6vfUi6px5uTm06jXa78S7UB3MX56U3RUd8XF3svkpDzql1gLRbPIgL1h0C7sWHfr0K2LG479i0nPt/X+tjfsAmT3nWj5PVMqSLFfKrOs6B7dzsqAcQPInYIM+Pqm/pXk+Tjc7cfExur2oMdzx1DnF9mJaj1XTnMsR81h5ciR2ogXUuns0r6+HmsHzdr1I1sDUtd/sEVu3STXUPR8oDbXBsb41O5ek6E9iacBJ327G3/1SWwuLoJsjZM0ize+iq3HpT1NqtOW6YBLR opentlc-mgr@inf00-mwl.opentlc.com

You can, for example, want to add another user. For that just override the variable in env_secret_vars.yml:

managing users ("Secret" Vars file or Env Vars file)
mgr_users:
  - name: opentlc-mgr
    home: /home/opentlc-mgr
    authorized_keys:
      - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC4OojwKH74UWVOY92y87Tb/b56CMJoWbz2gyEYsr3geOc2z/n1pXMwPfiC2KT7rALZFHofc+x6vfUi6px5uTm06jXa78S7UB3MX56U3RUd8XF3svkpDzql1gLRbPIgL1h0C7sWHfr0K2LG479i0nPt/X+tjfsAmT3nWj5PVMqSLFfKrOs6B7dzsqAcQPInYIM+Pqm/pXk+Tjc7cfExur2oMdzx1DnF9mJaj1XTnMsR81h5ciR2ogXUuns0r6+HmsHzdr1I1sDUtd/sEVu3STXUPR8oDbXBsb41O5ek6E9iacBJ327G3/1SWwuLoJsjZM0ize+iq3HpT1NqtOW6YBLR opentlc-mgr@inf00-mwl.opentlc.com
  - name: fridim
    home: /home/fridim
    authorized_keys:
      - https://github.com/fridim.keys