Skip to content

Commit

Permalink
feat: ✨ Replicasets: higher-level abstraction over pods
Browse files Browse the repository at this point in the history
A ReplicaSet in Kubernetes is a higher-level abstraction over pods that ensures a specified number of replicas of a pod are running at any given time. In simple terms, a ReplicaSet ensures that a certain number of identical pod instances are running, and if any of those instances fail or are terminated, the ReplicaSet will create new ones to maintain the desired count.
  • Loading branch information
kevencript committed Mar 17, 2023
1 parent c461c7f commit 1a75e1b
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
deploy-from-scratch:
$(MAKE) create-kind-cluster
$(MAKE) apply-k8s

create-kind-cluster:
kind create cluster --config kind-config.yaml --name $(NAMESPACE)
kind export kubeconfig --name $(NAMESPACE)

apply-k8s:
kubectl apply -f k8s

delete-k8s:
kubectl delete -f k8s
File renamed without changes.
4 changes: 4 additions & 0 deletions k8s/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: k8s-fundamentals
21 changes: 21 additions & 0 deletions k8s/replica-set.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: go-http-app-replicaset
labels:
app: go-http-app
tier: backend
spec:
replicas: 2
selector:
matchLabels:
tier: backend
template:
metadata:
labels:
tier: backend
spec:
containers:
- name: go-http-app
image: wesleywillians/hello-go:latest

0 comments on commit 1a75e1b

Please sign in to comment.