GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - apachecloudstack/k8s: An Ansible playbook to provision Kubernetes clusters on CloudStack

BranchesTags
Open more actions menu

Latest commit

 

History

6 Commits
6 Commits

Folders and files

NameName
Last commit message
Last commit date
roles
roles
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
ansible.cfg
ansible.cfg
 
 
etcd.yml
etcd.yml
 
 
inventory
inventory
 
 
k8s.yml
k8s.yml
 
 

Repository files navigation

Ansible Recipes to Install Kubernetes on CloudStack

Basic recipes using the ansible cloudstack module to create ssh keys, sec group etc and deploy Kubernetes on CoreOS.

Prerequisites

You will need Ansible and cs :)

$ sudo apt-get install -y python-pip libssl-dev
$ sudo pip install cs
$ sudo pip install sshpubkeys
$ sudo apt-get install software-properties-common
$ sudo apt-add-repository ppa:ansible/ansible
$ sudo apt-get update
$ sudo apt-get install ansible

Setup cs

Create a ~/.cloudstack.ini file with your creds and cloudstack endpoint:

[cloudstack]
endpoint = <cloudstackapiendpoint>
key = <apiaccesskey> 
secret = <apisecretkey> 
method = post

We need to use the http POST method to pass the userdata to the coreOS instances.

We can also use variables:

CLOUDSTACK_ENDPOINT=<cloudstackapiendpoint>
CLOUDSTACK_KEY=<apiaccesskey>
CLOUDSTACK_SECRET=<apisecretkey>
CLOUDSTACK_METHOD=post

On CloudStack server you have to install libselinux-python

yum install libselinux-python

Clone the repository

$ git clone https://github.com/apachecloudstack/k8s
$ cd ansible-kubernetes

Create a Kubernetes cluster

$ ansible-playbook k8s.yml

Some variables can be edited in the k8s.yml file. This will start a Kubernetes master node and a number of compute nodes. This is all setup via coreOS instances and passing userdata.

Check the tasks and templates in roles/k8s

If you retrieve an error during the ssh key copy:

"msg": "file (/root/.ssh/id_rsa_k8s) is absent, cannot continue",

Please run the Playbook a second time (related issue)

Create etcd cluster

That's a bonus to this work, there is a playbook to create an independent etcd cluster.

$ ansible-playbook etcd.yml

Edit some of the variables in the etcd.yml file directly.

Important Notice

If you want to run it on a CloudStack environment with VMware ESX hosts cluster. You have to comment the lines refer to secgroups and secgroup_rules (specific to KVM) : k8s.yml k8s/tasks/main.yml k8s/tasks/create_vm.yml etcd.yml etcd/tasks/main.yml

About

An Ansible playbook to provision Kubernetes clusters on CloudStack

Resources

Readme
Apache-2.0 license
Activity
Custom properties

Stars

18 stars

Watchers

6 watching

Forks

9 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.