-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotes
More file actions
66 lines (58 loc) · 2.81 KB
/
Copy pathnotes
File metadata and controls
66 lines (58 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
DevSecOps pipeline
CI part
when a developer triggers the pull request or push code to repository.(Github workflows get trigger/ jenkins builds get trigers)
there are multiple jobs/ in Jenkins we have stages such as
1) Unit test/
2) Static code analysis ( Deprivated packages, undeclared variables are caught in static code analysis,function not invoked anywhere)
3)Once both the workflows/stages are completed then only the building of application stage get triggers.
4) Docker stage has multiple steps( Building of Docker image/ Scanning of Docker image by Trivy/ pushing the docker image to github container registry)
Note: Being as a Dev Secops engineer we cannot push the docker images to Docker registry (docker.io) or public registry we need to push it to Github Container registry ghcr.io/ Nexus / Jfrog)
5)Once the image is created it is updated in Kubernetes manifest fileswhich are placed in the Kubernetes folder or Deployment .yaml file.
note: Everytime when ever a new version of image is created it is updated in the particular section of deployment.
6)Once the Yaml is updated it is pushed to repository using shell script. This concludes the CI part.
CD part
Argo CD detects whenever the image tag is updated.
Argo CD directly deploys the image to the Kubernetes cluster.
.tsx - type script (front end application)
.jdk - java application
pre requestesites:
Node.Js v14 or higher & npm or yarn
to manage package dependencies related to the application we use npm.
npm download the dependencies from package.json # run npm ci
where as cmng to PIP uses requierments.txt file
so when ever we execute #npm run build npm comes to package.json file and checks for the keyword in package.json file and what ever the cmnd we provide in keyword it get executed.
npm --version
npm install
what happens when npm is installed?
if application is built on typescript we use a application called vite to run and build.
if application is built on java we use a application called maven/ gradle/ant to run and build.
so once if we run the vite build it saves everything in dist folder.
the build artifact is stored in dist directory. this will be provided by developer.
----------------------------------------
Github actions Yaml file
1) Name: CI/ CD or DevSecOps Pipeline
2) On:
push:
branch:[]
ignore files:[]
pull request:
branch:[]
3) Jobs:
test:
steps included in the job/ Github has most of the actions which perform the work.
static code analysis:
steps included in the job
build:
steps included in the job
--------------------------------------------
ex: of Trivy in github actions
name: Run trivy
users:
with:
image-ref:
format:'table'
exit code:'1'
ignore-unfixed: true
vuln-type: 'os,library'
secerity: 'critical,High'
note: For running Kubernetes cluster we need minimum of t2.medium.