Giter Club home page Giter Club logo

diplom_kubespray's Introduction

Установка Kubernetes с помощью kubespray

Подготовка

Склонировать себе репозиторий:
git clone https://github.com/kubernetes-sigs/kubespray

Установка зависимостей
sudo pip3 install -r requirements.txt

Копирование примера в папку со своей конфигурацией
cp -rfp inventory/sample inventory/mycluster

Конфигурация

Обновление Ansible inventory с помощью билдера
declare -a IPS=(158.160.33.134 158.160.22.243 51.250.36.172)
CONFIG_FILE=inventory/mycluster/hosts.yaml python3 contrib/inventory_builder/inventory.py ${IPS[@]}

10.10.1.3 10.10.1.4 10.10.1.5 - адреса серверов
Билдер подготовит файл inventory/mycluster/hosts.yaml. Там будут прописаны адреса серверов.

all:
  hosts:
    node-cp:
      ansible_host: 158.160.33.134
      ansible_user: centos
      #ip: 158.160.44.13
      #access_ip: 158.160.44.13
    node-work-1:
      ansible_host: 158.160.22.243
      ansible_user: centos
      #ip: 158.160.10.230
      #access_ip: 158.160.10.230
    node-work-2:
      ansible_host: 51.250.36.172
      ansible_user: centos
      #ip: 51.250.33.150
      #access_ip: 51.250.33.150
  children:
    kube_control_plane:
      hosts:
        node-cp:
    kube_node:
      hosts:
        node-cp:
        node-work-1:
        node-work-2:
    etcd:
      hosts:
        node-cp:
    k8s_cluster:
      children:
        kube_control_plane:
        kube_node:
    calico_rr:
      hosts: {}

Установка кластера

ansible-playbook -i inventory/mycluster/hosts.yaml cluster.yml -b -v

Проверка установки

kubectl version
kubectl get nodes

Доступ к кластеру

Для доступа к кластеру извне нужно добавить параметр supplementary_addresses_in_ssl_keys: [158.160.33.134] в файл inventory/mycluster/group_vars/k8s_cluster/k8s-cluster.yml Заново запустить установку кластера. После этого кластер будет доступен извне.

diplom_kubespray's People

Contributors

aierohin 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.