Commands Till Service
Commands Till Service
$ bash
$ sudo su
$ sudo reboot -f
After reboot connect with the server again and run the following commands on Master server:
$ sudo su
$ apt-get update
EOF
# apt-get update
$ bash
$ sudo su
$ sudo reboot -f
After reboot connect with the server again and run the following commands on Slave server:
$ sudo su
$ apt-get update
EOF
$ apt-get update
$ mkdir -p $HOME/.kube
$ curl https://raw.githubusercontent.com/projectcalico/calico/v3.26.1/manifests/calico.yaml -O
$ kubectl apply -f calico.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
spec:
strategy:
type: Recreate
selector:
matchLabels:
app: nginx
replicas: 3
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
apiVersion: v1
kind: Service
metadata:
name: nginx
namespace: default
labels:
app: nginx
spec:
externalTrafficPolicy: Local
ports:
- name: http
port: 80
protocol: TCP
targetPort: 80
selector:
app: nginx
type: NodePort
$ kubectl create -f service.yml
In the above screenshot, it can be seen that the Service is available on Port 30950. This can
be different for you as the port is randomly assigned from the available range.
Now go on the browser and put public ip address of your master or slave whatever you want and
using colon put port number . for ex : Ipslave:30950