deployment replicaset. Ta thấy kết quả trả về có 1 ReplicaSet có tên là myapp-deployment-549fd4bf6c. deployment replicaset

 
 Ta thấy kết quả trả về có 1 ReplicaSet có tên là myapp-deployment-549fd4bf6cdeployment replicaset yml

root@k8s:. So the only way to do this is to scale down the number of replicas. Creating Your First Deployment. If you want to create Deployment you must specify this properties. Deployment is a supervisor for pods. Now this ReplicaSet and its Pods are managed by the Deployment. 8 to deploy our software in a cloud provider. Published Nov. When you create a Deployment, a ReplicaSet resource is created underneath. Aug 25, 2023 10 min read Statefulset Deployment Kubernetes. 2 Answers. This replica will further create a pod with name web-app-<replica-set->-<pod-id>. In other words, a Deployment makes sure that a pod or homogeneous set of pods are always up and available. I am not able to delete this ReplicaSet as well. Replica sets can be added to any peered virtual network in any Azure region that supports Domain Services. Example: kubectl delete deployment hello-world -n mynamespace. spec. StatefulSet (stable-GA in k8s v1. The. This doesn't work as the ReplicaSet is not inactive. Note-: Giving each pod its own required identity makes the difference between stateful and deployment. tier=backend. The Pods and ReplicaSets are replaced individually, allowing old and new versions to briefly coexist. apps and replicaset. Despite both controllers being instrumental in managing high-availability. Although there are fundamental differences in how Deployments and StatefulSets operate, both are meant to ease the deployment and management of containers in a. Deployment membuat ReplicaSet baru. When a Deployment is changed, the previous ReplicaSet needs to. Convert an existing standalone mongod instance into a three-member replica set. However, more sophisticated selection rules are possible, as. But what ends up happening is all the pods in the replicaset inside the deployment will end up using the same shared volume and end up modifying the same data on disk. Overview. m. The controller runs within the control plane, and periodically adjusts the scale of the target object (deployment, ReplicaSet, replica. StatefulSets. yml deployment. Vì vậy, ta nên sử dụng Deployment Container thay vì sử dụng trực tiếp ReplicaSet trừ khi ta có nhu cầu đặc biệt cần phối hợp. The simplest method that comes to mind when we need to run a Singleton Pod in Kubernetes is a ReplicaSet. What is a Kubernetes ReplicaSet? A ReplicaSet (RS) is a Kubernetes object used to maintain a stable set of replicated pods running within a cluster at any given time. But the replicas attribute on the Deployment object is actually related to this object. While ReplicaSets can be used independently, today they're mainly used by Deployments as a mechanism to orchestrate Pod creation, deletion and updates. We also covered hands-on Lab 14 , Lab 15 , Lab 16 , Lab 17 Lab 22 & Lab 24 out of our 30+ extensive labs. Deleting ReplicaSet. name=backend. Like a Deployment, a StatefulSet manages Pods that are based on an identical container spec. r. The ReplicaSet is responsible for making sure that the number of replicas specified are always running. While ReplicaSets can be used independently, today they're mainly used by Deployments as a mechanism to orchestrate Pod creation, deletion and updates. Share. Kubernetes HorizontalPodAutoscaler automatically scales Kubernetes Pods under ReplicationController, Deployment, or ReplicaSet controllers basing on its CPU, memory, or other metrics. When you updated the Deployment, it created a new ReplicaSet (nginx-deployment-1564180365) and scaled it up to 1 and waited for it to come up. Metadata. For the value. ReplicaSet ReplicaSet 的目的是维护指定数量的 Pod,常用做保障指定数量 Pod 的可用性 Deployment Deployment 是一个用来管理 ReplicaSet 的更高级概念,某种程度上我们不应该操作 ReplicaSet,而是直接使用 Deployment。Deployment 拥有 Rollout & Rollback 功能,方便我们管理。 StatefulSet StatefulSet 用来管理有状态的应用,其会. The deployment sets up a ReplicaSet with three pod replicas, specified in the replicasfield under spec. Terraform by-default uses Deployment for ReplicaSet. Deployment creates ReplicaSet with the number of replicas=3. 決めた分だけ Pod の起動を維持してくれるし、これで事足りる。. yml. 2. For the value smi, the percentage traffic split is done at the request level by using a service mesh. Deployment works one level above ReplicaSet object. The difference is in the arguments passed to the command. Let’s now do a scale out test, where we will scale the deployment to 3. You can select resources based on these labels to delete them. yaml and re-apply it to update the deployment. Kubernetes ReplicaSet. but the problem is i need to clean all old deployment and replica set once new version deployed successfully. string. kubectl apply -f dp. ConclusionThough the Deployment is more suitable than the ReplicaSet, this answer focuses on ReplicaSet over Pod cause the question is between the Pod and ReplicaSet. spec. The United States and China, the world’s two largest climate polluters, have agreed to jointly tackle. nodeAffinity field (if specified) is taken into consideration by the DaemonSet controller when evaluating the eligible nodes, but is. However, if you just want to distribute a deployment among all nodes then you can use pod anti affinity in your pod manifest file. x ReplicaSet. To make changes in your current deployment you can use kubectl rollout pause deployment/YOUR_DEPLOYMENT. Its purpose is to maintain the specified number of Pod instances running in a cluster at any given time to prevent users from losing access to their application when a Pod fails or is inaccessible. string. Replica-Sets replicate and manage pods, as well. The random string is randomly generated and uses the pod-template-hash as a seed. . Create credentials for the Kubernetes Operator or configure a different secret storage tool. yaml, this will instruct Kubernetes to scale the current number of Pods to the value of. In kubernetes where pods are controlled by the replicaSet, if you kill a pod it will again be recreated. To create a ClusterIP service (default), use the following command: $ kubectl expose deployment nginx-deployment –name my-nginx-service –port 8080 –target-port=80. You can use the delete command to delete an object from a cluster: delete <type>/<name>. You will almost never create this directly. Deployment control the RS, and RS controls pods. There are many private registries in use. 4 or later. Deployments manage a ReplicaSet, e. yaml --namespace=custom-namespace. A standalone mongod instance is useful for testing and development. It uses the spec. Behind a deployment. The user can specify a different scheduler for the Pods of the DaemonSet, by setting the . To create a replica said execute the following command. PodとReplicaSetが再作成されました。. schedulerName field of the DaemonSet. This document provides strategies for replica set deployments and describes common architectures. Deployment :ReplicaSetを管理するオブジェクト(アプリケーションデプロイの基本単位. If you just have a Replicaset with one replica and no PodDisruptionBudget specified, the pod will be terminated and a new pod will be created on other nodes. It scales up 7 because 25% of 25 (your maxSurge value) is 6. If you check ReplicaSet after deploying a Deployment you will notice a ReplicaSet of the same name at the Deployment. Every pod owned by a ReplicaSet will get the unique "metadata. 15340e5036f2fec1. Or just strip the name out to get the index at the end. Let’s first take a look at how should we create a ReplicaSet. g. spec. - type: Available status: 'False'. A ReplicaSet uses labels to match the pods that it will manage. To start with the deployment of the new cluster, go to the deploy option in the top right corner. Kubernetes is also known as K8s is an open-source container orchestration tool developed by google which is used for automating software deployment, scaling, and management. Concepts: Pod: A Pod is a group of one. kubernetes. OpenShift Container Platform adds expanded support for the software development and deployment lifecycle with the concept of deployments. Deployment is recommended for application services. Avoid complexity when possible, but let your application requirements dictate the architecture. El Deployment está reduciendo su(s) ReplicaSet(s) más antiguo(s). #update deployment kubectl apply -f node-deployment. The ReplicaSet uses a pod template with the app: web-app label, and the pod specification includes a container named web using the nginx image with specified resource limits and requests. create a deployment. And in this week, Day 7 and Day 8 we covered Kubernetes Services, Deployment, HPA, Cluster Resource Limit, Daemonset Controller and Dashboard. This document provides strategies for replica set deployments and describes common architectures. A Deployment is a higher-level resource that provides a declarative way to manage and update pods. Use the kubectl apply command to create the ReplicaSet by applying the manifest:DaemonSet is a controller similar to ReplicaSet that ensures that the pod runs on all the nodes of the cluster. This Replicaset is responsible for creating Pod's. Difference Between Deployment and ReplicaSet in Kubernetes 1. 18 the kubectl run will no longer create deployments but pods. Click the. Within the Deployment spec, there is always a ReplicaSet created. Note: we can ignore the service named kubernetes in the example above; that one already did exist before our kubectl run command. yaml --record=true #get the replicaset list kubectl get rs #get the Pods list. Context. Deployment and ReplicaSet (replacing the legacy resource ReplicationController). For example, when this value is set to 30%, the old ReplicaSet can be scaled down to 70% of desired Pods immediately when the rolling update starts. That method will check the Deployment status and perform the. このリソースは直接使用することは少ないが、次に出てくるDeploymentを抑える上で理解が進むのでやっていこう。. Geographically distributed replica set – Enhances redundancy of data besides protecting data against faults such as power loss. 롤링업데이트, 배포 중단, 롤백이 가능합니다. Avoid complexity when possible, but let your application requirements dictate the architecture. Entonces, continuó escalando el nuevo y el viejo ReplicaSet con la misma. 3. To learn more about replica sets, see the Replication Introduction in the MongoDB manual. For any of the mentioned triggers, the Deployment controller will do a Deployment sync. Sometimes, Kubernetes sets the value of ownerReference automatically. Deployments create a new replica set whenever you do an update to the deployment. 2- MongoDB Helm Chart. As per the name, ReplicaSet is used for managing the replicas of our pods. mongosh --port 28015. Before you begin You need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to. configure ArgoCD / FluxCD / other deployment tool to delete them. As mentioned in the previous section, there are two ways to define or configure a ReplicaSet; directly through a YAML configuration file or through a deployment. Additionally, it's worth considering if you can use Deployment instead of directly using ReplicaSet. But what is the best for this case ? This Pod is stateful (I am using volume hostPath to keep the data) and is deployed using nodeSelector to keep it always on the same Node. Then, the Deployment controller constantly works and monitors to ensure the actual state is as expected. Avoid complexity when possible, but let your application requirements dictate the architecture. Now that we have learned about ReplicaSet and Deployment, let’s summarize their key differences: Abstraction level: A Deployment is a higher-level abstraction that. If you already have one or more database deployments, click Create. kubectl create --help |awk '/Available Commands:/,/^$/' Available Commands: clusterrole Create a cluster role clusterrolebinding Create a cluster role binding for a particular cluster role configmap Create a config map. This naming is consistent, so you can make sure you always have. Stateless applications are those that do not. Ok, let me explain. Also, the template used to create the Pods will be specified in the Deployment YAML file. spec. A Deployment ensures that a specified number of pod “replicas” are running at any one time. Deployment creates it in the background and manage it. Version. ReplicaSets are the smart way to. A ReplicaSet’s purpose is to run a specified number of pods at any given time. Previously, we have learned how to roll back to an old version in case of an issue with a current deployment. At least that is how it is in 1. Always use a replica set in production. A ReplicaSet is one of the Kubernetes controllers that makes sure we have a specified number of pod replicas running. Here we go. For Deployment, ReplicaSet, Replication Controller, wait for the status value of ready_replicas to change to the number of replicas. How to delete objects. The Deployment is scaling down its older ReplicaSet(s). More information Before you. This manifest defines a Deployment for the nginx application. What is a ReplicaSet?. When you revise a deployment, a ReplicaSet is created that. 14, 2023 Updated Nov. While ReplicaSets can be used independently, today they're mainly used by Deployments as a mechanism to orchestrate Pod creation, deletion and updates. spec. As per the name, ReplicaSet is used for managing the replicas of our pods. For Deployment, ReplicaSet, Replication Controller, only scale, if the number of existing replicas matches. By default, every Deployment is set to 10 for reserving the old. For example, when you create a ReplicaSet, Kubernetes. The ReplicaSet data includes the number of desired replicas, the selector to identify which pods are being controlled, and the template for the pod. » Prerequisites. A standalone instance isn't a good choice for a production deployment because it can be a single point of failure. Creating and Checking the Status of a ReplicaSet. kubectl delete deploy inginx-deploy. selector field defines how the created ReplicaSet finds which Pods to manage. Know everything about the CKA Certification. The deployment automatically creates a replicaset object. Nếu có bất kỳ sự cố nào xảy ra và các Pod bị lỗi. You can easily verify this using kubectl to retrieve pods and replica sets after. Usually, you define a Deployment and let that Deployment manage ReplicaSets automatically. io/revision: "4" This will exist on both the deployment and the replicaset. Notice that the name of the ReplicaSet is always formatted as [DEPLOYMENT-NAME]-[RANDOM-STRING]. Bare pod. Example: If the replicas: 1 is changed in the Deployment to e. apps/kuard created $ kubectl get deployment,replicaset,pod --show-labels NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE LABELS deployment. The reason we have noticed it - it tries to perform a database. 1 Answer. If a user-facing Pod fails or becomes overworked, the Deployment allocates work to a Pod from the ReplicaSet to maintain responsiveness. It creates a selector that matches to matchLabels. For now I'm able to increase the replicas from CLI using the command: kubectl scale --replicas=3 deployment my-deployment. The Replica Set Controller detect the change then according to the number of replica, create Pod objects. While ReplicaSets can be used independently, today it’s mainly used by Deployments as a mechanism to orchestrate. This way the deployment will be marked as paused and won't be reconciled by the controller. Deployment では、全てのPodで1個のPV をマウントしている違いがあります. The situation is analogous to having a manager order "We need three workers doing this task at all times. That’s the job of the ReplicaSet object. The kubectl scale command is used to change the number of running replicas inside Kubernetes deployment, replica set, replication controller, and stateful set objects. From kubernetes terminology you can delete any component with below pattern. While this command doesn’t explicitly restart any Pods, it. In this article. At the same time, Kubernetes Concepts page says about ReplicaSet object. A ReplicaSet ensures that a specified number of Pod replicas are running continuously and helps with load-balancing in case of an increase in resource usage. Deployment is a higher-level concept that manages ReplicaSets and provides declarative updates to Pods. A service mesh must be set up by a cluster admin. It is generated by hashing the PodTemplate of the ReplicaSet and using the resulting hash as the label value that is added to the. How Deployment uses spec. リソース 役割; Deployment: ReplicaSetを生成、管理しローリングアップデートやロールバックといったデプロイ管理を行います。: ReplicaSet: 同じ仕様のPodのレプリカ数を管理します。ReplicationControllerの後継に当たるものです。: Pod: アプリケーションを動かすための最小単位。To make changes in your current deployment you can use kubectl rollout pause deployment/YOUR_DEPLOYMENT. This task handles orchestration of SMI TrafficSplit objects. You signed in with another tab or window. How to create a Deployment. You'll start by creating a ReplicaSet manifest in YAML format. Deployment はPodとReplicaSetの宣言的なアップデート機能を提供します。 Deploymentにおいて 理想的な状態 を記述すると、Deploymentコントローラーは指定された頻度で現在の状態を理想的な状態に変更します。Deploymentを定義することによって、新しいReplicaSetを作成したり、既存のDeploymentを削除して. Note that we recommend using Deployments instead of directly using Replica Sets, unless you require custom update orchestration or. Reload to refresh your session. Pod :1つ以上のコンテナからなる集合体(Kubernetes上でコンテナを管理する最小単位). ReplicaSet – A ReplicaSet creates a stable set of pods, all running the same workload. offer several benefits for managing application deployments:Good explanation what is event in Kubernetes you can find in Types of Kubernetes Events article. Under the hood, Deployment creates a ReplicaSet which in turn creates pods on our cluster. 一个 Deployment 为 Pod 和 ReplicaSet 提供声明式的更新能力。. Implementation mechanism of garbage collection. Lowering the replica count will cause Kubernetes to gracefully terminate. For Deployment, ReplicaSet, Replication Controller, wait for the status value of ready_replicas to change to the number of replicas. selector section so that new replicaset and deployment can be run while old one still taking traffic. . Three member Replica Set – the basic standard architecture for a replica set. Below is a simple example of a rolling update and undo operation (rollback) is explained. A DeploymentConfig (DC) in OpenShift is more or less equivalent to a Kubernetes Deployment, nowadays. kubectl rollout restart deployment myapp deployment. A deployment creates replicaset and replicaset in turn creates pod. kubectl get replicaset. Kubernetes deployment drawbacks. yaml replicaset "soaktestrs" created Check the Status of a ReplicaSet Once the ReplicaSet is created, we can use the describe command to check the status of the pods and get more detail. In this case, you select a label that is defined in the Pod template (app: nginx). # kubectl describe rs soaktestrs Name: soaktestrs Namespace: default Image(s): nickchase/soaktest Here you see that when you first created the Deployment, it created a ReplicaSet (nginx-deployment-2035384211) and scaled it up to 3 replicas directly. Deployment is the easiest and most used resource for deploying your application. The deployment will fetch a docker image hosting the required python runtime, and then attach a ConfigMap to the application Pod hosting the sample Python script shown earlier. An example output is as follows. A ReplicaSet ensures that a specified number of pod replicas are running at any given time. A Deployment creates a ReplicaSet and manages the lifecycle of the Pods controlled by the ReplicaSet. Instead we use Deployment to manage a ReplicaSet. A ReplicaSet provides basic scaling mechanisms for pods, such as creating new pods if. The Deployment creates a ReplicaSet that creates three replicated Pods, indicated by the . Kubernetes has emerged as the de facto standard for container orchestration. You may test it, after deleting the ReplicaSet and then typing the command kubectl get pods into the terminal. However if you change labels and. The Deployment controller uses this // field as a collision avoidance mechanism when it needs to create the name for the // newest ReplicaSet. For example, if you look at the above Deployment closely, you will see that it first creates a new Pod, then deletes an old Pod, and creates. New Pods become ready or available (ready for at least MinReadySeconds). host. Hay nuevos Pods disponibles y listos (listo por lo menos MinReadySeconds). This procedure allows you to set different settings for the replica set resource, such as overrides for statefulSet configuration. The next step is to create a new MongoDB database and user for your application. The standard replica set deployment for a production system is a three-member replica set. We run the following command in k8s. If you want to look at all the logs for a specific deployment, use the command: kubectl logs. However, more sophisticated selection rules are possible, as. Kubernetes events are a resource type in Kubernetes that are automatically created when other resources have state changes, errors, or other messages that should be broadcast to the system. 1、Replicaset概述. A ReplicaSet (RS) is a Kubernetes object that ensures there is always a stable set of running pods for a specific workload. caret right icon. A ReplicaSet provides basic scaling mechanisms for pods, such as creating new pods if any pod. Your pods ( dependents) have metadata. I have a command to scale all the deployments to zero. The v1. This will tell you what "owns" the pod. Note: A Deployment that configures a ReplicaSet is now the recommended way to set up replication. . It's important to note that Deployment objects are used to manage stateless applications. spec. After the deployment starts, you find a new KUBERNETES OBJECT STATUS tab next to the TASK LOG tab. yaml kubectl apply -f d. I am creating a deployment using this yaml file. A good demonstration of delegation is how the pod, ReplicaSet, and deployment resources work together in the container orchestration process. Và nhiệm vụ của ReplicaSet là. Choose the deployment node from the list in the command output. ¶ The Advanced Configuration Options section allows you to set MongoDB runtime options for each MongoDB process in your deployment. I have written a bash script to get all deployments on a kubernetes cluster. Can also be specified via K8S_AUTH_HOST environment variable. then apply it to the cluster with: kubectl apply -f k8-deployment. When a Deployment is changed, a new ReplicaSet is created. trafficSplitMethod - Traffic split method string. A Deployment deletion; A ReplicaSet creation; A ReplicaSet update; A ReplicaSet deletion; A Pod deletion; All those triggers allow the entire handling of a gradual rollout. Let's say if your deployment had 4 replicas. 7. Deployments have two main disadvantages compared with StatefulSets and DaemonSets. You will almost always use only Deployment for deploying an application, and for every change, e. They let you perform rolling updates of ReplicaSets, where Pods are rescheduled. Deployment object is a "abstract" layer for ReplicaSet creation and manage it. Have or install the MongoDB Enterprise Kubernetes Operator. When an HPA is enabled, it is recommended that the value of spec. # deployment name and namespace deployment_name=mydeployment deployment_ns=mynamespace # get replica set identifier for deployment dep_rs=$ (kubectl describe. Normally, the old (previous). Creating a ReplicaSet. Listing all the pods belonging to a deployment can be done by querying its selectors, but using the deployment’s synthesized replicaset identifier allows for easier automation. With deployment you should be able to do rolling upgrade or rollback. By using the command kubectl delete rs <rs name>, where rs name is the name of your ReplicaSet, you can destroy ReplicaSets. The deployment file contains details for a ReplicaSet that includes a PodTemplate. Now, let’s scale them down by specifying the –replicas=1 option to the command: $ kubectl scale -. kubectl -n eks-sample-app describe service eks-sample-linux-service. I am new to kubernetes and trying to create a deployment. Replica Count: The number of replicas (pods) the controller should always be. Without this hash, when a Deployment specs are updated and a new ReplicaSet needs to be created, how would it be distinguished from the previous one? I think this is not a matter of overlapping ownership of objects, it is more of a matter of overlapping specs. The following is an example ReplicaSet definition: apiVersion: apps/v1 kind:. Key concepts. When the update starts, the old ReplicaSet is scaled down to 60%. how to refer ReplicaSet in deployment? 0. restart で、ロールアウトを再実行します。. every Kubernetes object has its own requirements. readyReplicas - the number of pods that are reachable from deployment through all the replicas. A ReplicaSet, as the name implies, is a set of replicas (Pods) maintained with their Revision history. replicas field. Create a Service. Since the Kubernetes v1. spec. kubectl delete deployment $ {our-deployment-name} And this seems to delete the deployment called our-deployment-name fine. Like a ReplicaSet’s purpose is to maintain a stable set of replica Pods running at any given time. You’ve completed the deployment of the MongoDB operator and ReplicaSets to your Kubernetes cluster at this point. ReplicaSet. Deployment is an abstraction over ReplicaSet. ”ローリングアップデート”というのができる. The . The Deployment knows that the two Pods can't coexist in the same ReplicaSet, so it creates a second ReplicaSet to hold version 2. This is where PDB s provide the added advantage over the Replicaset. then apply it to the cluster with: kubectl apply -f k8-deployment. StatefulSets. As we can find in the Kubernetes ReplicaSet documentation: Deployment is a higher-level concept that manages ReplicaSets and provides declarative updates to Pods along with a lot of other useful features. reason: NewReplicaSetAvailable message: >- ReplicaSet "integrated-repository-webapp-d69879c5f" has successfully progressed. Difference Between Deployment and ReplicaSet in Kubernetes 1. When you create a deployment, the template is needed for creationupdate of ReplicaSet and PODs, in this case, they need to match the selector, otherwise you would end up with orphan. Kubernetes deployments manage stateless services running on your cluster (as opposed to for example StatefulSets which manage stateful services). Creating a Kubernetes ReplicaSet. 現時点で、Deployment では、問題の発生時の最後に正常にデプロイされた ReplicaSet への自動ロールバックをサポートしていません。 トリガー Deployment の場合、デプロイメントの Pod テンプレートに変更があるたびに新しいロールアウトが自動的にトリガーさ. To deploy a replica set using an object, you must: Have or create an Ops Manager instance or a Cloud Manager organization. Cet objet est souvent utilisé pour garantir la disponibilité d'un certain nombre identique de Pods. While ReplicaSets can be used independently, today they're mainly used by Deployments as a mechanism to orchestrate Pod creation, deletion and updates. The challenge I am having is that, I want to be able to loop through all the deployments and save their name and number of replicas so I scale them back to the original after scaling down. ReplicaSet is the next-generation ReplicationController that supports the new set-based label selector. ReplicaSet. A ReplicaSet ensures that a specified number of pod replicas are running at any given time. The . The trailing ReplicaSets that you can see after deployment deletion depends of the Revision History Limit that you have in your Deployment. A pod is the smallest unit of deployment in Kubernetes, consisting of one or more containers that share resources and networks. Create pods. Provide a URL for accessing the API. The --port command-line option. A Deployment is a higher-level resource meant for deploying applications and updating them declaratively, instead of doing it through a ReplicationController or a ReplicaSet, which are both considered lower-level concepts. Share. After it's paused you can make necessary changes to your configuration and then resume it by using kubectl rollout resume. The major difference between a ReplicaSet and a Replication Controller right now is the. When to use a ReplicaSet. While ReplicaSets can be used independently, today they're mainly used by Deployments as a mechanism to orchestrate Pod creation, deletion and updates. In the case of a Job, update parallelism only if the current parallelism value matches. As per the name, ReplicaSet is used for managing the replicas of our pods. To create a ClusterIP service (default), use the following command: $ kubectl expose deployment nginx-deployment –name my-nginx-service –port 8080 –target-port=80. # Create the MySQL StatefulSet using deployment we can undo deployment, pause deployment, resume deployment. 2. Kubernetes Deployment is usually used for stateless applications. You would have those many replicas running. 1 that I run. Imperative way: (this will then diverge from what you have in your yaml-file) kubectl scale deployment mage-di --replicas=2. g. Kubernetes Documentation.