Kubernetes logo on an open laptop screen

Creating Kubernetes pods, ReplicaSets, and deployments

Matthew Casperson

This post is the 4th in our Kubernetes training series, providing DevOps engineers with an introduction to Docker, Kubernetes, and Octopus.

This video demonstrates Kubernetes pods, ReplicaSets, and deployments, deploying examples of each.

If you don't already have Octopus account, you can start a free trial.

You can work through the series using the links below.

Resources

Sample Pod YAML

apiVersion: v1
kind: Pod
metadata:
  name: underwater
spec:
  containers:
  - name: webapp
    image: octopussamples/underwater-app
    ports:
    - containerPort: 80

Sample ReplicaSet YAML

apiVersion: apps/v1
kind: ReplicaSet
metadata:
  name: webapp
spec:
  replicas: 3
  selector:
    matchLabels:
      tier: webapp
  template:
    metadata:
      labels:
        tier: webapp
    spec:
      containers:
      - name: webapp
        image: octopussamples/underwater-app
        ports:
        - containerPort: 80

Sample Deployment YAML

apiVersion: apps/v1
kind: Deployment
metadata:
  name: webapp
spec:
  replicas: 3
  selector:
    matchLabels:
      tier: webapp
  template:
    metadata:
      labels:
        tier: webapp
    spec:
      containers:
      - name: webapp
        image: octopussamples/underwater-app
        ports:
        - containerPort: 80

Learn more

If you're looking to build and deploy containerized applications to AWS platforms such as EKS and ECS, the Octopus Workflow Builder populates a GitHub repository with a sample application built with GitHub Actions workflows and configures a hosted Octopus instance with sample deployment projects demonstrating best practices such as vulnerability scanning and Infrastructure as Code (IaC).

Happy deployments!

Loading...