Skip to content
Snippets Groups Projects
Commit 9981ec4b authored by kaiyou's avatar kaiyou
Browse files

Improve the README and bootstrap documentation

parent fb9ddd12
No related branches found
No related tags found
No related merge requests found
Pipeline #31108 failed
......@@ -46,8 +46,8 @@ source docs/example.env
hepto \
# The node name, data will be stored in /var/lib/mycluster/mymaster
-name mymaster \
# The role, here a master only
-role full \
# The role, here a master
-role master \
# The host main network interface
-iface eth0
# Optional, IPv6 for the insance, will autoconfigure based on RA if unset
......@@ -100,19 +100,16 @@ bootstraping:
- `calico` as a CNI, in IPv6 `iptables` mode
- `coredns` as a cluster DNS
The repository comes with a bootstraping **Helm** chart in `helm/`, which takes cluster config
as parameters and installs these components. The `hepto -info` command outputs cluster
info as **Yaml**, compatible with the bootstraping chart.
The easiest way to bootstrap the cluster is to deploy it using Ansible, as described in the
following section. If you do however wish to bootstrap manually, you will find two kustomizations
in the `bootstrap` directory, from which you can infer how to deploy each component independently:
```sh
hepto -iface eth0 -name myfull -info > cluster-info.yaml
helm install hepto ./helm -f cluster-info.yaml
```
- first the `calico` kustomization is self-descriptive and deploys the Calico CNI and its CRDs,
- then the `networking` kustomization deploys networking components, including the Calico config
itself, kube-proxy and CoreDNS.
## Deploying a cluster on many nodes using **Ansible**
### Existing nodes
This repository provides an ansible role to deploy __Hepto__ on a node. Start with an
inventory file listing your nodes, and providing some variables, also add nodes to
the **master**, **anchor** and **public** groups.
......@@ -128,21 +125,8 @@ cd ansible && ansible-playbook -i inventories/inventory.yaml playbooks/deploy.ya
This will deploy **Hepto** on the given nodes and bootstrap the cluster using the
bootstrap helm chart.
### Cloud nodes
If you wish to use cloud provisioning to deploy the nodes in the first place
(currently supporting **Hetzner** only), a separate playbook provides automatic
deployment of your nodes.
See `ansible/inventories/sample-cloud.yaml` for an example inventory file.
Then run **Ansible**:
```sh
cd ansible && ansible-playbook -i inventories/inventory.yaml playbooks/cloud.yaml
```
This will create cloud nodes, setup **Hepto**, then bootstrap the cluster.
If you wish to populate Cloud nodes automatically, see `ansible/inventories/sample-cloud.yaml`
instead for an example inventory.
## Development
......@@ -170,19 +154,6 @@ source env
go build -tags "$TAGS" -ldflags "$LDFLAGS" ./cmd/hepto.go
```
For details about the architecture, see [design documentation](docs/design.md).
### Embedding **Flux**
Our current design decision is to setup **Flux** in the bootstrap **Helm** chart. Since
**Flux** does not provide an independent helm chart, we currently embed Flux manifests
directly.
Those are generated automatically from Flux CLI:
Or alternatively just run `make`.
```sh
flux install --export | yq ea '[.] | filter(.kind=="CustomResourceDefinition") | .[] | split_doc' > helm/crds/flux.yaml
flux install --namespace xxxxxx --export | yq ea '[.] | filter(.kind!="CustomResourceDefinition") | .[] | split_doc' | sed 's/xxxxxx/{{ .Values.flux.namespace }}/g' > helm/templates/flux.yaml
```
*[CNI]: Container Network Interface
For details about the architecture, see [design documentation](docs/design.md).
......@@ -63,14 +63,14 @@
file:
path: "/tmp/hepto/{{ item.path }}"
state: directory
with_community.general.filetree: "{{ playbook_dir }}/../../kustomizations"
with_community.general.filetree: "{{ playbook_dir }}/../../bootstrap"
when: item.state == 'directory'
- name: Copy the kustomization
template:
src: "{{ item.src }}"
dest: "/tmp/hepto/{{ item.path }}"
with_community.general.filetree: "{{ playbook_dir }}/../../kustomizations"
with_community.general.filetree: "{{ playbook_dir }}/../../bootstrap"
when: item.state == 'file'
- name: Deploy bootstrap kustomizations
......@@ -79,7 +79,7 @@
ansible.builtin.shell: "kubectl apply -k /tmp/hepto/{{ item }}; sleep 30"
loop:
- calico
- bootstrap
- networking
environment:
KUBECONFIG: "{{ kubeconfig }}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment