Sunday, April 16, 2023

Basic Understanding of DevSecOps, execute code and build artifact and deploy in the Azure portal apps service.

 

Basic Understanding of DevSecOps, execute code and build artifact and deploy in the Azure portal apps service.

DevSecOps is a philosophy. DevSecOps team work together.

Remember PETULA

P=Planning

E=Executing

T=Testing

U=UAT

L=Live. Go live

A=Associate Support. Monitoring and Support

 

PET = Perform Dev team

ULA= Perform Ops team

 

It is a philosophical approach. The DevSecOps definition:

P=Philosophy = Dev + Ops team work together

P=Process = Planning + Executing + Testing

T=Tools = Such as Azure, AWS DevSecOps for automations

 

Azure DevSecOps:

Boards = For planning

Repos = Executing. Check in and checkout code into repository

Testing Plan = Developer end testing = Internal Testing

 

Developer part = Boards + Repos + Test Plan

 

Build is automated called pipeline.

Pipeline = it is a group of small task list

Artifacts = it is a final output of pipeline

 

Boards consist of:

·       Work items

·       Boards

·       Backlogs

·       Sprint

·       Queries

 

Repos:

Do colon with repos to local VS source code. Push VS code into Repos

 

Pipeline:

Agent: it is a kind of software that take each task and executes.

Three types of agents:

·       Hosted agent

·       Self-hosted agent    //in the local PC, this agent needs to configured with the Azure to perform free activities.

·       Azure Virtual machine agent

 

In the pipeline select

·       Code location. It could be Azure Repos Git, Bitbucket, GitHub, GitHub enterprise

·       Create a self-hosted agent

·       Download self-agent poon file and run two files

o   First run config.bat

§  Set personal access token with read and merge

§  Enter agent pool = Y

o   Then run run.bat

After self-host is running, then set self-hosted agent with the pipeline to execute the task.

 

Release pipeline:

·       Create new app service in the Azure portal.

·       Create new release pipeline and set new app service with the pipeline along with the artifact has generated.

·       Now run. Once run, artifact will place into the apps service.

·       Go the to the Azure portal apps service and get the URL. Hit the URL then final page will display.

 

 

Learn from Shive sir. Thanks a lot sir.

 

 

 

 

 

 

 

Monday, April 10, 2023

Deploy .NET Core project by creating docker image into Kubernetes

 

Deploy .NET application in the Kubernetes:

 

Step1: Create a .net project

dotnet new webapi -n k8webapi

Step2: Build the project using the below command

dotnet build

Step-3: Create publish file in the release folder

dotnet build -c release

Step-4: Now run the program

dotnet run

Step-5: The actual project structure

project directory structure:

TESTAPI

            K8webapi>>Bin>>Debug

K8webapi>>Bin>> Release


Step-6: Create a docker image using the below command             

create a docker image. To create a docker image, first need to create docker file

now create a docker images using the docker file. You can keep filename: dockerfile

 

FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS runtime

WORKDIR /app

COPY k8webapi/bin/release/net7.0/ ./

ENTRYPOINT ["dotnet", "k8webapi.dll"]

Step-6: Create docker images using the

docker build -t k8webapi-image -f "e:\Learning\Technology\KubernetesUI Setup\testapi\k8webapi\dockerfile" .

Step-7: Check whether images has created or not.

check whether image has created or not

docker images

Step-8: Create a POD file and move image file into the Kubernetes

now need to create a pod file and then deploy image into Kubernetes cluster

then run it. File name: Pod.yml

apiVersion: v1

kind: Pod

metadata:

  name: k8webapi-image-web-test

spec:

  containers:

    - name: k8webapi-image-web

      image: k8webapi-image

      imagePullPolicy: IfNotPresent

      ports:

        - name: web

          containerPort: 80

Step-9: Now check POD is running or not

check pod created successfully using below command:

kubectl port-forward k8webapi-image-web-test 5000:80



 

 

Docker and Kubernetes install in the windows

 

How to quickly run Docker and Kubernetes in the windows machine


Step-1: Install docker desktop version from docker. Use this link https://docs.docker.com/desktop/install/windows-install/ to setup docker desktop. Create user name and password for docker hub. We need it to crate docker images.

 

Step-2: Install WSL 2 to enable Linux Kernal in the windows machine.

 

Step-3:  After successfully docker desktop installed, check docker version using cmd. >>docker version

 

Step-4: After docker successfully installed, now enable Kubernetes from docker. Go to docker setting >> then there is Kubernetes left side bar >> then

·        Enable Kubernetes

·        Show System Containers (advance)

·        Then apply and install

 

Step-5: After successfully installed Kubernetes, both Docker and Kubernetes will show running with green in the down right corner of the docker desktop window.

 

Step-6: Now check Kubernetes version using cmd. >>kubectl version. Now you do all based on the Kubernetes.

 

Step-7: Now let’s install Kubernetes dashboard. First login to the Docker Hub using the link: https://hub.docker.com/ . After login click Explore button then find kubernetesui/dashboard. Then down the Kubernetesui/dashboard option, click the link https://github.com/kubernetes/dashboard to details install steps.

 

Step-8: To install Kubernetes, click this link kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml 
After steps-8 done, then move to Step-9.
 

Step-9: execute tow command using PowerShell.

>>kubectl proxy

 

Step-10: Now access dashboard using this link: http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/

After hitting the link, application will ask for Token


To get the Token:

Step-11: Create a folder in the any Drive. Let’s take an example: KubernetesTokenFolder in D drive. Now create two files with the name:

·        ServiceAccount.yaml

The contents of the file  

 

apiVersion: v1

kind: ServiceAccount

metadata:

  name: admin-user

  namespace: kubernetes-dashboard

 

·        ClusterRoleBinding.yaml

The contents of the file  

apiVersion: rbac.authorization.k8s.io/v1

kind: ClusterRoleBinding

metadata:

  name: admin-user

roleRef:

  apiGroup: rbac.authorization.k8s.io

  kind: ClusterRole

  name: cluster-admin

subjects:

- kind: ServiceAccount

  name: admin-user

  namespace: kubernetes-dashboard

 

Step-12: Now run the above two file using the below sequences after moving into the KubernetesTokenFolder folder.

>> kubectl apply -f .\ServiceAccount.yaml

>> kubectl apply -f .\ClusterRoleBinding.yaml

 

Step-13: To get Token run the below command

>> kubectl -n kubernetes-dashboard create token admin-user

After that you will get token, copy token and past in the Token asking text box. Preserve Token for future reference is needed.

 

Wonderful… Now Kubernetes is running successfully. Enjoy

 

Docker Desktop:




Kubernetes Dashboard:



Sunday, April 9, 2023

Summary Scrum Guide 2020

Scrum

Scrum is being used pattern, process and insight that fit the scrum framework.

Scrum is a light weight framework that helps people, team and organization generation value through adoption solution for complex problem.

Scrum require scrum master to faster an environment

·       Product owner order the work for a complex problem into a product backlogs.

·       The scrum team turns a selecting of work into an incremental work during sprint.

·       The scrum team and product owner inspect the results and adjust for next sprint.  

·       Repeat

 

Scrum Theory:

·       Scrum is a fundamental of empiricism and lean thinking.

·       Scrum employs iterative, incremental approach to optimized the predictability and control the risk.

·       Scrum combine 4 formal events for inspection and adaptation.

·       The event works because they implement the empirical scrum pillar of

o   Transparency

§  Work must be visible

§  Low transparency led to decision that diminish value and increase risk

o   Inspection

§  Scrum artifact and progress toward goal must be inspected frequently to detect undesirable variance and problem.

o   Adaptation  

§  If anything is deviated or any results is unaccepted, the process must be adopted.

§  It minimizes further deviation

 

Scrum value:

CCFOR:

C=Commitment

C=Courage

C=Focus

O=Openness

R=Request

 

The scrum team and stakeholder are open about the work and the challenges.

 

Scrum Team:

The scrum team consist of

·       One scrum master

·       One product owner

·       Developers

 

Ø In the scrum team, there is no sub-team or hierarchies.

Ø Focus on object at a time, the product goal.

Ø Scrum team is cross-functional, meaning that team member has all the skill to create the value.

Ø Self-managing internally, who does what, when and how.

Ø Typically, 10 or few people

Ø Cohesive scrum team

Ø Scrum team responsibility for product related activities from stakeholder collaboration, verification, maintenance, operational, experimental and research and development. 

Ø Scrum define 3 specific responsibilities within the scrum team

a.     The developer

b.    Product owner

c.     Scrum master

 

Developer:

·       Creating a plan for sprint and sprint backlogs

·       Adopting the plan

·       Holding each other accountability

 

Product owner:

·       Product owner is accountable to maximize the value of the product resulting from the scrum team.

·       Product owner accountable to manage product backlog that includes

o   Explicitly communicating the product goal

o   Clear communicating product goal

o   Ordering product backlog

o   Ensure that product backlog is transparent, visible and understood.

·       Product owner may delegate the responsibility but product owner will remain accountable.

·       Product owner is one person not the committee.

·       Product owner represent the need of the stakeholder in the product backlog.

 

Scrum Master:

·       Scrum master is accountable for establishing scrum. They do within the scrum team and organization.

·       Scrum master is accountable for team effectiveness and do practice scrum using scrum framework.

·       Scrum master are true leader to serve scrum team and organization.

 

Scrum master serve three major responsibilities:

·       Scrum master serves scrum team

o   Coaching, do self-management and cross-functionality

o   Help team to create high value increment that meet the definition of done.

o   Remove the impediments

o   Ensure that event take place are positive, productive and kept within timebox.

·       Scrum master serves product owner

o   Helping finding technique defining product goal and product backlogs management.

o   Helping scrum team to understand clear and concise need of product backlog items with product owner.

o   Helping establish empirical product planning for complex environment.

o   Facilitating stakeholder collaboration as request.

·       Scrum master serves organization

o   Leading, training and coaching scrum in the organization

o   Adopt scrum practice

o   Plan and implementing scrum

o   Helping employee and stakeholder understand

o   Removing barriers between stakeholder and scrum team.

 

Scrum events:

·       Sprint is a container for all the event.

·       Event are held to reduce the complexity

 

Sprint:

·       Sprint is the heartbeat of scrum where idea turn into value

·       sprint is fixed length event 1 month or less

To achieve the product goal that includes

·       Sprint planning

·       Daily scrum

·       Sprint review

·       Sprint retrospective

During the sprint:

·       No change is made

·       Quality does not decrease

·       Product backlog refines as needed

·       Scope may be clarified and renegotiated with the product owner

 

 

Ø Sprint enable predictability by ensuring inspection and adaptation of progress of product goal at least every calendar month.  

Ø If sprint horizon is too long, the sprint goal is valid.

Ø Shorter sprint generate value, limit risk, cost and effort to smaller time frame.  

Ø Each sprint called short project

Ø Burn-downs and burn-ups show/forecast the progress

Ø Sprint goal cancel if sprint goal is obsolete. Product owner have right to cancel it.

 

Sprint planning:

·       Sprint team may invite other people in the sprint planning to give advice.

Sprint planning contain the below topics:

Topic-1: why sprint is valuable?

·       Product owner propose how product could increase value.

·       Scrum team define sprint goal and sprint is valuable to the stakeholder.

·       Sprint goal must be finalized before the sprint planning.

Topic-2: what can be done in the sprint?

·       After discussing with the product owner, developer select the item from the product backlog and put into the current sprint.

·       Developer set items to work

Topic-3: how the chosen work can be done?

·       Developer plans the work, create an increment that meet the definition of done.

·       Make product backlog items into smaller work items.

·       How will be done is solely responsible to the developer

·       Sprint backlog = product backlog items selected + sprint plan for delivery

·       Sprint planning max 8 hours for a month sprint.

·       For shorter sprint, event is shorter

 

Daily Scrum:

·       Inspect progress toward goal

·       15 minutes event for the developer happen in the same time and same place.

·       Product owner and scrum master participate as developer

·       Developer selects technique and structure they want

·       Create focus and do self-management

·       Daily scrum improve communication, identify impediment and take quick decision if require.

 

Sprint Review:

·       Inspect outcome of the sprint

·       Scrum team present the result to stakeholder

·       Scrum team and stakeholder review what was completed

·       Maximum 4-hour timebox for a month sprint

 

Sprint Retrospective:

·       Increase quality and effectiveness

·       It discusses last exercise such as what went well, what can be adopted, what problem encountered and how it has resolved.

·       It concludes the sprint. Maximum 3 hour for a month sprint.

 

Scrum artifact:

·       It represents work or value.

·       It is designed to maximized the information.

o   For product backlogs, it is product goal

o   For spring backlogs, it is sprint goal

o   For increment, it is definition of done

 

Product backlogs

·       It is an order list. What need to be done for the product.

·       It is single source for the scrum team.

·       Developer is responsible for sizing of the product backlogs.

Commitment: Product goal

·       A product is vehicle to deliver value.

·       It has clear boundary, stakeholder and customer

 

Sprint backlogs:

Why: sprint backlogs are composed of spring goal.

What: product backlog item selects for sprint backlog

How: actionable plan to delivery the items

Commitment: sprint goal.

·       A single objective for the sprint

 

Increments:

·       It is stepping stone towards product goal.

·       Multiple increment may be created within the same sprint.

·       Total/sum increment are present in the sprint review.

·       We cannot say increment until it meets definition of done.

·       Increment may be delivered prior to end of sprint

Commitment: Definition of Done

·       It is formal description of increment when it meets the product quality

·       When product backlogs item meets the Definition of Done, then an increment born.

·       If the product backlogs item does not meet the definition of done, item will not be release in the sprint review. Instead, item will move to product backlogs for future consideration.