Giter VIP home page Giter VIP logo

ansible-role-k8sworker's Introduction

Ansible Role: K8s worker

Build Status

An Ansible Role that installs a Kubernetes worker node with kubeadm on Ubuntu.

Requirements

Requires Docker; recommended role for Docker installation: yanehi.docker.

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

k8s_major_version: 1
k8s_minor_version: 18
k8s_patch_version: 1
k8s_version: "{{ k8s_major_version }}.{{ k8s_minor_version }}.{{ k8s_patch_version }}"

Specify the k8s version you want to use. Set major, minor and patch of the k8s version.

k8s_repo: deb http://apt.kubernetes.io/ kubernetes-xenial main
debian: apt
k8s_apt_gpg_key_url: https://packages.cloud.google.com/{{ debian }}/doc/apt-key.gpg

Add the GPG key and repository for the kubeadm installation components.

join_token: vwz98a.hdnbzyrz1j55o7pe
discovery_token: ee5b14415d44accf054facafeebbfb7bb3e46a24671c23a7c6ec4a2c148fb296

Before rollout you need a working k8s-master node based on kubeadm installation. Add the join- kubeadm token list and discovery token ~/.discovery_token from your k8s-master node.

k8s_master_port: 6443
etcd_connection_port: 2379
etcd_raft_port: 2380
k8s_master_ip: 192.168.56.160
k8s_master_hostname: k8smaster
k8s_home: /root
k8s_user: root

Change the k8s-master ip for the etc/hosts entry and kubeadm join command.

k8s_components:
    - kubeadm={{ k8s_version }}-00
    - kubelet={{ k8s_version }}-00
    - kubectl={{ k8s_version }}-00

Installs the k8s components which will be needed on every node. The version you specified in default/main.yml.

Disable swap on host

- name: Disable swap
  shell: swapoff -a

- name: Disable swap permanently
  replace:
    path: /etc/fstab
    regexp: '^(\s*)([^#\n]+\s+)(\w+\s+)swap(\s+.*)$'
    replace: '#\1\2\3swap\4'
    backup: yes

Kubernetes nodes require to disable swap.

License

MIT

Author Information

This role was created in 2020 by Yannic Nevado.

ansible-role-k8sworker's People

Watchers

Clemens Bergmann avatar James Cloos 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.