Hello everybody.
I have configured a development environment with Ubuntu 20.04 and Multipass doing the following, which by the way I copied from a K3s installation guide, since I am not an expert in kubernetes:
1.- sudo snap install multipass --classic --stable
2.- Then I installed kubctl on the host machine to be able to manage my multipass nodes from outside. (Host Machine)
3.- multipass launch --name k3s-master --mem 2G --disk 10G 20.04
4.- multipass launch --name k3s-agent --mem 2G --disk 10G 20.04
5.- multipass list
6.- multipass shell k3s-master
7.- curl -sfL https://get.k3s.io | sh -
8.- k3s -version
9.- sudo cat / var / lib / rancher / k3s / server / node-token
10.- And I get something like this, of course it always changes:
K103a5c4b22b4de5715dff39d58b1325c38e84217d40146c0f65249d439cab1a531 :: server: 271a74dadde37a98053a984a8dc676f8
11.- exit
12.- multipass shell k3s-agent
13.- curl -sfL https://get.k3s.io | K3S_URL = “https: // myipaddress: 6443” K3S_TOKEN = “K103a5c4b22b4de5715dff39d58b1325c38e84217d40146c0f65249d439cab1a531 :: server: 271a74dadde37a98053a984a8dc676” sh -
14.- k3s -version
15. exit
Checking my Cluster K3s:
1.- multipass shell k3s-master
2.- sudo kubectl get nodes -o wide
Show me everything OK.
3.- exit
Configure External kubectl (Host Machine)
1.- multipass shell k3s-master
2.- sudo kubectl config view
3.- It shows me something like this:
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: DATA + OMITTED
server: https://127.0.0.1:6443
name: default
contexts: - context:
cluster: default
user: default
name: default
current-context: default
kind: Config
preferences: {}
users: - name: default
user:
password: ea3527757-lex.europa.euc5c9ae8dbb00fef7595c
username: admin
4.- exit
Replace kubectl Configuration (Host Machine)
5.- nano ~ / .kube / config
The result will look like this, with lines 4 and 5 being modified:
apiVersion: v1
clusters: - cluster:
insecure-skip-tls-verify: true
server: https://192.168.64.7:6443
name: default
contexts: - context:
cluster: default
user: default
name: default
current-context: default
kind: Config
preferences: {}
users: - name: default
user:
password: ea3527757-lex.europa.euc5c9ae8dbb00fef7595c
username: admin
Now I check that everything is OK
kubectl get nodes
NAME STATUS ROLES AGE VERSION
k3s-master Ready master 66m v1.17.4 + k3s1
k3s-agent Ready 32m v1.17.4 + k3s1
Restart a K3S Cluster or shutdown and …
multipass start k3s-master
multipass start k3s-agent
Now my question is the following in order to install Dgraph for this development environment, what do I do? I run this command from my host machine and is it all?
2-Node Cluster
kubectl create -f https://raw.githubusercontent.com/dgraph-io/dgraph/master/contrib/config/kubernetes/dgraph-single/dgraph-single.yaml