• / company
    • about us
      • / about us

        The partner of choice for data & product engineering to drive business growth & deliver an impact within your organization
    • product engineering
      • / product engineering
        We specialize in Software Product Engineering, transforming your concepts into impactful products.
    • technology
      • / technology
        250+ specialists skilled in software, BI, integration, offering end-to-end services from research to ongoing maintenance.
    • methodology
      • / methodology
        We specialize in software product engineering, transforming your concepts into impactful products.
    • careers
      • / careers
        Our team needs one more awesome person, like you. Let’s grow together! Why not give it a try?
    • do good
      • / do good
        We’re a team devoted to making the world better with small acts. We get involved and always stand for kindness.
    • events
      • / events
        LLMs in Action: Transforming How We Work, Communicate, and Innovate
    • blog
      • / blog
        Why Every Developer Should Care About AI Plugins, And What You Might Be Missing
        mindit chats with Andreea Moldovan: “At mindit.io people really put effort into making it happen.”
    • contact us
      • / contact us
        We would love to hear from you! We have offices and teams in Romania and Switzerland. How can we make your business thrive?
  • / get in touch

Kubernetes 101 – Deployments

Intro

While you can’t rely on any single pod to stay running indefinitely, you can rely on the fact that the cluster will always try to have the number of pods you wanted available.

A Deployment object contains a collection of pods defined by a template and a replica count (how many copies of the template we want to run).

apiVersion: apps/v1

kind: Deployment

metadata:

name: nginx-deployment

labels:

app: nginx // label matching the one in the selector

spec:

replicas: 3 // number of pods to be running at anytime

selector:

matchLabels:

app: nginx // which pods belong to this deployment

template:

metadata:

labels: app: nginx

spec: // pod template

containers:

– name: nginx-container

image: nginx:1.14.2

ports:

– containerPort: 80

If a pod stops from any given reason, the deployment controller (take a look on the Kubernetes – Cluster internals post) will work in conjunction with the scheduler to start a new pod based on the template defined in the deployment.

Even more, let’s say we have a Deployment with a replica count of 10 and a node crashes where we had 3 pods running.

3 more pods will be scheduled to run on a different running machine in the cluster.

For this reason, Deployments are best suited for stateless applications where Pods are able to be replaced at any time without breaking stuff and 0 downtime.

Running it is as easy as:

>> kubectl apply -f nginx-deployment.yaml
Follow the Kubernetes 101 series on mindit.io.

Check out new-spike.net for other articles on Kubernetes and much more!

Distribute:

/turn your vision into reality

The best way to start a long-term collaboration is with a Pilot project. Let’s talk.