canonical / canonical/data-science-stack

Implement prepare-host-env CLI command

Open
#11 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
37
Forks
10
PR merge metrics
No merged PRs in 30d

Description

### Why it needs to get done

DSS should be able to output bash script to deploy microk8s on the host machine. We cannot setup microk8s inside the snap because of snap isolation.

### What needs to get done

Implement a CLI command `dss prepare-host-env` which outputs bash script to deploy microk8s on the host machine. This commands also sets the desired addons. Example script from Demo:

```
#!/bin/bash
sudo snap install microk8s --classic --channel=1.28/stable

sudo usermod -a -G microk8s ubuntu
sudo mkdir /home/ubuntu/.kube
sudo chown -f -R ubuntu /home/ubuntu/.kube

sudo microk8s enable dns storage metallb:"10.64.140.43-10.64.140.49,192.168.0.105-192.168.0.111"
sleep 30
sudo microk8s.kubectl wait --for=condition=available -nkube-system deployment/coredns deployment/hostpath-provisioner
sudo microk8s.kubectl -n kube-system rollout status ds/calico-node
snap connect microk8s $dss
```

You can also try to use [MIcrok8s content feature](https://github.com/canonical/microk8s-content-demo-snap/tree/main) to specify the microk8s setup with addons in the yaml file.

### When is the task considered done

- DSS CLI has command option `dss prepare-host-env` which outputs bash script to install microk8s version 1.28 (we will always provide same version).
- The script will also setup addons `dns storage metallb:"10.64.140.43-10.64.140.49,192.168.0.105-192.168.0.111"`
- After execution of the script on the host machine (e.g. piping to bash) the microk8s is available

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.