Posts

Showing posts from 2023

Kubernetes for Micro Services

Image
(Special thanks to Stephen Grider) Cluster - Whole wrapper Node - A virtual machine Pod - Container wrapper. There can be multiple containers inside a Pod Deployment - Monitor set of Pods. If something down, then this will restart them to make sure it is running Service - Provide nice URLs for containers How to create a Pod directly? Create Pod using configuration file - kubectl apply -f posts.yml  Note: This apply use for any type of cluster change Example of posts.yml apiVersion : v1 kind : Pod metadata : name : posts spec : containers : - name : post image : dilumdarshana/posts:0.0.1 Get all pods running - kubectl get pods Delete Pods -  kubectl delete -f posts.yml General important Pod commands: kubectl exec -it <pod name> <command> kubectl logs <pod name> kubectl delete pod <pod name> kubectl describe pod <pod name> How to create Pods via deployment ? kubectl apply -f <deployement.yml> Example of deployment.yml apiVersion : apps/v1

Node-RED

Image
 Node-RED server can be spine using docker as bellow, - docker run --rm --net tulip-net -it -p 1880:1880 -v myNodeREDdata:/data   --name mynodered nodered/node-red It is important that run on specific network, if you have several docker containers running. Eg. MQTT or Mongo... How to run a MQTT broker, - docker run --rm --net tulip-net -p 8080:8080 -p 1883:1883 --name hivemq hivemq/hivemq4 How to run a Mongodb, docker run --rm --net tulip-net -d -p 27018:27017 --name nodered_mongo -e MONGO_INITDB_ROOT_USERNAME=admin -e MONGO_INITDB_ROOT_PASSWORD=admin mongo Node-RED can be installed new extensions as necessary. Use `Mange Pelette` link for that, dsfasdf