Wednesday, October 26, 2022

UserStory - Efforts Mandays Mapping

 1     Story Point  = <half day

2     Story Points = 1/2 day
2     Story Points = 1-3 days
5     Story Points = 3-6 days
8     Story Points = 2 Weeks
13     Story Points = Needs to be broken Down

Tuesday, October 25, 2022

Jira Query Language - JQL Query Examples

https://stackoverflow.com/questions/28459739/how-do-i-order-tickets-by-ticket-name-and-ticket-number-in-jira

"order by key asc"

  1. project = PRJ AND type = Epic AND labels in (APP123) AND summary ~ "AAC*"
  2. project = PRJ AND type = Bug AND reporter in (karan.kaw)
  3. project = PRJ AND assignee in (currentUser()) ORDER BY status
  4. project = PRJ AND reporter in (karan.kaw) ORDER BY status
  5. project = PRJ AND assignee in (currentUser()) AND status != Done ORDER BY key asc
  6. project = PRJ AND assignee in (currentUser()) AND status = "In Progress" ORDER BY status
For #1 - summary ~  "AAC*"  means - summary of Jira having text as "AAC" 
~ means Fuzzy Search

Wednesday, July 20, 2022

Ansible Tutorial -Walkthrough

 =====================================================================

https://stackoverflow.com/questions/2953081/how-can-i-write-a-heredoc-to-a-file-in-bash-script

https://www.tecmint.com/use-heredoc-in-shell-scripting/

cat << EOF > Filename.txt

---

---

---

EOF


tee abc.txt << EOF


- name: Testing Ansible

  hosts: localhost

  tasks:

  - name: Echo Message

    debug: msg="Ansible is working"

=====================================================================

https://stackoverflow.com/questions/64723019/what-is-difference-between-running-the-commands-ansible-and-ansible-playbook/64723156#64723156


Ansible scripts are called playbooks.


By definition


A playbook is a list of plays. A play is minimally a mapping between a set of hosts selected by a host specifier (usually chosen by groups but sometimes by hostname globs) and the tasks which run on those hosts to define the role that those systems will perform. There can be one or many plays in a playbook.


https://docs.ansible.com/ansible/latest/reference_appendices/glossary.html#term-plays


Then, you execute your playbooks with the command ansible-playbook, for example this command execute the playbook test.yml on all servers in your inventory file:


ansible-playbook test.yml -i inventory all

with ansible command you can execute just a tasks against your servers, for example this command execute a task with the module ping on all servers in your inventory file:


ansible -m ping -i inventory all

Then the difference is with ansible-playbook you can execute a playbook with a lot of tasks and with ansible you just can execute a task.


Welcome to ansible world. Red Hat offers an introductory course of ansible you can take it, It'll help you a lot.


https://www.redhat.com/en/services/training/do007-ansible-essentials-simplicity-automation-technical-overview


=====================================================================



https://geekflare.com/ansible-installation-windows/


ansible-playbook TestAnsible1.yml

ansible-playbook TestAnsible1.yml --connection=local



https://www.tutorialworks.com/ansible-run-playbook/#see-an-example-playbook

ansible-playbook -i hosts --extra-vars "person=Dave" site.yml


=====================================================================

Ansible : Install - CYGWIN

 How to install Ansible on Windows? (geekflare.com)

Tuesday, July 5, 2022

SSM - How to setup Session Manager of Systems Manager AWS

https://www.youtube.com/watch?v=-ASMtZBrx-k - Follow this  - Just 2 Steps 

1) Install Agent on EC2 as per their OS

2) Attach SSMIAMRole to EC2

https://docs.aws.amazon.com/systems-manager/latest/userguide/ssm-agent-get-version.html


yum info amazon-ssm-agent

apt list amazon-ssm-agent


https://docs.aws.amazon.com/systems-manager/latest/userguide/agent-install-ubuntu-64-snap.html

sudo snap list amazon-ssm-agent

snap list

sudo snap services amazon-ssm-agent

============


AWS SSM Session Manager for Shell Access to EC2 Instances | Temporary SSH Credentials | Security

============

Friday, June 24, 2022

Tomcat , J2EE Web app inside Container : DOCKER

 Deploying Your First Web App to Tomcat on Docker (softwareyoga.com)

softwareyoga/docker-tomcat-tutorial: A basic tutorial on running a web app on Tomcat using Docker (github.com)

Deploying Your First Web App to Tomcat on Docker | Cprime

https://hub.docker.com/_/tomcat


#FROM tomcat:8.0-alpine
#FROM tomcat:jre8-openjdk FROM tomcat:9.0.8-jre8-alpine ADD target/*.war /usr/local/tomcat/webapps/ EXPOSE 8080 CMD ["catalina.sh", "run"]


docker run -p 8080:8080 -it --rm --name oms-monolith oms
docker image ls 
docker container ls -a

RUN vs CMD vs ENTRYPOINT : DOCKER

https://awstip.com/docker-run-vs-cmd-vs-entrypoint-78ca2e5472bd


The three Dockerfile instructions RUN , CMD and ENTRYPOINT look similar and can easily cause confusions. Let’s discuss their differences in this article.

RUN vs CMD vs ENTRYPOINT

  • RUN executes commands and creates new image layers.
  • CMD sets the command and its parameters to be executed by default after the container is started. However CMD can be replaced by docker run command line parameters.
  • ENTRYPOINT configures the command to run when the container starts, similar to CMD from a functionality perspective.

Shell Format vs Exec Format

We can specify the command to be run by RUN, CMD and ENTRYPOINT in two ways: Shell format and Exec format, which have subtle differences in usage.

Shell Format

Shell format has the following form:

<instruction> <command>

For example:

RUN apt-get install python3CMD echo "Hello world"ENTRYPOINT echo "Hello world"

When the command is executed, the bottom layer of the shell format will call /bin/sh -c <command>. When you run commands in Shell format, the environment variable that defined in ENV command will be inherited.

ENV name Cloud ManENTRYPOINT echo "Hello, $name"# Output
Hello, Cloud Man

Exec Format

Exec format has the following form:

<instruction> ["executable", "param1", "param2", ...]

For example:

RUN ["apt-get", "install", "python3"]CMD ["/bin/echo", "Hello world"]ENTRYPOINT ["/bin/echo", "Hello world"]

When the command is executed, <command> will be called directly and will not be parsed by the shell. The environment variable that defined in ENV will not be passed as well.

ENV name Cloud ManENTRYPOINT ["/bin/echo", "Hello, $name"]# Output
Hello, $name

The Exec format is recommended for CMD and ENTRYPOINT because the instructions are more readable and easier to understand. RUN then both formats are fine.

RUN

The RUN command is typically used to install applications and software packages.

RUN executes the command on top of the current image, and by creating a new image layer. Dockerfile often contains multiple RUN instructions.

CMD

The CMD directive allows user to specify the default command executed by the container. This command runs when the container starts and no other command is specified for docker run .

  1. If docker run specifies another command, the default command specified by CMD will be ignored.
  2. If there are multiple CMD instructions in the Dockerfile, only the last CMD is valid.

CMD has three formats:

  1. Exec format: CMD [“executable”,”param1",”param2"]
  2. CMD [“param1”, ”param2"], this format is used in combination of ENTRYPOINT , to provide extra parameters
  3. Shell format: CMD command param1 param2

Exec format is recommended as it provides better readbility.

ENTRYPOINT

The ENTRYPOINT directive allows the container to run as an application or service.

ENTRYPOINT looks similar to CMD in that both specify the command to execute and its parameters. The difference is that ENTRYPOINT will not be ignored and will be executed, even if other commands are specified when running docker run.

ENTRYPOINT has two formats:

  1. Exec format: ENTRYPOINT [“executable”, “param1”, “param2”] This is the recommended format for ENTRYPOINT.
  2. Shell format: ENTRYPOINT command param1 param2

The parameters in ENTRYPOINT are always used, while the extra parameters of CMD can be dynamically replaced when the container starts. For example:

ENTRYPOINT ["/bin/echo", "Hello"]CMD ["world"]# Output
Hello world

Note the shell format of ENTRYPOINT ignores any arguments provided by CMD or docker run.

FROM busyboxENTRYPOINT echo helloCMD world# Output
hello

Conclusion

  1. Use the RUN command to install applications and packages, and build images.
  2. If the purpose of the Docker image is to run an application or service, such as running a MySQL, the ENTRYPOINT command in the Exec format should be used in preference. CMD can provide additional default parameters for ENTRYPOINT, and the default parameters can be replaced by the docker run command line.
  3. If you want to set the default startup command for the container, you can use the CMD command. Users can override this default command in the docker run command line.

Wednesday, June 22, 2022

AWS ASSUMEROLE

 Assume an IAM role using the AWS CLI (amazon.com)

Authenticating to AWS with Environment Variables | by Yevgeniy Brikman | Gruntwork

amazon web services - bash script for AWS assume-role - Stack Overflow


aws sts get-caller-identity

aws sts assume-role --role-arn "arn:aws:iam::123456789012:role/example-role" --role-session-name AWSCLI-Session

export AWS_ACCESS_KEY_ID=RoleAccessKeyID export AWS_SECRET_ACCESS_KEY=RoleSecretKey export AWS_SESSION_TOKEN=RoleSessionToken

aws sts get-caller-identity

unset AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN aws sts get-caller-identity

-------------------------------------------------------------------------------

Next, you call aws sts assume-role, passing it the ARN of the IAM Role you want to assume, plus a “role session name” that can be used to tell who is assuming the IAM Role and why (as the same IAM Role may be assumed by may different users):

aws sts assume-role \
--role-arn arn:aws:iam::123456789012:role/dev-full-access \
--role-session-name username@company.com

This will return a blob of JSON that contains Temporary Access Keys:

{
"Credentials": {
"SecretAccessKey": "secret-access-key",
"SessionToken": "temporary-session-token",
"Expiration": "expiration-date-time",
"AccessKeyId": "access-key-id"
}
}

You must now set these Temporary Access Keys as environment variables, overriding the old environment variables:

export AWS_ACCESS_KEY_ID=<Access-key-from-output>
export AWS_SECRET_ACCESS_KEY=<Secret-access-key-from-output>
export AWS_SESSION_TOKEN=<Session-Token-from-output>

Why do I have to explicitely define labels multiple times? Kubernetes

 kubernetes - Why do I have to explicitely define labels multiple times? - Server Fault

DOCKERFILE DOCKER Commands

 Docker RUN vs CMD vs ENTRYPOINT (codewithyury.com)

MAVEN - BOM - Bill of Materials

 Using Maven's Bill of Materials (BOM) (reflectoring.io)

4 kinds of Service in K8 - ClusterIP, NodePort, LoadBalancer and ExternalName

 Kubernetes — Service Types Overview | by Ashish Patel | DevOps Mojo | Medium

Wednesday, April 27, 2022

SSM - Session Manager - System - SSM Port Forwarding, Bastionless

BastionLess VM ,  VM is in private Subnet with private IP with access to NAT gateway

NAT Gateway should have a route to Internet G/W



  1. Verify that SSM Agent is installed on the instance.
  2. Create an AWS Identity and Access Management (IAM) instance profile for Systems Manager. You can create a new role, or add the needed permissions to an existing role.
  3. Attach the IAM role to your private EC2 instance.
  4. Make sure on respective Bastionless VM, you can reach following VPC Endpoints -  curl 


Make sure that you have specified all VPC endpoint for SSM:

  • com.amazonaws.region.ssm: The endpoint for the Systems Manager service.
  • com.amazonaws.region.ec2messages: Systems Manager uses this endpoint to make calls from SSM Agent to the Systems Manager service.
  • com.amazonaws.region.ec2: If you're using Systems Manager to create VSS-enabled snapshots, you need to ensure that you have an endpoint to the EC2 service. Without the EC2 endpoint defined, a call to enumerate attached EBS volumes fails, which causes the Systems Manager command to fail. - com.amazonaws.region.ssmmessages: This endpoint is required only if you are connecting to your instances through a secure data channel using Session Manager. For more information, see AWS Systems Manager Session Manager.

Thursday, March 31, 2022

R-LANE , Lift/Shift, Re-platform, Modernization

 



















"













Migration" - Moving Enterprise Workload from On-Premise DataCentre to Public/Private Clouds

"Modernize" - Refactor Monolith Codebase and Expose APIS on top of that new refactored code deployed in cloud

"Build Native" - From Zero - Re-design - Microservices.



https://www.youtube.com/watch?v=yWByEVB0VJE&list=WL&index=57

----------------------------------------------------------------------

6R's - https://www.youtube.com/watch?v=AmyuEIux6xs&list=WL&index=56


Rehost     - IAAS - Lift and Shift - Forklift - Very Early  - Low Resistance Migration Strategy

Replatform - PAAS - Elastic BeanStalk - Minor changes

Repurchase - Ending License - Properitiary - CRM 

Refactor   - Re-architect - Recoding - Decompose Monolith

Retain     - Not Ready to migrate - legacy/critical - 

Retire     - Not needed - Turn off


----------------------------------------------------------------------

https://www.youtube.com/watch?v=68z4XZTpSIA&list=WL&index=62


Assess

Migrate

Optimise

Secure and Manage


VFunction

https://www.youtube.com/watch?v=y1Jt3d3C0ZU


  • JVM - "Dynamic and Static Analysis"

Data Collection and Learning  -> VFunction Agents -  Analyse JVM -> Coverage 

Identify Userflows, Boundaries of Services

Algorithms - Entrpoint of Services


  • "Interactive Platform"

Architect gets an interactive platform which is result of Dynamic/Static Analysis done by agents

RIch info about Services and allows Architect to merge/Split Services

System Creates based on Architect's input - Specification of Service which is a JSON File


  • "Code Generation"

JSON Entrypoint, Parameters, Classes +  Scans Orginal Code  => Automation Engine

creates a new project with well defined APIs 

Tuesday, January 25, 2022

GoLang, Go - Links

https://www.youtube.com/watch?v=yyUHQIec83I

https://www.youtube.com/watch?v=YS4e4q9oBaU

https://www.youtube.com/watch?v=1NF2LtWbA1g


https://go.dev/play/

https://go.dev/tour/


https://go.dev/docs

https://pkg.go.dev


https://gobyexample.com/

https://golangbot.com/

https://www.golangprograms.com/


EKCTL - Command Sheet - Cheat Code

https://eksctl.io/usage/unowned-clusters/


  • Create:
    • eksctl create nodegroup (see note below)
    • eksctl create fargateprofile
    • eksctl create iamserviceaccount
    • eksctl create iamidentitymapping
  • Get:
    • eksctl get clusters/cluster
    • eksctl get nodegroup
    • eksctl get labels
  • Delete:
    • eksctl delete cluster
    • eksctl delete nodegroup
    • eksctl delete fargateprofile
    • eksctl delete iamserviceaccount
    • eksctl delete iamidentitymapping
  • Upgrade:
    • eksctl upgrade cluster
    • eksctl upgrade nodegroup
  • Set/Unset:
    • eksctl set labels
    • eksctl unset labels
  • Scale:
    • eksctl scale nodegroup
  • Drain:
    • eksctl drain nodegroup
  • Enable:
    • eksctl enable profile
    • eksctl enable repo
  • Utils:
    • eksctl utils associate-iam-oidc-provider
    • eksctl utils describe-stacks
    • eksctl utils install-vpc-controllers
    • eksctl utils nodegroup-health
    • eksctl utils set-public-access-cidrs
    • eksctl utils update-cluster-endpoints
    • eksctl utils update-cluster-logging
    • eksctl utils write-kubeconfig
    • eksctl utils update-coredns
    • eksctl utils update-aws-node
    • eksctl utils update-kube-proxy



Azure - Pipeline - Add Approver for Stage

https://learn.microsoft.com/en-us/azure/devops/pipelines/process/approvals?view=azure-devops&tabs=check-pass