Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
100 lines (66 sloc) 2.63 KB

[Brad Traversy] MERN Stack Front To Back: Full Stack React, Redux & Node.js [2019, ENG]

Run Application by Minikube (Kubernetes) (IN DEVELOPMENT)

$ minikube version
minikube version: v1.4.0

$ minikube start
$ minikube addons enable ingress

$ mkdir -p ~/projects/dev/js/nodejs/
$ cd ~/projects/dev/js/nodejs/
$ git clone https://github.com/marley-nodejs/MERN-Stack-Front-To-Back-v2.0
$ cd ~/projects/dev/js/nodejs/MERN-Stack-Front-To-Back-v2.0

$ kubectl create -f ./minikube

$ kubectl get pods
NAME                                 READY   STATUS    RESTARTS   AGE
api-deployment-55cbfdbb97-7wm76      1/1     Running   0          80s
client-deployment-7b896c75fc-8jssc   1/1     Running   0          80s
client-deployment-7b896c75fc-b6c5j   1/1     Running   0          80s
client-deployment-7b896c75fc-gn2vs   1/1     Running   0          80s

$ kubectl get services
NAME                        TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
api-cluster-ip-service      ClusterIP   10.105.35.214   <none>        5000/TCP   42m
client-cluster-ip-service   ClusterIP   10.96.208.184   <none>        3000/TCP   42m
kubernetes                  ClusterIP   10.96.0.1       <none>        443/TCP    91m

// Wainting for address assignment
$ kubectl get ingress
NAME              HOSTS         ADDRESS     PORTS   AGE
ingress-service   anketa.info   10.0.2.15   80      102s

$ kubectl describe svc client-cluster-ip-service
Name:              client-cluster-ip-service
Namespace:         default
Labels:            <none>
Annotations:       <none>
Selector:          component=web
Type:              ClusterIP
IP:                10.109.223.81
Port:              <unset>  3000/TCP
TargetPort:        80/TCP
Endpoints:         172.17.0.10:80,172.17.0.8:80,172.17.0.9:80
Session Affinity:  None
Events:            <none>

$ minikube ip
192.168.99.141

$ sudo vi /etc/hosts
192.168.99.141 anketa.info

http://anketa.info

Not works!!!


Debugging

$ kubectl get pods -n kube-system

$ kubectl describe pods -n kube-system nginx-ingress-controller-57bf9855c8-gnvmb

$ kubectl logs -n kube-system nginx-ingress-controller-57bf9855c8-gnvmb

$ kubectl exec -it -n kube-system nginx-ingress-controller-57bf9855c8-gnvmb cat /etc/nginx/nginx.conf

Marley

jsdev.org

Any questions on eng: https://t.me/jsdev_org
Любые вопросы на русском: https://t.me/jsdev_ru

You can’t perform that action at this time.