Tunnel name generator4/4/2023 ![]() ![]() ![]() ![]() The Deployment creates and uses the ReplicaSet for scaling. Lets list the ReplicaSets: ➜ ~ kubectl get replicasets NAME DESIRED CURRENT READY AGE test-data-generator-667b8b64bd 2 2 2 4mĪctually, the ReplicaSet is responsible for scaling not the Deployment directly. Deployment allows us to scale up or down the number of replicas and supports rolling updates and rollbacks. Here, the desired state is that there are 2 replicas of our application. The Deployment ensures that current state matches desired state. We can list current pods with following command: ➜ ~ kubectl get pods NAME READY STATUS RESTARTS AGE test-data-generator-667b8b64bd-k2pk7 1/1 Running 0 3m test-data-generator-667b8b64bd-kqrrp 1/1 Running 0 3m In this example, the Deployment creates a ReplicaSet and and two Pods. Save the file as test-data-generator.yaml and create the Deployment using following command: ➜ ~ kubectl create -f test-data-generator.yaml In this example, I am using a docker image which I created to run a simple spring application ( ). Deploying an application to Kubernetes, Deployments and Services Deploy the applicationįor the deployment, we need a yaml file with a Kubernetes Deployment configuration details: apiVersion: apps/v1 kind: Deployment metadata: name: test-data-generator labels: app: generator spec: replicas: 2 selector: matchLabels: app: generator template: metadata: labels: app: generator spec: containers: - name: generator image: ilyaskeser/test-data-generator:0.0.1-SNAPSHOT ports: - containerPort: 8080 ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |