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 ...@@ -46,8 +46,8 @@ source docs/example.env
hepto \ hepto \
# The node name, data will be stored in /var/lib/mycluster/mymaster # The node name, data will be stored in /var/lib/mycluster/mymaster
-name mymaster \ -name mymaster \
# The role, here a master only # The role, here a master
-role full \ -role master \
# The host main network interface # The host main network interface
-iface eth0 -iface eth0
# Optional, IPv6 for the insance, will autoconfigure based on RA if unset # Optional, IPv6 for the insance, will autoconfigure based on RA if unset
...@@ -100,19 +100,16 @@ bootstraping: ...@@ -100,19 +100,16 @@ bootstraping:
- `calico` as a CNI, in IPv6 `iptables` mode - `calico` as a CNI, in IPv6 `iptables` mode
- `coredns` as a cluster DNS - `coredns` as a cluster DNS
The repository comes with a bootstraping **Helm** chart in `helm/`, which takes cluster config The easiest way to bootstrap the cluster is to deploy it using Ansible, as described in the
as parameters and installs these components. The `hepto -info` command outputs cluster following section. If you do however wish to bootstrap manually, you will find two kustomizations
info as **Yaml**, compatible with the bootstraping chart. in the `bootstrap` directory, from which you can infer how to deploy each component independently:
```sh - first the `calico` kustomization is self-descriptive and deploys the Calico CNI and its CRDs,
hepto -iface eth0 -name myfull -info > cluster-info.yaml - then the `networking` kustomization deploys networking components, including the Calico config
helm install hepto ./helm -f cluster-info.yaml itself, kube-proxy and CoreDNS.
```
## Deploying a cluster on many nodes using **Ansible** ## 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 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 inventory file listing your nodes, and providing some variables, also add nodes to
the **master**, **anchor** and **public** groups. the **master**, **anchor** and **public** groups.
...@@ -128,21 +125,8 @@ cd ansible && ansible-playbook -i inventories/inventory.yaml playbooks/deploy.ya ...@@ -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 This will deploy **Hepto** on the given nodes and bootstrap the cluster using the
bootstrap helm chart. bootstrap helm chart.
### Cloud nodes If you wish to populate Cloud nodes automatically, see `ansible/inventories/sample-cloud.yaml`
instead for an example inventory.
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.
## Development ## Development
...@@ -170,19 +154,6 @@ source env ...@@ -170,19 +154,6 @@ source env
go build -tags "$TAGS" -ldflags "$LDFLAGS" ./cmd/hepto.go go build -tags "$TAGS" -ldflags "$LDFLAGS" ./cmd/hepto.go
``` ```
For details about the architecture, see [design documentation](docs/design.md). Or alternatively just run `make`.
### 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:
```sh For details about the architecture, see [design documentation](docs/design.md).
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
...@@ -63,14 +63,14 @@ ...@@ -63,14 +63,14 @@
file: file:
path: "/tmp/hepto/{{ item.path }}" path: "/tmp/hepto/{{ item.path }}"
state: directory state: directory
with_community.general.filetree: "{{ playbook_dir }}/../../kustomizations" with_community.general.filetree: "{{ playbook_dir }}/../../bootstrap"
when: item.state == 'directory' when: item.state == 'directory'
- name: Copy the kustomization - name: Copy the kustomization
template: template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "/tmp/hepto/{{ item.path }}" dest: "/tmp/hepto/{{ item.path }}"
with_community.general.filetree: "{{ playbook_dir }}/../../kustomizations" with_community.general.filetree: "{{ playbook_dir }}/../../bootstrap"
when: item.state == 'file' when: item.state == 'file'
- name: Deploy bootstrap kustomizations - name: Deploy bootstrap kustomizations
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
ansible.builtin.shell: "kubectl apply -k /tmp/hepto/{{ item }}; sleep 30" ansible.builtin.shell: "kubectl apply -k /tmp/hepto/{{ item }}; sleep 30"
loop: loop:
- calico - calico
- bootstrap - networking
environment: environment:
KUBECONFIG: "{{ kubeconfig }}" 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