Skip to content

Instantly share code, notes, and snippets.

View michalpenka's full-sized avatar

Michal Pěnka michalpenka

View GitHub Profile
apiVersion: v1
kind: Service
metadata:
name: svc-helloworld
namespace: helloworld
spec:
ports:
- port: 80
selector:
app: app-helloworld
kubectl -n helloworld get deployments
apiVersion: apps/v1
kind: Deployment
metadata:
name: app-helloworld
namespace: helloworld
spec:
replicas: 2
selector:
matchLabels:
app: app-helloworld
kubectl get namespaces
kubectl apply -f namespace.yml
apiVersion: v1
kind: Namespace
metadata:
name: helloworld
mkdir -p ~/config/flannel
cd ~/config/flannel/
wget https://raw.githubusercontent.com/coreos/flannel/v0.12.0/Documentation/kube-flannel.yml
kubectl apply -f kube-flannel.yml
kubeadm token create --print-join-command
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
kubectl get node
sudo kubeadm init --pod-network-cidr=10.244.0.0/16