serving the solutions day and night

Pages

Showing posts with label YAML. Show all posts
Showing posts with label YAML. Show all posts

Tuesday, August 25, 2020

Deploy ASP.NET CORE application with the Kubernetes Deployments

Update the application with a rolling update strategy that releases new pods more gradually, one pod at a time. 

Roll back the application to a specific version of the deploy history using the deployment. 

Run the command without --restart=Never (Deploy ASP.NET Core Application images in Kubernetes (K8s) & POD). Command to create a simple deployment 

 kubectl run frontendmvcv1 --image=makader/myapp:frontendmvc-v1 --port 80 

kubectl get deployment frontendmvcv1


Wednesday, August 19, 2020

Deploy ASP.NET Core Application different image verison in Kubernetes

Deploying the pods (individually or with a replication controller), using the same labels, except for the version, for which you use the value v2. 

Modified the code (frontendmvc).

Build the image, re name the image tag version 2 & publish the image to Docker Hub

docker build -t frontendmvc .
docker tag frontendmvc makader/myapp:frontendmvc-v2
docker push makader/myapp:frontendmvc-v2


Kubernetes Lessons Learned

ASP.NET CORE and Docker

ASP.NET Core Application with Docker

Add SQL Server 2017 Docker Container to ASP.NET Core MVC/Web API Project

Docker Compose

Deploy ASP.NET Core Application images in Kubernetes (K8s) & POD

Kubernetes ReplicationController

Access ASP.NET Core MVC Application with Kubernetes and NodePort

Create a Kubernetes service using a YAML

Deploy ASP.NET CORE application with the Kubernetes Deployments

Kubernetes ReplicaSet selector with matchExpressions

Kubernetes Deployment Update Strategy

Monday, August 17, 2020

Create a Kubernetes service using a YAML

Instead of exposing directly (see the blog), create a service in a declarative way using a YAML file

forntendmvc_service .yaml

--- 
apiVersion: v1
kind: Service
metadata: 
 name: myapp-svc
spec: 
  selector:
    app:myapp
  type: NodePort
  ports:
    - port:80
      nodePort: 30001

Sunday, August 16, 2020

Kubernetes ReplicationController

Create multiple instances of the pod using a ReplicationController, which is a master controller that replicates the specified pods, balances them on all the nodes, and reacts if some pod dies to restore the desired state.

forntendmvc_rc.yaml 

--- 
apiVersion: v1
kind: ReplicationController
metadata: 
 name: myapp-rc
spec: 
   replicas: 5  
   selector:    
     app: myapp    
   template:    
     metadata:         
       labels:           
         app: myapp           
         zone: prod           
         version: v1        
     spec:           
       containers:             
         - name:myapp-frontendmvc              
           image: makader/myapp:frontendmvc-v1              
           ports:               
             - containerPort:80