owasp-workshop icon indicating copy to clipboard operation
owasp-workshop copied to clipboard

This requires a bit of a jump

Open davehodg opened this issue 6 years ago • 3 comments

"Create 3 hosts and call them node-master, node-1 and node-2."

Needs a bit of explanation!

If I do:

$ docker run --name node-master -i -t ubuntu /bin/bash

And then do your suggested apt stuff, the kubeadm apt isn't found.

$ docker run -i -t ubuntu:16.04 /bin/bash

It was a hell of a job getting kubadm installed. Your stanza didn't work needed to add "deb http://apt.kubernetes.io/ kubernetes-xenial main" manually.

kubeadm init needed --ignore-preflight-errors=all and even then, ended with a load of:

[WARNING ImagePull]: failed to pull image k8s.gcr.io/kube-apiserver:v1.12.2: output: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

, error: exit status 1

The docker daemon isn't running despite installing docker.

davehodg avatar Nov 19 '18 10:11 davehodg

for the part 1 of the lab, you can download a preconfigured machine from here

according to the error message, it seems like the docker service isn't running

inside the node-1 and node-2

for SERVICES in kube-proxy kubelet  docker; do
    systemctl restart $SERVICES
    systemctl enable $SERVICES
    systemctl status $SERVICES
done

to see if the docker daemon is already running systemctl status docker docker info

to restart the services in the node-master

for SERVICES in etcd kube-apiserver kube-controller-manager kube-scheduler flanneld; do
	systemctl restart $SERVICES
	systemctl enable $SERVICES
	systemctl status $SERVICES
done

and plz make sure the DNS service is already configured another tip: if you are running the cluster's machine has more than one NIC, then k8s will use the one which has the default route

kubeadm must be run from the node-master

etadata avatar Nov 19 '18 15:11 etadata

Why the nodes? GitHub says to do the kube stuff on the master.

Trying your image now. Oh, link didn't work.

davehodg avatar Nov 19 '18 16:11 davehodg

exactly, the kube staff should be on the master. and you have to administrate the nodes using kubectl from the master. i didn't upload a preconfigured VM. i used the GCP to create k8s cluster. if you would like to create k8s cluster by yourself try to download this ubuntu iso and follow the steps in the option.

I will be glad to help you create ur cluster

etadata avatar Nov 19 '18 16:11 etadata