Hasan's Post

Tutorial repository

View on GitHub
21 August 2022

Scaling and Updating Applications

by Hasan

Theory

Objectives

Scaling an application using ReplicaSet

Preparation work

Build and push image to ibmcloud container registry

Deploy the application to Kubernetes

apiVersion: apps/v1
kind: Deployment
metadata:
  name: hello-world
spec:
  selector:
    matchLabels:
      run: hello-world
  template:
    metadata:
      labels:
        run: hello-world
    spec:
      containers:
      - name: hello-world
        image: us.icr.io/sn-labs-hasanme1412/hello-world:1
        ports:
        - containerPort: 8080
        resources:
          limits:
            cpu: 2m
            memory: 30Mi
          requests:
            cpu: 1m
            memory: 10Mi  
        
      imagePullSecrets:
        - name: icr
kubectl apply -f deployment.yaml

Scaling an application

Scale down an app

Rolling Updates

Config Maps to stor Configuration

tags: