Skip to content
This repository has been archived by the owner on Mar 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #100 from lander2k2/swizzle_readme
Browse files Browse the repository at this point in the history
Add instructions to help getting started
  • Loading branch information
alexbrand authored Nov 7, 2018
2 parents 751a957 + a5443e8 commit 4d96817
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 3 deletions.
29 changes: 26 additions & 3 deletions swizzle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,31 @@ $ python provision.py
```

Ansible:
```
$ ansible-playbook -i $inventory swizzle.yml <extra ansible args>
```

Assumes you have machines up and ready to use for your cluster. They need to be either Debian or Red Hat derivatives. Nothing need be installed besides the base OS.

1. Create an inventory file and edit it to reflect your infrastructure.

```
$ cp inventory.ini.example inventory.ini
```
2. Create an extra vars file and edit to contain the values that will work for your cluster and infrastructure. The values contained in the example are the default values so you can delete those you don't wish to change or that don't apply to your installation.
```
$ cp extra_vars.yaml.example extra_vars.yaml
```
3. Tell ansible where to find the roles.
```
$ export ANSIBLE_ROLES_PATH=../ansible/roles
```
4. Run the playbook.
```
$ ansible-playbook -i inventory.ini swizzle.yml --extra-vars "@extra_vars.yaml"
```
This playbook make use of the baseline config management provided by the various wardoom roles. We do not use the native Vagrant ansible support (ie. `vagrant provision`) as it does not execute playbooks across all virtual machines simultaneously; only serially.
46 changes: 46 additions & 0 deletions swizzle/extra_vars.yaml.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
docker_debian_version: 17.03.2~ce-0~ubuntu-xenial
docker_redhat_version: 17.03.2.ce
docker_logging_max_size: 100m

etcd_cluster_token: 444fddcc-beae-45bc-9da6-d941d446b595
etcd_interface: enp0s8
etcd_version: v3.2.10

kubernetes_cni:
plugin: calico
calico:
manifest_url: "https://docs.projectcalico.org/v2.6/getting-started/kubernetes/installation/hosted/kubeadm/1.6/calico.yaml"
calicoctl_url: "https://github.com/projectcalico/calicoctl/releases/download/v1.6.1/calicoctl"
flannel:
manifest_url: "https://raw.githubusercontent.com/coreos/flannel/v0.10.0/Documentation/kube-flannel.yml"

kubernetes_common_api_fqdn: k8s.example.com
kubernetes_common_api_ip: 10.10.10.3
kubernetes_common_primary_interface: enp0s8

# kubelet_extra_args is a dict of arg:value (ie. 'node-ip: 1.1.1.1' for '--node-ip=1.1.1.1')
kubernetes_common_kubelet_extra_args: {}

kubernetes_master:
kubeadm_config:
kubernetesVersion: 1.9.5
api:
advertiseAddress: "{{ kubernetes_common_api_ip }}"
apiServerExtraArgs:
"endpoint-reconciler-type": "lease"
apiServerCertSANs:
- "{{ kubernetes_common_api_fqdn }}"
- "{{ kubernetes_common_api_ip }}"
etcd:
endpoints: "{{ etcd_client_endpoints }}"
token: "{{ generated_token.stdout }}"

kubernetes_version: "{{ kubernetes.version if kubernetes_version_defined else '1.9.3-00' }}"
kubernetes_cni_version: "{{ kubernetes.cni_version if kubernetes_cni_version_defined else '0.6.0-00' }}"
kubernetes_enable_cached_images: "{{ kubernetes.enable_cached_images if kubernetes_enable_cached_images_defined else False }}"
kubernetes_cached_images: "{{ kubernetes.cached_images if kubernetes_cached_images_defined else [] }}"
kubernetes_apt_key_url: "{{ kubernetes.apt_key_url if kubernetes_apt_key_url_defined else 'https://packages.cloud.google.com/apt/doc/apt-key.gpg' }}"
kubernetes_apt_repo_string: "{{ kubernetes.apt_repo_string if kubernetes_apt_repo_string_defined else 'deb http://apt.kubernetes.io/ kubernetes-' ~ ansible_distribution_release | lower ~ ' main' }}"
kubernetes_yum_baseurl: "{{ kubernetes.yum_baseurl if kubernetes_yum_baseurl_defined else 'https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64' }}"
kubernetes_yum_gpgkey: "{{ kubernetes.yum_gpgkey if kubernetes_yum_gpgkey_defined else 'https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg' }}"

23 changes: 23 additions & 0 deletions swizzle/inventory.ini.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
machine-0 ansible_host=[server IP] ansible_user=[user] ansible_ssh_private_key_file=[path to ssh key]
machine-1 ansible_host=[server IP] ansible_user=[user] ansible_ssh_private_key_file=[path to ssh key]
machine-2 ansible_host=[server IP] ansible_user=[user] ansible_ssh_private_key_file=[path to ssh key]
machine-3 ansible_host=[server IP] ansible_user=[user] ansible_ssh_private_key_file=[path to ssh key]
machine-4 ansible_host=[server IP] ansible_user=[user] ansible_ssh_private_key_file=[path to ssh key]

[etcd]
machine-0
machine-1
machine-2

[primary_master]
machine-0

[masters]
machine-0
machine-1
machine-2

[nodes]
machine-3
machine-4

0 comments on commit 4d96817

Please sign in to comment.