Overview of CI/CD for startup
Overview of CI/CD for startup
Chen Xi hixichen@github
CI
Jenkins requires SRE team. Never a option for small startup.
Circle CI: ios/osx support, API integrated with AWS code deploy, ssh debug, docker support.
Github action: fully integrated with github, easy, free to small team.
Tekton: pipeline on k8s, nice future, under developing, requires ops work.
Github Action
- Mainly used for unit test: build & test
Note:
- Requires git permission to other private repos.
- Secrets are shared for org, requires better RBAC model.
CD
Requirements:
- Fully automated
- Can be triggered by event and manual
- Multiple steps for one stage: test,deploy and verify
- Multiple stages: dev, stable, staging(canary), production
- One config for all stage with env update only.
- Block/Approve model between stages
Why AWS code pipeline:
- Source: S3/Github public/private repo
- Build: aws codebuild
- mage: aws ECR
- Trigger: ecr new image or manual release
- Test: directly run or apply yaml for test
- Deployment: read yamls from source code
- Detect: check health via curl or yaml Job
CD for kubernetes:
- kustomize - Dynamic configurations in Kubernetes, Built in
kubectl -k
now!
~/myapp
├── base
│ ├── deployment.yaml
│ ├── kustomization.yaml
│ └── service.yaml
└── overlays
├── test
│ ├── dev.yaml
│ ├── integration.yaml
│ └── stress.yaml
├── development
│ ├── cpu_count.yaml
│ ├── kustomization.yaml
│ └── replica_count.yaml
└── production
├── cpu_count.yaml
├── kustomization.yaml
└── replica_count.yaml
Overview:
stage: dev
- build image
- publish imagae
- apply
- kubectl apply -k config/{ENVIRONMENT}
- use local deploy DB for test
stage: stable
- apply
- run integration test
- use single instance DB on AWS for test only.
stage: staging
- apply
- run integration test, perf test
- use multiple instance DB with backup on AWS.
- Try to simulate production env as much as you can.
stage: production
- release with shadown
- require manul approved process for pipeline.