Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kubespray
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Kubespray
Commits
c63cda7c
Commit
c63cda7c
authored
8 years ago
by
Bogdan Dobrelya
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #883 from bogdando/docs
Docs updates
parents
1191876a
caab0cdf
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
docs/ansible.md
+26
-8
26 additions, 8 deletions
docs/ansible.md
docs/getting-started.md
+29
-3
29 additions, 3 deletions
docs/getting-started.md
inventory/inventory.example
+1
-1
1 addition, 1 deletion
inventory/inventory.example
with
56 additions
and
12 deletions
docs/ansible.md
+
26
−
8
View file @
c63cda7c
...
@@ -8,20 +8,39 @@ The inventory is composed of 3 groups:
...
@@ -8,20 +8,39 @@ The inventory is composed of 3 groups:
*
**kube-node**
: list of kubernetes nodes where the pods will run.
*
**kube-node**
: list of kubernetes nodes where the pods will run.
*
**kube-master**
: list of servers where kubernetes master components (apiserver, scheduler, controller) will run.
*
**kube-master**
: list of servers where kubernetes master components (apiserver, scheduler, controller) will run.
Note: if you want the server to act both as master and node the server must be defined on both groups _kube-master_ and _kube-node_
*
**etcd**
: list of server to compose the etcd server. you should have at least 3 servers for failover purposes.
*
**etcd**
: list of server to compose the etcd server. you should have at least 3 servers for failover purposes.
Note: do not modify the children of _k8s-cluster_, like putting
the _etcd_ group into the _k8s-cluster_, unless you are certain
to do that and you have it fully contained in the latter:
```
k8s-cluster ⊂ etcd => kube-node ∩ etcd = etcd
```
When _kube-node_ contains _etcd_, you define your etcd cluster to be as well schedulable for Kubernetes workloads.
If you want it a standalone, make sure those groups do not intersect.
If you want the server to act both as master and node, the server must be defined
on both groups _kube-master_ and _kube-node_. If you want a standalone and
unschedulable master, the server must be defined only in the _kube-master_ and
not _kube-node_.
There are also two special groups:
*
**calico-rr**
: explained for
[
advanced Calico networking cases
](
docs/calico.md
)
*
**bastion**
: configure a bastion host if your nodes are not directly reachable
Below is a complete inventory example:
Below is a complete inventory example:
```
```
## Configure 'ip' variable to bind kubernetes services on a
## Configure 'ip' variable to bind kubernetes services on a
## different ip than the default iface
## different ip than the default iface
node1 ansible_ssh_host=95.54.0.12
#
ip=10.3.0.1
node1 ansible_ssh_host=95.54.0.12 ip=10.3.0.1
node2 ansible_ssh_host=95.54.0.13
#
ip=10.3.0.2
node2 ansible_ssh_host=95.54.0.13 ip=10.3.0.2
node3 ansible_ssh_host=95.54.0.14
#
ip=10.3.0.3
node3 ansible_ssh_host=95.54.0.14 ip=10.3.0.3
node4 ansible_ssh_host=95.54.0.15
#
ip=10.3.0.4
node4 ansible_ssh_host=95.54.0.15 ip=10.3.0.4
node5 ansible_ssh_host=95.54.0.16
#
ip=10.3.0.5
node5 ansible_ssh_host=95.54.0.16 ip=10.3.0.5
node6 ansible_ssh_host=95.54.0.17
#
ip=10.3.0.6
node6 ansible_ssh_host=95.54.0.17 ip=10.3.0.6
[kube-master]
[kube-master]
node1
node1
...
@@ -42,7 +61,6 @@ node6
...
@@ -42,7 +61,6 @@ node6
[k8s-cluster:children]
[k8s-cluster:children]
kube-node
kube-node
kube-master
kube-master
etcd
```
```
Group vars and overriding variables precedence
Group vars and overriding variables precedence
...
...
This diff is collapsed.
Click to expand it.
docs/getting-started.md
+
29
−
3
View file @
c63cda7c
...
@@ -23,10 +23,36 @@ Building your own inventory
...
@@ -23,10 +23,36 @@ Building your own inventory
Ansible inventory can be stored in 3 formats: YAML, JSON, or inifile. There is
Ansible inventory can be stored in 3 formats: YAML, JSON, or inifile. There is
an example inventory located
an example inventory located
[
here
](
https://github.com/kubernetes-incubator/kargo/blob/master/inventory/inventory.example
)
.
[
here
](
https://github.com/kubernetes-incubator/kargo/blob/master/inventory/inventory.example
)
:
You can use an
```
cp -r inventory my_inventory
cp my_inventory/inventory.example my_inventory/inventory.cfg
# edit the inventory file as needed
```
Or you can use an
[
inventory generator
](
https://github.com/kubernetes-incubator/kargo/blob/master/contrib/inventory_builder/inventory.py
)
[
inventory generator
](
https://github.com/kubernetes-incubator/kargo/blob/master/contrib/inventory_builder/inventory.py
)
to create or modify an Ansible inventory. Currently, it is limited in
to create or modify an Ansible inventory. Currently, it is limited in
functionality and is only use for making a basic Kargo cluster, but it does
functionality and is only use for making a basic Kargo cluster, but it does
support creating large clusters.
support creating large clusters. For example:
```
cp -r inventory my_inventory
declare -a IPS=(10.10.1.3 10.10.1.4 10.10.1.5)
CONFIG_FILE=my_inventory/inventory.cfg python3 contrib/inventory_builder/inventory.py ${IPS}
```
Starting custom deployment
--------------------------
Once you have an inventory, you may want to customize deployment data vars
and start the deployment:
```
# Edit my_inventory/groups_vars/*.yaml to override data vars
ansible-playbook -i my_inventory/inventory.cfg cluster.yaml -b -v \
--private-key=~/.ssh/private_key
```
See more details in the
[
ansible guide
](
ansible.md
)
.
This diff is collapsed.
Click to expand it.
inventory/inventory.example
+
1
−
1
View file @
c63cda7c
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
# node5 ansible_ssh_host=95.54.0.16 # ip=10.3.0.5
# node5 ansible_ssh_host=95.54.0.16 # ip=10.3.0.5
# node6 ansible_ssh_host=95.54.0.17 # ip=10.3.0.6
# node6 ansible_ssh_host=95.54.0.17 # ip=10.3.0.6
# ## configure a bastion host if your nodes are not
public
ly reachable
# ## configure a bastion host if your nodes are not
direct
ly reachable
# bastion ansible_ssh_host=x.x.x.x
# bastion ansible_ssh_host=x.x.x.x
# [kube-master]
# [kube-master]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment