View Code? Open in Web Editor
NEW
This project forked from kkgo-software-engineering/devops
Go 44.22%
HCL 50.60%
Dockerfile 5.18%
devops-learning's Introduction
- single stage build Docker image
- go to directory
go-simple-single-stage-build
- try to run
docker build -t go-simple-single-stage:latest .
- check image size
docker images go-simple-single-stage
- try to run container
docker run go-simple-single-stage
- multi stage build Docker image
- go to directory
go-simple-multi-stage-build
- try to run
docker build -t go-simple-multi-stage:latest .
- check image size
docker images go-simple-multi-stage
- try to run container
docker run go-simple-multi-stage
Docker-compose test sandbox
- go to directory
devops-go-example
- explore application
- to run test
docker-compose -f docker-compose.test.yml up --build --abort-on-container-exit --exit-code-from it_tests
- to tear down
docker-compose -f docker-compose.test.yml down
- use AWS AMI from Bitnami
- make sure to assign public IPv4
- get password by
sudo cat /home/bitnami/bitnami_credentials
- login to web console via EC2 public IPv4
- go to
terraform-iac
- do
brew install awscli
- run
aws configure
- run
terraform plan
- run
terraform apply
- let explore AWS Web Console
- go to cloud https://www.terraform.io
- go to AWS Web Console >
Security credentials
- config secret
AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
as sensitive environment variable
- do provisioning
- Install Kubectl command (
brew install kubectl
)
- Install AWS CLI
- run
aws configure
, if not setting yet.
- run
aws eks update-kubeconfig --region ap-southeast-1 --name eks-devops-cluster
- try with
kubectl get node
- make sure Kubernetes Cluster is ready to use.
- run
kubectl create namespace argocd
- run
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
- forward port
kubectl port-forward svc/argocd-server -n argocd 8080:443
- get password
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo
devops-go-example
- check
.github/cicd.yml
- add remote repository
- push
- Config Github Action Secret
PAT
(Personel Access Token) and make sure SONAR_TOKEN
and SONAR_HOST_URL
was config.
devops-go-example
- check
.github/cicd.yml
- uncomment CD block
- add remote repository
- push