deployment code example

Example 1: deployment example

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80

Example 2: deployment

Deployment can happen anytime-
We have a -REGULAR APPLICATION DEPLOYMENT- 
where we deploy functional stories.
On the other hand
-EMERGENCY DEPLOYMENT- for bug fix. We typically
call it "HOT FIX"

So for REGULAR DEPLOYMENT
First all of if it's a big deployment we
hold "go-no-go" meeting to decide if we
are going to do deployment.If we decide to
deploy then
1-We are as a team raising a CO(Change order)
at least 3 days before the deployment
2-Change order get approved by upper management
and we are explaining 
*what are we going to deploy
*steps of how we will deploy
*what we will do if we fail the deployment
*who needs to approve the success
of the deployment(usually PO does)
3-At the off hours when nobody uses the application
we are starting the deployment(usually around midnight)
4-If the deployment is succesful we close
the Change order mark it as complete

As a tester I usually watch the deployment. 
I don't really involve.