Code Monkey home page Code Monkey logo

ocp4-ansible-vmware-upi's Introduction

Playbooks to configure OpenShift 4.x cluster

Couple of ansible roles to configure serveral components for a fresh install of an openshift cluster.

Important
None of these role are written to be used blindly. They are provided as a POC/minimum viable option to get you kickstarted without having to put a ton of effort to figure out exactly what all needs to be done.

A lot of assumptions are made. So please walk through the roles first, before attempting to run them.

Setting up your environment to run the playbooks

REQUIREMENTS:

 - python3
 - python modules for ansible: openshift kubernetes
 - access to the openshift API with a cluster-admin account
Note
if access to download python pip packages is blocked uncompress file k8s-ocp-deps.tar.gz in the home dir of the user running these plays
tar xzvf k8s-ocp-deps.tar.gz ~/

RHEL7

Assuming that you are running as a non root user. Adjust accordingly

sudo yum install ansible
sudo yum install python3.x86_64 python3-pip.noarch libselinux-python3.x86_64
pip3 install --user openshift kubernetes

Runing the individual roles

You can run individual roles by runnning ansible playbook against the roles/<role-name>/apply/main.yaml playbook in each of the individual roles.

ansible-playbook roles/<role-name>/apply/main.yaml

Install roles

  1. Prepare the bastion node (ocp4 clients, httpd)

ansible-playbook roles/prepare-bastion/apply/main.yaml
  1. Prepare install-config, and manifests, ignition files

ansible-playbook roles/prepare-install/apply/main.yaml --vault-password-file .vault_secret

Below are the list of ansible roles that are available. Do checkout the individual role’s documenation for more information on what they do.

List of Day2 Roles

roles/
├── api-tls-cert
├── cluster-monitoring
├── cluster-logging
├── etcd-backup
├── image-registry
├── ingress-tls-cert
├── ldap-group-sync
├── ldap-oauth
├── project-template
├── self-provisioner
└── setup-infra
  1. Authenticate with oc client to cluster API This ansible role requires that you are have an authenticated kubectl/oc session which has sufficient previlegges to create namespaces, and install operators.

oc login -u <cluster-admin-user> https://api.yourdomain.com
Warning
Make sure you are in the ansible directory of this repo before you these playbooks
git clone https://THIS_REPO
cd THIS_REPO
  1. Convert worker nodes to infra

ansible-playbook roles/setup-infra/apply/main.yaml
  1. Update infra TLS certificate and Key and move pods to infra nodes

ansible-playbook roles/ingress-tls-cert/apply/main.yaml --vault-password-file .vault_secret
  1. Apply default project request template

ansible-playbook roles/project-template/apply/main.yaml
  1. Activate, Update Image Registry and move pods to infra nodes

ansible-playbook roles/image-registry/apply/main.yaml
  1. Move cluster monitoring resources to infra nodes

ansible-playbook roles/cluster-monitoring/apply/main.yaml
  1. Setup EFK stack

ansible-playbook roles/cluster-logging/apply/main.yaml
  1. Integrate LDAP authentication

ansible-playbook roles/ldap-oauth/apply/main.yaml --vault-password-file .vault_secret
  1. Integrate LDAP group synchronization

ansible-playbook roles/ldap-group-sync/apply/main.yaml --vault-password-file .vault_secret
  1. Remove Self Provisioners Rolebinding

ansible-playbook roles/self-provisioner/apply/main.yaml
  1. Update API TLS certificate and enable etcd encryption

ansible-playbook roles/api-tls-cert/apply/main.yaml --vault-password-file .vault_secret
  1. Assign cluster roles to ldap groups and remove kubeadmin

ansible-playbook roles/cluster-roles/apply/main.yaml
  1. Setup ETCD backups

ansible-playbook setup-etcd-backup.yaml
Note
if you want to perform an etcd backup run: ansible-playbook roles/etcd-backups/apply/main.yaml

Run All base roles!

ansible-playbook day2-common.yaml --vault-password-file .vault_secret
ansible-playbook setup-etcd-backup.yaml

Override variables for a role or run all

ansible-playbook roles/ROLE_NAME/apply/main.yaml
or
ansible-playbook day2-common.yaml --vault-password-file .vault_secret
Important
After running the playbook 12 (cluster-roles), you need to login with your LDAP creds perform the following steps to clean old references to kubeadmin and old api certs
rm -rf ~/.kube
unset KUBECONFIG
oc login https://api.REPLACE-ENV.example.com:6443 -u YOUR_USER

ocp4-ansible-vmware-upi's People

Contributors

manurodriguez avatar

Stargazers

Tatiana Krishtop avatar

Watchers

James Cloos avatar  avatar Tatiana Krishtop avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.