101 Aca

1 minute read

Docker / Container

a container is your program and all its dependencies packaged together a container image is a file that contains all the dependencies and configuration required to run a program a container engine is a program that runs containers

docker is a container engine docker image is a container image dockerfile is a file that contains instructions to build a docker image

FROM node:16-alpine3.14 WORKDIR /web COPY ./index.js ./index.js

ENTRYPOINT [“node”, “./index.js”]

docker build -f app.dockerfile . -t node-echo docker images docker run -t -i -p 5001:5001 node-echo

Kubernetes

Kubernetes is a container orchestration system that manages containers at scale

workload is an application (usually a web service) running in Kubernetes Pod is a group of one or more containers that share storage and network resources

An application running on an operating system is called a process. When you run that program in a Docker environment, it becomes a container; When you run your container directly in Kubernetes, it becomes a Pod. Node is a physical or virtual machine running Kubernetes, onto which Pods can be scheduled Cluster is a set of nodes grouped together. Each cluster has a single control plane A Kubernetes service defines networking between pods and how pod networks are exposed to the internet

kubectl cluster-info kubectl apply -f node-echo-deployment.yaml kubectl get deployments kubectl apply -f node-echo-service.yaml