Giter VIP home page Giter VIP logo

k8s-om's Introduction

Overview

This project contains a few ansible playbooks for Kubernetes Operation and Maintenance (O&M). Currently it has following main functionalities:

  • Configure tenant for OCP
  • Configure python soft link for OCP
  • Install helm3 for OCP
  • Install additional command binaries for OCP

Welcome to raise your requirements by creating issues if you see some O&M related tasks are valuable to be implemented here.

Prerequisites

OCP cluster configurations

Configure OCP SSH key

Upload OCP cluster SSH private key to all master node(s), which is used to enable SSH without password from master node to other node(s) in same cluster. For detailed configuration steps, please refer to k8s-om/docs/configure_ssh_key.md. Skip this configuration if already done during OCP post configuration phase.

Jumper server configurations

Prepare jump server

Prepare a machine (Windows, Linux, whatever), which has network connectivity with the target infrastructure clusters you want to manage. How to set up this kind of machine is out of scope here.

Install ansible

For detailed installation steps, please refer to k8s-om/docs/install_ansible.md. Skip this installation if it already installed.

Configure k8s-om

Update host inventory info in k8s-om/hosts file, including cluster IP under [ocp] section and admin username/password under [ocp:vars] section.

Configurations

Cluster level configurations

Install additional common commands

Install sshpass/wget/unzip common commands for all node(s), which are convenient for daily work.

$ ansible-playbook -i hosts configure-cmd-binaries.yml

Check if following cmds are installed successfully on all node(s).

$ for cmd in {sshpass,wget,unzip};do whereis $cmd;done
sshpass: /var/usrlocal/bin/sshpass
wget: /var/usrlocal/bin/wget
unzip: /var/usrlocal/bin/unzip

Configure python command soft link

Configure python3 executable command soft link in /usr/local/bin directory of all node(s).

$ ansible-playbook -i hosts configure-python.yml

Check if python3 executable command soft link configured successfully of target node(s).

$ ls -la /usr/local/bin/python3
lrwxrwxrwx. 1 root root 31 Nov 30 10:53 /usr/local/bin/python3 -> /usr/libexec/platform-python3.6
$ python3 --version
Python 3.6.8

Tenant level configurations

Create tenant users

Configure tenant users to share same infrastructure platform and isolate resources from each other, including Linux user, SSH key, K8S namespace, K8S RBAC, kube config, helm config, etc.

E.g. create 6 tenants from index 1 (k8suser1) to 6 (k8suser6) with password systeM!23.

$ ansible-playbook -i hosts configure-tenant.yml -e '{first_user_index: 1, last_user_index: 6, configure_action: create}'

The main default configurations of tenant for test environments:

Configuration
Linux user
Linux user SSH key
Kube config
Helm config
K8S namespace
K8S RBAC

Delete tenant users

E.g. delete 6 tenants from index 1 (k8suser1) to 6 (k8suser6).

$ ansible-playbook -i hosts configure-tenant.yml -e '{first_user_index: 1, last_user_index: 6, configure_action: delete}'

Limitations

1. Two different types of tenants can't be created on same container infrastructure platform, which will result in configuration conflicts.
2. The type of created tenants can't be changed on the fly that means created tenants shall be deleted and recreated again with new tenant type.

k8s-om's People

Contributors

iyuenan3 avatar

Watchers

 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.