devops
devops
It allows you to
automate the deployment of applications in lightweight and portable containers.
What command should you run to see all running container in Docker?
$ docker ps
Write a Docker file to create and copy a directory and built it using python
modules?
FROM pyhton:2.7-slim
WORKDIR /app
COPY . /app
-------------------------
Rolling updates allow Deployments' update to take place with zero downtime by
incrementally updating Pods instances with new ones
Blue/Green deployments are a form of progressive delivery where a new version of
the application is deployed while the old version still exists. The two versions
coexist for a brief period of time while user traffic is routed to the new version,
before the old version is discarded (if all goes well)
expose to outside world by change service
can test by pinging internal ip or log in to the pod and curl localhost
can test by smoke test
canary deployment gradually shift to new version( instead use service mesh like
istio)
NodePort: Exposes the Service on the same port of each selected Node in the cluster
using NAT. Makes a Service accessible from outside the cluster using
<NodeIP>:<NodePort>. Superset of ClusterIP.
You can only use ports 30000–32767
If your Node/VM IP address change, its a drawbak
Loadbalancer: Creates an external load balancer in the current cloud (if supported)
and assigns a fixed, external IP to the Service. Superset of NodePort.
What is __init__?
Ans: __init__ is a method or constructor in Python. This method is automatically
called to allocate memory when a new object/ instance of a class is created. All
classes have the __init__ method.
Continue Allows skipping some part of a loop when some specific condition is met
and the control is transferred to the beginning of the loop
Pass Used when you need some block of code syntactically, but you want to skip its
execution. This is basically a null operation. Nothing happens when this is
executed.