├── topics
├── container
│ ├── helm
│ │ ├── advanced
│ │ │ ├── custom-resources
│ │ │ │ ├── Chart.yaml
│ │ │ │ ├── values.yaml
│ │ │ │ └── templates
│ │ │ │ │ ├── deployment.yaml
│ │ │ │ │ ├── service.yaml
│ │ │ │ │ ├── configmap.yaml
│ │ │ │ │ └── secret.yaml
│ │ │ └── multi-service-app
│ │ │ │ ├── templates
│ │ │ │ ├── _helpers.tpl
│ │ │ │ ├── web-deployment.yaml
│ │ │ │ └── db-deployment.yaml
│ │ │ │ ├── Chart.yaml
│ │ │ │ └── values.yaml
│ │ ├── basics
│ │ │ └── my-first-chart
│ │ │ │ ├── templates
│ │ │ │ ├── _helpers.tpl
│ │ │ │ ├── ingress.yaml
│ │ │ │ ├── service.yaml
│ │ │ │ └── deployment.yaml
│ │ │ │ ├── Chart.yaml
│ │ │ │ └── values.yaml
│ │ └── README.md
│ ├── kubernetes
│ │ ├── advanced
│ │ │ ├── configmap-secrets
│ │ │ │ ├── configmap.yaml
│ │ │ │ └── secret.yaml
│ │ │ ├── multi-container-pod
│ │ │ │ └── pod.yaml
│ │ │ ├── ingress
│ │ │ │ └── ingress.yaml
│ │ │ └── statefulsets
│ │ │ │ └── statefulset.yaml
│ │ ├── basics
│ │ │ ├── service.yaml
│ │ │ ├── pod.yaml
│ │ │ └── deployment.yaml
│ │ ├── example
│ │ │ ├── hpa-v2.yaml
│ │ │ └── deployment.yaml
│ │ └── README.md
│ ├── docker
│ │ ├── basics
│ │ │ ├── docker-compose.yml
│ │ │ └── Dockerfile
│ │ ├── advanced
│ │ │ ├── multi-stage-build
│ │ │ │ └── Dockerfile
│ │ │ ├── custom-networks
│ │ │ │ └── docker-compose.yml
│ │ │ └── multi-service-app
│ │ │ │ └── docker-compose.yml
│ │ ├── example
│ │ │ └── nodejs
│ │ │ │ ├── Dockerfile
│ │ │ │ └── docker-compose.yml
│ │ └── README.md
│ └── README.md
├── tools
│ ├── version-control
│ │ ├── README.md
│ │ └── git
│ │ │ ├── resources.md
│ │ │ └── README.md
│ ├── containerization
│ │ ├── docker
│ │ │ ├── resources.md
│ │ │ └── README.md
│ │ └── kubernetes
│ │ │ ├── resources.md
│ │ │ └── README.md
│ ├── ci-cd
│ │ ├── jenkins
│ │ │ ├── resources.md
│ │ │ └── README.md
│ │ └── github-actions
│ │ │ ├── resources.md
│ │ │ └── README.md
│ ├── infrastructure-as-code
│ │ ├── terraform
│ │ │ ├── resources.md
│ │ │ └── README.md
│ │ └── ansible
│ │ │ ├── resources.md
│ │ │ └── README.md
│ ├── monitoring-and-logging
│ │ ├── prometheus
│ │ │ ├── resources.md
│ │ │ └── README.md
│ │ └── grafana
│ │ │ ├── resources.md
│ │ │ └── README.md
│ └── README.md
├── version-control
│ ├── branching-strategy-example.md
│ ├── git-workflow-example.md
│ ├── mr-best-practices-example.md
│ └── README.md
├── ci-cd
│ ├── gitlab-ci
│ │ ├── .gitlab-ci.yml
│ │ └── README.md
│ ├── jenkins
│ │ ├── Jenkinsfile
│ │ └── README.md
│ ├── github-actions
│ │ ├── .github
│ │ │ └── workflows
│ │ │ │ └── ci.yml
│ │ └── README.md
│ ├── circleci
│ │ ├── .circleci
│ │ │ └── config.yml
│ │ └── README.md
│ └── README.md
├── certifications
│ ├── terraform-associate
│ │ ├── resources.md
│ │ └── README.md
│ ├── docker-certified-associate
│ │ ├── resources.md
│ │ └── README.md
│ ├── certified-kubernetes-administrator
│ │ ├── resources.md
│ │ └── README.md
│ ├── aws-certified-devops-engineer
│ │ ├── resources.md
│ │ └── README.md
│ └── README.md
├── monitoring
│ ├── tracing
│ │ ├── zipkin
│ │ │ ├── README.md
│ │ │ └── resources.md
│ │ └── jaeger
│ │ │ ├── resources.md
│ │ │ └── README.md
│ ├── logging
│ │ ├── fluentd
│ │ │ ├── resources.md
│ │ │ └── README.md
│ │ └── elastic-stack
│ │ │ ├── resources.md
│ │ │ └── README.md
│ ├── metrics
│ │ ├── grafana
│ │ │ ├── resources.md
│ │ │ └── README.md
│ │ └── prometheus
│ │ │ ├── resources.md
│ │ │ └── README.md
│ ├── alerting
│ │ ├── pagerduty
│ │ │ ├── resources.md
│ │ │ └── README.md
│ │ └── alertmanager
│ │ │ ├── resources.md
│ │ │ └── README.md
│ └── README.md
├── infrastructure
│ ├── configuration-management
│ │ ├── puppet
│ │ │ ├── resources.md
│ │ │ └── README.md
│ │ └── chef
│ │ │ ├── resources.md
│ │ │ └── README.md
│ ├── infrastructure-as-code
│ │ ├── Ansible
│ │ │ ├── resources.md
│ │ │ └── README.md
│ │ └── terraform
│ │ │ ├── resources.md
│ │ │ └── README.md
│ ├── provisioning
│ │ ├── packer
│ │ │ ├── resources.md
│ │ │ └── README.md
│ │ └── vagrant
│ │ │ ├── resources.md
│ │ │ └── README.md
│ └── README.md
├── cloud
│ ├── azure
│ │ ├── resources.md
│ │ └── README.md
│ ├── multi-cloud
│ │ ├── resources.md
│ │ └── README.md
│ ├── aws
│ │ ├── resources.md
│ │ └── README.md
│ ├── gcp
│ │ ├── resources.md
│ │ └── README.md
│ └── README.md
├── security
│ ├── trivy-example.md
│ ├── snyk-example.md
│ ├── owasp-zap-example.md
│ └── README.md
└── case-studies
│ └── README.md
├── 1734266460852.pdf
├── images
├── devops.png
├── devsec.png
└── devsecops-diagram.png
├── architecture
├── elk
│ └── elk-stack.jpg
└── prometheus
│ └── prometheus.png
├── LICENSE
├── .gitignore
└── README.md
/topics/container/helm/advanced/custom-resources/Chart.yaml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/topics/tools/version-control/README.md:
--------------------------------------------------------------------------------
1 | no content yet
2 |
--------------------------------------------------------------------------------
/topics/container/helm/advanced/custom-resources/values.yaml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/topics/container/helm/basics/my-first-chart/templates/_helpers.tpl:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/topics/container/helm/basics/my-first-chart/templates/ingress.yaml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/topics/container/helm/advanced/custom-resources/templates/deployment.yaml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/topics/container/helm/advanced/custom-resources/templates/service.yaml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/topics/container/helm/advanced/multi-service-app/templates/_helpers.tpl:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/1734266460852.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JawherKl/devops-guide/HEAD/1734266460852.pdf
--------------------------------------------------------------------------------
/images/devops.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JawherKl/devops-guide/HEAD/images/devops.png
--------------------------------------------------------------------------------
/images/devsec.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JawherKl/devops-guide/HEAD/images/devsec.png
--------------------------------------------------------------------------------
/images/devsecops-diagram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JawherKl/devops-guide/HEAD/images/devsecops-diagram.png
--------------------------------------------------------------------------------
/architecture/elk/elk-stack.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JawherKl/devops-guide/HEAD/architecture/elk/elk-stack.jpg
--------------------------------------------------------------------------------
/architecture/prometheus/prometheus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JawherKl/devops-guide/HEAD/architecture/prometheus/prometheus.png
--------------------------------------------------------------------------------
/topics/container/helm/basics/my-first-chart/Chart.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v2
2 | name: my-first-chart
3 | description: A simple Helm chart for a web application
4 | version: 0.1.0
5 | appVersion: "1.0"
--------------------------------------------------------------------------------
/topics/container/kubernetes/advanced/configmap-secrets/configmap.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: ConfigMap
3 | metadata:
4 | name: app-config
5 | data:
6 | APP_COLOR: blue
7 | APP_ENV: prod
--------------------------------------------------------------------------------
/topics/container/helm/advanced/multi-service-app/Chart.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v2
2 | name: multi-service-app
3 | description: A Helm chart for a multi-service application
4 | version: 0.1.0
5 | appVersion: "1.0"
--------------------------------------------------------------------------------
/topics/container/docker/basics/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3.8'
2 | services:
3 | web:
4 | image: my-python-app
5 | build: .
6 | ports:
7 | - "4000:80"
8 | environment:
9 | - NAME=DevOpsGuide
--------------------------------------------------------------------------------
/topics/container/helm/basics/my-first-chart/values.yaml:
--------------------------------------------------------------------------------
1 | replicaCount: 1
2 |
3 | image:
4 | repository: nginx
5 | tag: "1.21.0"
6 | pullPolicy: IfNotPresent
7 |
8 | service:
9 | type: ClusterIP
10 | port: 80
--------------------------------------------------------------------------------
/topics/container/helm/advanced/custom-resources/templates/configmap.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: ConfigMap
3 | metadata:
4 | name: {{ .Release.Name }}
5 | data:
6 | app.conf: |
7 | database.host={{ .Release.Name }}-db
8 | database.port=5432
9 |
--------------------------------------------------------------------------------
/topics/container/kubernetes/advanced/configmap-secrets/secret.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Secret
3 | metadata:
4 | name: app-secret
5 | type: Opaque
6 | data:
7 | DB_USER: dXNlcg== # base64 encoded "user"
8 | DB_PASSWORD: cGFzc3dvcmQ= # base64 encoded "password"
--------------------------------------------------------------------------------
/topics/container/kubernetes/basics/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: nginx-service
5 | spec:
6 | selector:
7 | app: nginx
8 | ports:
9 | - protocol: TCP
10 | port: 80
11 | targetPort: 80
12 | type: LoadBalancer
--------------------------------------------------------------------------------
/topics/container/kubernetes/basics/pod.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Pod
3 | metadata:
4 | name: nginx-pod
5 | labels:
6 | app: nginx
7 | spec:
8 | containers:
9 | - name: nginx-container
10 | image: nginx:latest
11 | ports:
12 | - containerPort: 80
--------------------------------------------------------------------------------
/topics/version-control/branching-strategy-example.md:
--------------------------------------------------------------------------------
1 | # Branching Strategy Example
2 |
3 | ## Feature Branching
4 | 1. Create a branch for each new feature: `git checkout -b feature-branch`
5 | 2. Merge the feature branch into the main branch after completion: `git merge feature-branch`
6 |
--------------------------------------------------------------------------------
/topics/container/helm/advanced/custom-resources/templates/secret.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Secret
3 | metadata:
4 | name: {{ .Release.Name }}
5 | type: Opaque
6 | data:
7 | username: {{ .Values.db.env.POSTGRES_USER | b64enc | quote }}
8 | password: {{ .Values.db.env.POSTGRES_PASSWORD | b64enc | quote }}
--------------------------------------------------------------------------------
/topics/ci-cd/gitlab-ci/.gitlab-ci.yml:
--------------------------------------------------------------------------------
1 | stages:
2 | - build
3 | - test
4 | - deploy
5 |
6 | build:
7 | stage: build
8 | script:
9 | - npm install
10 |
11 | test:
12 | stage: test
13 | script:
14 | - npm test
15 |
16 | deploy:
17 | stage: deploy
18 | script:
19 | - npm run deploy
20 |
--------------------------------------------------------------------------------
/topics/container/helm/basics/my-first-chart/templates/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: {{ .Release.Name }}
5 | spec:
6 | type: {{ .Values.service.type }}
7 | ports:
8 | - port: {{ .Values.service.port }}
9 | targetPort: 80
10 | selector:
11 | app: {{ .Release.Name }}
--------------------------------------------------------------------------------
/topics/version-control/git-workflow-example.md:
--------------------------------------------------------------------------------
1 | # Git Workflow Example
2 |
3 | ## Feature Branch Workflow
4 | 1. Create a new branch: `git checkout -b feature-branch`
5 | 2. Make changes and commit: `git commit -m "Add feature"`
6 | 3. Push the branch: `git push origin feature-branch`
7 | 4. Create a pull request and merge after approval.
8 |
--------------------------------------------------------------------------------
/topics/container/docker/advanced/multi-stage-build/Dockerfile:
--------------------------------------------------------------------------------
1 | # Stage 1: Build
2 | FROM node:16 as build
3 | WORKDIR /app
4 | COPY package.json yarn.lock ./
5 | RUN yarn install
6 | COPY . .
7 | RUN yarn build
8 |
9 | # Stage 2: Run
10 | FROM nginx:alpine
11 | COPY --from=build /app/build /usr/share/nginx/html
12 | EXPOSE 80
13 | CMD ["nginx", "-g", "daemon off;"]
--------------------------------------------------------------------------------
/topics/container/docker/example/nodejs/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM node:16
2 |
3 | WORKDIR /app
4 |
5 | COPY package.json yarn.lock ./
6 | RUN yarn install
7 |
8 | COPY . .
9 |
10 | ENV NODE_ENV=production
11 | ENV PORT=3000
12 |
13 | EXPOSE 3000
14 |
15 | HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
16 | CMD curl -f http://localhost:3000/health || exit 1
17 |
18 | CMD ["node", "index.js"]
--------------------------------------------------------------------------------
/topics/container/kubernetes/basics/deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | name: nginx-deployment
5 | spec:
6 | replicas: 3
7 | selector:
8 | matchLabels:
9 | app: nginx
10 | template:
11 | metadata:
12 | labels:
13 | app: nginx
14 | spec:
15 | containers:
16 | - name: nginx
17 | image: nginx:latest
18 | ports:
19 | - containerPort: 80
--------------------------------------------------------------------------------
/topics/version-control/mr-best-practices-example.md:
--------------------------------------------------------------------------------
1 | # Merge Request Best Practices Example
2 |
3 | ## Descriptive Titles and Descriptions
4 | - Use clear and descriptive titles for merge requests.
5 | - Provide detailed descriptions of changes made.
6 |
7 | ## Peer Reviews
8 | - Request reviews from team members.
9 | - Address feedback and make necessary changes.
10 |
11 | ## Automated Testing
12 | - Ensure all tests pass before merging.
13 |
--------------------------------------------------------------------------------
/topics/certifications/terraform-associate/resources.md:
--------------------------------------------------------------------------------
1 | # Study Resources for Terraform Associate
2 |
3 | ## Official Resources
4 | - [Terraform Documentation](https://www.terraform.io/docs/)
5 | - [HashiCorp Learn](https://learn.hashicorp.com/)
6 |
7 | ## Books
8 | - "Terraform Up & Running" by Yevgeniy Brikman
9 |
10 | ## Practice Exams
11 | - Whizlabs
12 | - Tutorials Dojo
13 |
14 | ## Online Courses
15 | - A Cloud Guru
16 | - Linux Academy
17 |
--------------------------------------------------------------------------------
/topics/tools/containerization/docker/resources.md:
--------------------------------------------------------------------------------
1 | # Learning Resources for Docker
2 |
3 | ## Official Resources
4 | - [Docker Documentation](https://docs.docker.com/)
5 | - [Docker Hub](https://hub.docker.com/)
6 |
7 | ## Books
8 | - "Docker Deep Dive" by Nigel Poulton
9 |
10 | ## Online Courses
11 | - [Docker Mastery (Udemy)](https://www.udemy.com/course/docker-mastery/)
12 | - [Learn Docker (Codecademy)](https://www.codecademy.com/learn/learn-docker)
13 |
--------------------------------------------------------------------------------
/topics/container/kubernetes/example/hpa-v2.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: autoscaling/v2beta2
2 | kind: HorizontalPodAutoscaler
3 | metadata:
4 | name: my-app-hpa
5 | spec:
6 | scaleTargetRef:
7 | apiVersion: apps/v1
8 | kind: Deployment
9 | name: my-app
10 | minReplicas: 1
11 | maxReplicas: 10
12 | metrics:
13 | - type: Resource
14 | resource:
15 | name: cpu
16 | target:
17 | type: Utilization
18 | averageUtilization: 50
--------------------------------------------------------------------------------
/topics/certifications/docker-certified-associate/resources.md:
--------------------------------------------------------------------------------
1 | # Study Resources for Docker Certified Associate
2 |
3 | ## Official Resources
4 | - [Docker Documentation](https://docs.docker.com/)
5 | - [Docker Training](https://www.docker.com/products/docker-certified-training)
6 |
7 | ## Books
8 | - "Docker Deep Dive" by Nigel Poulton
9 |
10 | ## Practice Exams
11 | - Whizlabs
12 | - Tutorials Dojo
13 |
14 | ## Online Courses
15 | - A Cloud Guru
16 | - Linux Academy
17 |
--------------------------------------------------------------------------------
/topics/ci-cd/jenkins/Jenkinsfile:
--------------------------------------------------------------------------------
1 | pipeline {
2 | agent any
3 |
4 | stages {
5 | stage('Build') {
6 | steps {
7 | sh 'npm install'
8 | }
9 | }
10 | stage('Test') {
11 | steps {
12 | sh 'npm test'
13 | }
14 | }
15 | stage('Deploy') {
16 | steps {
17 | sh 'npm run deploy'
18 | }
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/topics/tools/version-control/git/resources.md:
--------------------------------------------------------------------------------
1 | # Learning Resources for Git
2 |
3 | ## Official Resources
4 | - [Git Documentation](https://git-scm.com/doc)
5 | - [GitHub Guides](https://guides.github.com/)
6 |
7 | ## Books
8 | - "Pro Git" by Scott Chacon and Ben Straub
9 |
10 | ## Online Courses
11 | - [Git and GitHub for Beginners (Udemy)](https://www.udemy.com/course/git-and-github-bootcamp/)
12 | - [Learn Git (Codecademy)](https://www.codecademy.com/learn/learn-git)
13 |
--------------------------------------------------------------------------------
/topics/certifications/certified-kubernetes-administrator/resources.md:
--------------------------------------------------------------------------------
1 | # Study Resources for Certified Kubernetes Administrator (CKA)
2 |
3 | ## Official Resources
4 | - [Kubernetes Documentation](https://kubernetes.io/docs/home/)
5 | - [CNCF CKA Curriculum](https://github.com/cncf/curriculum)
6 |
7 | ## Books
8 | - "Kubernetes in Action" by Marko Luksa
9 |
10 | ## Practice Labs
11 | - Killer.sh
12 | - Katacoda
13 |
14 | ## Online Courses
15 | - KodeKloud
16 | - Linux Academy
17 |
--------------------------------------------------------------------------------
/topics/certifications/aws-certified-devops-engineer/resources.md:
--------------------------------------------------------------------------------
1 | # Study Resources for AWS Certified DevOps Engineer - Professional
2 |
3 | ## Official Resources
4 | - [AWS Training](https://aws.amazon.com/training/)
5 | - [AWS Documentation](https://docs.aws.amazon.com/)
6 |
7 | ## Books
8 | - "AWS Certified DevOps Engineer - Professional Exam Guide" by Asif Khan
9 |
10 | ## Practice Exams
11 | - Whizlabs
12 | - Tutorials Dojo
13 |
14 | ## Online Courses
15 | - A Cloud Guru
16 | - Linux Academy
17 |
--------------------------------------------------------------------------------
/topics/container/helm/advanced/multi-service-app/values.yaml:
--------------------------------------------------------------------------------
1 | web:
2 | replicaCount: 2
3 | image:
4 | repository: nginx
5 | tag: "1.21.0"
6 | pullPolicy: IfNotPresent
7 | service:
8 | type: ClusterIP
9 | port: 80
10 |
11 | db:
12 | image:
13 | repository: postgres
14 | tag: "13"
15 | pullPolicy: IfNotPresent
16 | service:
17 | type: ClusterIP
18 | port: 5432
19 | env:
20 | POSTGRES_USER: admin
21 | POSTGRES_PASSWORD: password
22 | POSTGRES_DB: mydb
--------------------------------------------------------------------------------
/topics/container/kubernetes/advanced/multi-container-pod/pod.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Pod
3 | metadata:
4 | name: multi-container-pod
5 | spec:
6 | containers:
7 | - name: app-container
8 | image: my-app:latest
9 | ports:
10 | - containerPort: 8080
11 | - name: log-sidecar
12 | image: busybox:latest
13 | command: ["sh", "-c", "tail -f /var/log/app.log"]
14 | volumeMounts:
15 | - name: log-volume
16 | mountPath: /var/log
17 | volumes:
18 | - name: log-volume
19 | emptyDir: {}
--------------------------------------------------------------------------------
/topics/tools/ci-cd/jenkins/resources.md:
--------------------------------------------------------------------------------
1 | # Learning Resources for Jenkins
2 |
3 | ## Official Resources
4 | - [Jenkins Documentation](https://www.jenkins.io/doc/)
5 | - [Jenkins Plugins](https://plugins.jenkins.io/)
6 |
7 | ## Books
8 | - "Jenkins 2: Up and Running" by Brent Laster
9 |
10 | ## Online Courses
11 | - [Jenkins Bootcamp (Udemy)](https://www.udemy.com/course/jenkins-from-zero-to-hero/)
12 | - [Continuous Integration with Jenkins (Pluralsight)](https://www.pluralsight.com/courses/jenkins-continuous-integration)
13 |
--------------------------------------------------------------------------------
/topics/tools/infrastructure-as-code/terraform/resources.md:
--------------------------------------------------------------------------------
1 | # Learning Resources for Terraform
2 |
3 | ## Official Resources
4 | - [Terraform Documentation](https://www.terraform.io/docs/)
5 | - [Terraform Registry](https://registry.terraform.io/)
6 |
7 | ## Books
8 | - "Terraform Up & Running" by Yevgeniy Brikman
9 |
10 | ## Online Courses
11 | - [Terraform for Beginners (Udemy)](https://www.udemy.com/course/terraform-beginner-to-advanced/)
12 | - [Learn Terraform (HashiCorp Learn)](https://learn.hashicorp.com/terraform)
13 |
--------------------------------------------------------------------------------
/topics/ci-cd/github-actions/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: CI Pipeline
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 |
8 | jobs:
9 | build:
10 | runs-on: ubuntu-latest
11 |
12 | steps:
13 | - name: Checkout code
14 | uses: actions/checkout@v2
15 |
16 | - name: Set up Node.js
17 | uses: actions/setup-node@v2
18 | with:
19 | node-version: '14'
20 |
21 | - name: Install dependencies
22 | run: npm install
23 |
24 | - name: Run tests
25 | run: npm test
26 |
--------------------------------------------------------------------------------
/topics/ci-cd/circleci/.circleci/config.yml:
--------------------------------------------------------------------------------
1 | version: 2.1
2 |
3 | jobs:
4 | build:
5 | docker:
6 | - image: circleci/node:14
7 | steps:
8 | - checkout
9 | - run:
10 | name: Install dependencies
11 | command: npm install
12 | - run:
13 | name: Run tests
14 | command: npm test
15 | - run:
16 | name: Deploy application
17 | command: npm run deploy
18 |
19 | workflows:
20 | version: 2
21 | build_and_deploy:
22 | jobs:
23 | - build
24 |
--------------------------------------------------------------------------------
/topics/tools/monitoring-and-logging/prometheus/resources.md:
--------------------------------------------------------------------------------
1 | # Learning Resources for Prometheus
2 |
3 | ## Official Resources
4 | - [Prometheus Documentation](https://prometheus.io/docs/)
5 | - [Prometheus GitHub](https://github.com/prometheus/prometheus)
6 |
7 | ## Books
8 | - "Monitoring with Prometheus" by James Turnbull
9 |
10 | ## Online Courses
11 | - [Prometheus and Grafana (Udemy)](https://www.udemy.com/course/prometheus-and-grafana/)
12 | - [Learn Prometheus (Pluralsight)](https://www.pluralsight.com/courses/prometheus-getting-started)
13 |
--------------------------------------------------------------------------------
/topics/container/docker/advanced/custom-networks/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3.8'
2 | services:
3 | web:
4 | image: my-web-app
5 | build: ./web
6 | ports:
7 | - "5000:5000"
8 | networks:
9 | - frontend
10 |
11 | api:
12 | image: my-api
13 | build: ./api
14 | networks:
15 | - backend
16 |
17 | db:
18 | image: postgres:13
19 | environment:
20 | POSTGRES_USER: user
21 | POSTGRES_PASSWORD: password
22 | POSTGRES_DB: mydb
23 | networks:
24 | - backend
25 |
26 | networks:
27 | frontend:
28 | backend:
--------------------------------------------------------------------------------
/topics/container/docker/advanced/multi-service-app/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3.8'
2 | services:
3 | web:
4 | image: my-web-app
5 | build: ./web
6 | ports:
7 | - "5000:5000"
8 | depends_on:
9 | - redis
10 | - db
11 |
12 | redis:
13 | image: redis:alpine
14 | ports:
15 | - "6379:6379"
16 |
17 | db:
18 | image: postgres:13
19 | environment:
20 | POSTGRES_USER: user
21 | POSTGRES_PASSWORD: password
22 | POSTGRES_DB: mydb
23 | volumes:
24 | - postgres_data:/var/lib/postgresql/data
25 |
26 | volumes:
27 | postgres_data:
--------------------------------------------------------------------------------
/topics/monitoring/tracing/zipkin/README.md:
--------------------------------------------------------------------------------
1 | # Zipkin
2 |
3 | ## Overview
4 | Zipkin is an open-source distributed tracing system for monitoring and troubleshooting microservices-based distributed systems.
5 |
6 | ## Key Features
7 | - **Distributed Tracing**: Track requests across services.
8 | - **Performance Monitoring**: Identify bottlenecks and latency issues.
9 | - **Integration**: Works with OpenTracing and OpenTelemetry.
10 |
11 | ## Getting Started
12 | 1. Install Zipkin:
13 | ```bash
14 | docker run -d -p 9411:9411 openzipkin/zipkin
15 | ```
16 | 2. Access Zipkin UI at `http://localhost:9411`.
17 |
--------------------------------------------------------------------------------
/topics/container/docker/basics/Dockerfile:
--------------------------------------------------------------------------------
1 | # Use an official Python runtime as a parent image
2 | FROM python:3.9-slim
3 |
4 | # Set the working directory in the container
5 | WORKDIR /app
6 |
7 | # Copy the current directory contents into the container at /app
8 | COPY . /app
9 |
10 | # Install any needed packages specified in requirements.txt
11 | RUN pip install --no-cache-dir -r requirements.txt
12 |
13 | # Make port 80 available to the world outside this container
14 | EXPOSE 80
15 |
16 | # Define environment variable
17 | ENV NAME World
18 |
19 | # Run app.py when the container launches
20 | CMD ["python", "app.py"]
--------------------------------------------------------------------------------
/topics/tools/ci-cd/jenkins/README.md:
--------------------------------------------------------------------------------
1 | # Jenkins
2 |
3 | ## Overview
4 | Jenkins is an open-source automation server used for continuous integration and continuous delivery (CI/CD).
5 |
6 | ## Key Features
7 | - **Pipeline as Code**: Define build pipelines using Groovy scripts.
8 | - **Extensibility**: Thousands of plugins available.
9 | - **Distributed Builds**: Scale builds across multiple nodes.
10 |
11 | ## Getting Started
12 | 1. Install Jenkins:
13 | ```bash
14 | sudo apt update
15 | sudo apt install jenkins
16 | ```
17 | 2. Access Jenkins at http://localhost:8080.
18 | 3. Create a new pipeline job.
19 |
--------------------------------------------------------------------------------
/topics/tools/containerization/docker/README.md:
--------------------------------------------------------------------------------
1 | # Docker
2 |
3 | ## Overview
4 | Docker is a platform for developing, shipping, and running applications in containers.
5 |
6 | ## Key Features
7 | - **Containerization**: Package applications and dependencies into containers.
8 | - **Portability**: Run containers consistently across environments.
9 | - **Docker Hub**: Share and manage container images.
10 |
11 | ## Getting Started
12 | 1. Install Docker:
13 | ```bash
14 | sudo apt update
15 | sudo apt install docker.io
16 | ```
17 | 2. Run a container:
18 | ```bash
19 | docker run hello-world
20 | ```
21 |
--------------------------------------------------------------------------------
/topics/container/helm/basics/my-first-chart/templates/deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | name: {{ .Release.Name }}
5 | spec:
6 | replicas: {{ .Values.replicaCount }}
7 | selector:
8 | matchLabels:
9 | app: {{ .Release.Name }}
10 | template:
11 | metadata:
12 | labels:
13 | app: {{ .Release.Name }}
14 | spec:
15 | containers:
16 | - name: web
17 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
18 | imagePullPolicy: {{ .Values.image.pullPolicy }}
19 | ports:
20 | - containerPort: 80
--------------------------------------------------------------------------------
/topics/monitoring/tracing/zipkin/resources.md:
--------------------------------------------------------------------------------
1 | # Learning Resources for Zipkin
2 |
3 | ## Official Resources
4 | - [Zipkin Documentation](https://zipkin.io/)
5 | - [Zipkin GitHub](https://github.com/openzipkin/zipkin)
6 |
7 | ## Books
8 | - "Mastering Distributed Tracing" by Yuri Shkuro
9 |
10 | ## Online Courses
11 | - [Zipkin Fundamentals (Pluralsight)](https://www.pluralsight.com/courses/zipkin-fundamentals)
12 | - [Learn Zipkin (Udemy)](https://www.udemy.com/course/learn-zipkin/)
13 |
14 | ## Community Resources
15 | - [Zipkin Community](https://zipkin.io/community/)
16 | - [Zipkin Blog](https://medium.com/openzipkin)
17 |
--------------------------------------------------------------------------------
/topics/monitoring/logging/fluentd/resources.md:
--------------------------------------------------------------------------------
1 | # Learning Resources for Fluentd
2 |
3 | ## Official Resources
4 | - [Fluentd Documentation](https://docs.fluentd.org/)
5 | - [Fluentd GitHub](https://github.com/fluent/fluentd)
6 |
7 | ## Books
8 | - "Fluentd: Unified Logging Layer" by Kiyoto Tamura
9 |
10 | ## Online Courses
11 | - [Fluentd Fundamentals (Pluralsight)](https://www.pluralsight.com/courses/fluentd-fundamentals)
12 | - [Learn Fluentd (Udemy)](https://www.udemy.com/course/learn-fluentd/)
13 |
14 | ## Community Resources
15 | - [Fluentd Community](https://www.fluentd.org/community)
16 | - [Fluentd Blog](https://www.fluentd.org/blog/)
17 |
--------------------------------------------------------------------------------
/topics/container/helm/advanced/multi-service-app/templates/web-deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | name: {{ .Release.Name }}
5 | spec:
6 | replicas: {{ .Values.web.replicaCount }}
7 | selector:
8 | matchLabels:
9 | app: {{ .Release.Name }}
10 | template:
11 | metadata:
12 | labels:
13 | app: {{ .Release.Name }}
14 | spec:
15 | containers:
16 | - name: web
17 | image: "{{ .Values.web.image.repository }}:{{ .Values.web.image.tag }}"
18 | imagePullPolicy: {{ .Values.web.image.pullPolicy }}
19 | ports:
20 | - containerPort: 80
--------------------------------------------------------------------------------
/topics/monitoring/metrics/grafana/resources.md:
--------------------------------------------------------------------------------
1 | # Learning Resources for Grafana
2 |
3 | ## Official Resources
4 | - [Grafana Documentation](https://grafana.com/docs/)
5 | - [Grafana GitHub](https://github.com/grafana/grafana)
6 |
7 | ## Books
8 | - "Grafana Cookbook" by Alberto Perez Veiga
9 |
10 | ## Online Courses
11 | - [Grafana Tutorial for Beginners (Udemy)](https://www.udemy.com/course/grafana-tutorial/)
12 | - [Learn Grafana (Pluralsight)](https://www.pluralsight.com/courses/grafana-getting-started)
13 |
14 | ## Community Resources
15 | - [Grafana Community Forum](https://community.grafana.com/)
16 | - [Grafana Blog](https://grafana.com/blog/)
17 |
--------------------------------------------------------------------------------
/topics/monitoring/tracing/jaeger/resources.md:
--------------------------------------------------------------------------------
1 | # Learning Resources for Jaeger
2 |
3 | ## Official Resources
4 | - [Jaeger Documentation](https://www.jaegertracing.io/docs/)
5 | - [Jaeger GitHub](https://github.com/jaegertracing/jaeger)
6 |
7 | ## Books
8 | - "Mastering Distributed Tracing" by Yuri Shkuro
9 |
10 | ## Online Courses
11 | - [Jaeger Fundamentals (Pluralsight)](https://www.pluralsight.com/courses/jaeger-fundamentals)
12 | - [Learn Jaeger (Udemy)](https://www.udemy.com/course/learn-jaeger/)
13 |
14 | ## Community Resources
15 | - [Jaeger Community](https://www.jaegertracing.io/community/)
16 | - [Jaeger Blog](https://medium.com/jaegertracing)
17 |
--------------------------------------------------------------------------------
/topics/tools/monitoring-and-logging/grafana/resources.md:
--------------------------------------------------------------------------------
1 | # Learning Resources for Grafana
2 |
3 | ## Official Resources
4 | - [Grafana Documentation](https://grafana.com/docs/)
5 | - [Grafana GitHub](https://github.com/grafana/grafana)
6 |
7 | ## Books
8 | - "Grafana Cookbook" by Alberto Perez Veiga
9 |
10 | ## Online Courses
11 | - [Grafana Tutorial for Beginners (Udemy)](https://www.udemy.com/course/grafana-tutorial/)
12 | - [Learn Grafana (Pluralsight)](https://www.pluralsight.com/courses/grafana-getting-started)
13 |
14 | ## Community Resources
15 | - [Grafana Community Forum](https://community.grafana.com/)
16 | - [Grafana Blog](https://grafana.com/blog/)
17 |
--------------------------------------------------------------------------------
/topics/container/kubernetes/advanced/ingress/ingress.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: networking.k8s.io/v1
2 | kind: Ingress
3 | metadata:
4 | name: example-ingress
5 | annotations:
6 | nginx.ingress.kubernetes.io/rewrite-target: /
7 | spec:
8 | rules:
9 | - host: myapp.example.com
10 | http:
11 | paths:
12 | - path: /app1
13 | pathType: Prefix
14 | backend:
15 | service:
16 | name: app1-service
17 | port:
18 | number: 80
19 | - path: /app2
20 | pathType: Prefix
21 | backend:
22 | service:
23 | name: app2-service
24 | port:
25 | number: 80
--------------------------------------------------------------------------------
/topics/infrastructure/configuration-management/puppet/resources.md:
--------------------------------------------------------------------------------
1 | # Learning Resources for Puppet
2 |
3 | ## Official Resources
4 | - [Puppet Documentation](https://puppet.com/docs/)
5 | - [Puppet Forge](https://forge.puppet.com/)
6 |
7 | ## Books
8 | - "Puppet 5 Essentials" by Martin Alfke
9 | - "Pro Puppet" by James Turnbull and Jeffrey McCune
10 |
11 | ## Online Courses
12 | - [Puppet Fundamentals (Pluralsight)](https://www.pluralsight.com/courses/puppet-fundamentals)
13 | - [Learning Puppet (Udemy)](https://www.udemy.com/course/learning-puppet/)
14 |
15 | ## Community Resources
16 | - [Puppet Community Slack](https://slack.puppet.com/)
17 | - [Puppet Blog](https://puppet.com/blog/)
18 |
--------------------------------------------------------------------------------
/topics/monitoring/metrics/prometheus/resources.md:
--------------------------------------------------------------------------------
1 | # Learning Resources for Prometheus
2 |
3 | ## Official Resources
4 | - [Prometheus Documentation](https://prometheus.io/docs/)
5 | - [Prometheus GitHub](https://github.com/prometheus/prometheus)
6 |
7 | ## Books
8 | - "Monitoring with Prometheus" by James Turnbull
9 |
10 | ## Online Courses
11 | - [Prometheus and Grafana (Udemy)](https://www.udemy.com/course/prometheus-and-grafana/)
12 | - [Learn Prometheus (Pluralsight)](https://www.pluralsight.com/courses/prometheus-getting-started)
13 |
14 | ## Community Resources
15 | - [Prometheus Community](https://prometheus.io/community/)
16 | - [Prometheus Blog](https://prometheus.io/blog/)
17 |
--------------------------------------------------------------------------------
/topics/monitoring/alerting/pagerduty/resources.md:
--------------------------------------------------------------------------------
1 | # Learning Resources for PagerDuty
2 |
3 | ## Official Resources
4 | - [PagerDuty Documentation](https://support.pagerduty.com/docs)
5 | - [PagerDuty GitHub](https://github.com/PagerDuty)
6 |
7 | ## Books
8 | - "Incident Management for Operations" by Rob Schnepp, Ron Vidal, and Chris Hawley
9 |
10 | ## Online Courses
11 | - [PagerDuty Fundamentals (Pluralsight)](https://www.pluralsight.com/courses/pagerduty-fundamentals)
12 | - [Learn PagerDuty (Udemy)](https://www.udemy.com/course/learn-pagerduty/)
13 |
14 | ## Community Resources
15 | - [PagerDuty Community](https://community.pagerduty.com/)
16 | - [PagerDuty Blog](https://www.pagerduty.com/blog/)
17 |
--------------------------------------------------------------------------------
/topics/infrastructure/configuration-management/chef/resources.md:
--------------------------------------------------------------------------------
1 | # Learning Resources for Chef
2 |
3 | ## Official Resources
4 | - [Chef Documentation](https://docs.chef.io/)
5 | - [Chef Supermarket](https://supermarket.chef.io/)
6 |
7 | ## Books
8 | - "Chef Infrastructure Automation Cookbook" by Matthias Marschall
9 | - "Learning Chef" by Mischa Taylor and Seth Vargo
10 |
11 | ## Online Courses
12 | - [Chef Fundamentals (Pluralsight)](https://www.pluralsight.com/courses/chef-fundamentals)
13 | - [Learning Chef (Udemy)](https://www.udemy.com/course/learning-chef/)
14 |
15 | ## Community Resources
16 | - [Chef Community Slack](https://community-slack.chef.io/)
17 | - [Chef Blog](https://www.chef.io/blog/)
18 |
--------------------------------------------------------------------------------
/topics/tools/infrastructure-as-code/ansible/resources.md:
--------------------------------------------------------------------------------
1 | # Learning Resources for Ansible
2 |
3 | ## Official Resources
4 | - [Ansible Documentation](https://docs.ansible.com/)
5 | - [Ansible Galaxy](https://galaxy.ansible.com/)
6 |
7 | ## Books
8 | - "Ansible for DevOps" by Jeff Geerling
9 | - "Mastering Ansible" by Jesse Keating
10 |
11 | ## Online Courses
12 | - [Ansible for Beginners (Udemy)](https://www.udemy.com/course/learn-ansible/)
13 | - [Ansible Advanced (Pluralsight)](https://www.pluralsight.com/courses/ansible-advanced-playbooks)
14 |
15 | ## Community Resources
16 | - [Ansible Reddit](https://www.reddit.com/r/ansible/)
17 | - [Ansible Mailing List](https://groups.google.com/g/ansible-project)
18 |
--------------------------------------------------------------------------------
/topics/infrastructure/infrastructure-as-code/Ansible/resources.md:
--------------------------------------------------------------------------------
1 | # Learning Resources for Ansible
2 |
3 | ## Official Resources
4 | - [Ansible Documentation](https://docs.ansible.com/)
5 | - [Ansible Galaxy](https://galaxy.ansible.com/)
6 |
7 | ## Books
8 | - "Ansible for DevOps" by Jeff Geerling
9 | - "Mastering Ansible" by Jesse Keating
10 |
11 | ## Online Courses
12 | - [Ansible for Beginners (Udemy)](https://www.udemy.com/course/learn-ansible/)
13 | - [Ansible Advanced (Pluralsight)](https://www.pluralsight.com/courses/ansible-advanced-playbooks)
14 |
15 | ## Community Resources
16 | - [Ansible Reddit](https://www.reddit.com/r/ansible/)
17 | - [Ansible Mailing List](https://groups.google.com/g/ansible-project)
18 |
--------------------------------------------------------------------------------
/topics/infrastructure/provisioning/packer/resources.md:
--------------------------------------------------------------------------------
1 | # Learning Resources for Packer
2 |
3 | ## Official Resources
4 | - [Packer Documentation](https://www.packer.io/docs/)
5 | - [Packer GitHub](https://github.com/hashicorp/packer)
6 |
7 | ## Books
8 | - "Packer: Up and Running" by John Boero
9 | - "Infrastructure as Code" by Kief Morris
10 |
11 | ## Online Courses
12 | - [Packer Fundamentals (Pluralsight)](https://www.pluralsight.com/courses/packer-fundamentals)
13 | - [Learn Packer (HashiCorp Learn)](https://learn.hashicorp.com/packer)
14 |
15 | ## Community Resources
16 | - [Packer Community Forum](https://discuss.hashicorp.com/c/packer/29)
17 | - [Packer Blog](https://www.hashicorp.com/blog/category/packer)
18 |
--------------------------------------------------------------------------------
/topics/monitoring/alerting/pagerduty/README.md:
--------------------------------------------------------------------------------
1 | # PagerDuty
2 |
3 | ## Overview
4 | PagerDuty is an incident management platform that provides real-time alerts and on-call scheduling.
5 |
6 | ## Key Features
7 | - **Incident Management**: Track and resolve incidents efficiently.
8 | - **On-Call Scheduling**: Manage on-call rotations.
9 | - **Integrations**: Works with Prometheus, Grafana, and more.
10 |
11 | ## Getting Started
12 | 1. Sign up for PagerDuty: [PagerDuty Sign-Up](https://www.pagerduty.com/).
13 | 2. Create a service and integrate it with your monitoring tools.
14 |
15 | ## Resources
16 | - [PagerDuty Documentation](https://support.pagerduty.com/docs)
17 | - [PagerDuty GitHub](https://github.com/PagerDuty)
18 |
--------------------------------------------------------------------------------
/topics/monitoring/alerting/alertmanager/resources.md:
--------------------------------------------------------------------------------
1 | # Learning Resources for Alertmanager
2 |
3 | ## Official Resources
4 | - [Alertmanager Documentation](https://prometheus.io/docs/alerting/latest/alertmanager/)
5 | - [Alertmanager GitHub](https://github.com/prometheus/alertmanager)
6 |
7 | ## Books
8 | - "Monitoring with Prometheus" by James Turnbull
9 |
10 | ## Online Courses
11 | - [Prometheus and Alertmanager (Udemy)](https://www.udemy.com/course/prometheus-and-grafana/)
12 | - [Learn Alertmanager (Pluralsight)](https://www.pluralsight.com/courses/prometheus-getting-started)
13 |
14 | ## Community Resources
15 | - [Prometheus Community](https://prometheus.io/community/)
16 | - [Prometheus Blog](https://prometheus.io/blog/)
17 |
--------------------------------------------------------------------------------
/topics/infrastructure/infrastructure-as-code/terraform/resources.md:
--------------------------------------------------------------------------------
1 | # Learning Resources for Terraform
2 |
3 | ## Official Resources
4 | - [Terraform Documentation](https://www.terraform.io/docs/)
5 | - [Terraform Registry](https://registry.terraform.io/)
6 |
7 | ## Books
8 | - "Terraform Up & Running" by Yevgeniy Brikman
9 | - "Infrastructure as Code" by Kief Morris
10 |
11 | ## Online Courses
12 | - [Terraform for Beginners (Udemy)](https://www.udemy.com/course/terraform-beginner-to-advanced/)
13 | - [Learn Terraform (HashiCorp Learn)](https://learn.hashicorp.com/terraform)
14 |
15 | ## Community Resources
16 | - [Terraform Community](https://www.terraform.io/community)
17 | - [Terraform Reddit](https://www.reddit.com/r/Terraform/)
18 |
--------------------------------------------------------------------------------
/topics/infrastructure/provisioning/vagrant/resources.md:
--------------------------------------------------------------------------------
1 | # Learning Resources for Vagrant
2 |
3 | ## Official Resources
4 | - [Vagrant Documentation](https://www.vagrantup.com/docs/)
5 | - [Vagrant GitHub](https://github.com/hashicorp/vagrant)
6 |
7 | ## Books
8 | - "Vagrant: Up and Running" by Mitchell Hashimoto
9 | - "Infrastructure as Code" by Kief Morris
10 |
11 | ## Online Courses
12 | - [Vagrant Fundamentals (Pluralsight)](https://www.pluralsight.com/courses/vagrant-fundamentals)
13 | - [Learn Vagrant (HashiCorp Learn)](https://learn.hashicorp.com/vagrant)
14 |
15 | ## Community Resources
16 | - [Vagrant Community Forum](https://discuss.hashicorp.com/c/vagrant/24)
17 | - [Vagrant Blog](https://www.hashicorp.com/blog/category/vagrant)
18 |
--------------------------------------------------------------------------------
/topics/tools/containerization/kubernetes/resources.md:
--------------------------------------------------------------------------------
1 | # Learning Resources for Kubernetes
2 |
3 | ## Official Resources
4 | - [Kubernetes Documentation](https://kubernetes.io/docs/home/)
5 | - [Kubernetes GitHub](https://github.com/kubernetes/kubernetes)
6 |
7 | ## Books
8 | - "Kubernetes in Action" by Marko Luksa
9 | - "The Kubernetes Book" by Nigel Poulton
10 |
11 | ## Online Courses
12 | - [Kubernetes for the Absolute Beginners (Udemy)](https://www.udemy.com/course/learn-kubernetes/)
13 | - [Certified Kubernetes Administrator (CKA) Course (KodeKloud)](https://kodekloud.com/p/cka-certification-course)
14 |
15 | ## Community Resources
16 | - [Kubernetes Slack](https://slack.k8s.io/)
17 | - [Kubernetes Blog](https://kubernetes.io/blog/)
18 |
--------------------------------------------------------------------------------
/topics/tools/monitoring-and-logging/prometheus/README.md:
--------------------------------------------------------------------------------
1 | # Prometheus
2 |
3 | ## Overview
4 | Prometheus is an open-source monitoring and alerting toolkit designed for reliability and scalability.
5 |
6 | ## Key Features
7 | - **Time-Series Database**: Store metrics efficiently.
8 | - **PromQL**: Query language for analyzing metrics.
9 | - **Alerting**: Define alerts based on metric thresholds.
10 |
11 | ## Getting Started
12 | 1. Install Prometheus:
13 | ```bash
14 | wget https://github.com/prometheus/prometheus/releases/download/v2.30.0/prometheus-2.30.0.linux-amd64.tar.gz
15 | tar xvfz prometheus-2.30.0.linux-amd64.tar.gz
16 | cd prometheus-2.30.0.linux-amd64
17 | ./prometheus
18 | 2. Access Prometheus at http://localhost:9090.
19 |
--------------------------------------------------------------------------------
/topics/monitoring/metrics/prometheus/README.md:
--------------------------------------------------------------------------------
1 | # Prometheus
2 |
3 | ## Overview
4 | Prometheus is an open-source monitoring and alerting toolkit designed for reliability and scalability.
5 |
6 | ## Key Features
7 | - **Time-Series Database**: Store metrics efficiently.
8 | - **PromQL**: Query language for analyzing metrics.
9 | - **Alerting**: Define alerts based on metric thresholds.
10 |
11 | ## Getting Started
12 | 1. Install Prometheus:
13 | ```bash
14 | wget https://github.com/prometheus/prometheus/releases/download/v2.30.0/prometheus-2.30.0.linux-amd64.tar.gz
15 | tar xvfz prometheus-2.30.0.linux-amd64.tar.gz
16 | cd prometheus-2.30.0.linux-amd64
17 | ./prometheus
18 | ```
19 | 2. Access Prometheus at `http://localhost:9090`.
20 |
--------------------------------------------------------------------------------
/topics/cloud/azure/resources.md:
--------------------------------------------------------------------------------
1 | # Learning Resources for Azure
2 |
3 | ## Official Resources
4 | - [Azure Documentation](https://docs.microsoft.com/en-us/azure/)
5 | - [Microsoft Learn](https://learn.microsoft.com/)
6 |
7 | ## Books
8 | - "Azure for Architects" by Ritesh Modi
9 | - "Exam Ref AZ-104 Microsoft Azure Administrator" by Harshul Patel
10 |
11 | ## Online Courses
12 | - [Azure Fundamentals (Udemy)](https://www.udemy.com/course/azure-fundamentals-az-900/)
13 | - [Azure Administrator (Pluralsight)](https://www.pluralsight.com/courses/microsoft-azure-administrator-az-104)
14 |
15 | ## Community Resources
16 | - [Azure Community Support](https://azure.microsoft.com/en-us/support/community/)
17 | - [Azure Blog](https://azure.microsoft.com/en-us/blog/)
18 |
--------------------------------------------------------------------------------
/topics/cloud/multi-cloud/resources.md:
--------------------------------------------------------------------------------
1 | # Learning Resources for Multi-Cloud
2 |
3 | ## Official Resources
4 | - [Terraform Documentation](https://www.terraform.io/docs/)
5 | - [Kubernetes Documentation](https://kubernetes.io/docs/home/)
6 |
7 | ## Books
8 | - "Multi-Cloud Architecture and Governance" by Jeroen Mulder
9 | - "Cloud Native Infrastructure" by Justin Garrison and Kris Nova
10 |
11 | ## Online Courses
12 | - [Multi-Cloud Strategies (Pluralsight)](https://www.pluralsight.com/courses/multi-cloud-strategies)
13 | - [Terraform for Multi-Cloud (Udemy)](https://www.udemy.com/course/terraform-multi-cloud-deployments/)
14 |
15 | ## Community Resources
16 | - [Terraform Community](https://www.terraform.io/community)
17 | - [Kubernetes Slack](https://slack.k8s.io/)
18 |
--------------------------------------------------------------------------------
/topics/cloud/aws/resources.md:
--------------------------------------------------------------------------------
1 | # Learning Resources for AWS
2 |
3 | ## Official Resources
4 | - [AWS Documentation](https://docs.aws.amazon.com/)
5 | - [AWS Training and Certification](https://aws.amazon.com/training/)
6 |
7 | ## Books
8 | - "AWS Certified Solutions Architect Study Guide" by Ben Piper and David Clinton
9 | - "Amazon Web Services in Action" by Michael Wittig and Andreas Wittig
10 |
11 | ## Online Courses
12 | - [AWS Certified Solutions Architect (Udemy)](https://www.udemy.com/course/aws-certified-solutions-architect-associate/)
13 | - [AWS Fundamentals (Coursera)](https://www.coursera.org/specializations/aws-fundamentals)
14 |
15 | ## Community Resources
16 | - [AWS Developer Forums](https://forums.aws.amazon.com/)
17 | - [AWS Blog](https://aws.amazon.com/blogs/)
18 |
--------------------------------------------------------------------------------
/topics/container/kubernetes/example/deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | name: my-app
5 | spec:
6 | replicas: 3
7 | selector:
8 | matchLabels:
9 | app: my-app
10 | template:
11 | metadata:
12 | labels:
13 | app: my-app
14 | spec:
15 | containers:
16 | - name: my-app-container
17 | image: my-app:latest
18 | ports:
19 | - containerPort: 8080
20 | env:
21 | - name: APP_COLOR
22 | valueFrom:
23 | configMapKeyRef:
24 | name: app-config
25 | key: APP_COLOR
26 | - name: DB_PASSWORD
27 | valueFrom:
28 | secretKeyRef:
29 | name: app-secret
30 | key: DB_PASSWORD
--------------------------------------------------------------------------------
/topics/container/docker/example/nodejs/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3.8'
2 | services:
3 | auth-service:
4 | image: auth-service
5 | build: ./auth
6 | ports:
7 | - "3001:3001"
8 | environment:
9 | - DB_HOST=db
10 | - DB_USER=user
11 | - DB_PASSWORD=password
12 |
13 | user-service:
14 | image: user-service
15 | build: ./user
16 | ports:
17 | - "3002:3002"
18 | environment:
19 | - DB_HOST=db
20 | - DB_USER=user
21 | - DB_PASSWORD=password
22 |
23 | db:
24 | image: postgres:13
25 | environment:
26 | POSTGRES_USER: user
27 | POSTGRES_PASSWORD: password
28 | POSTGRES_DB: mydb
29 | volumes:
30 | - postgres_data:/var/lib/postgresql/data
31 |
32 | volumes:
33 | postgres_data:
--------------------------------------------------------------------------------
/topics/cloud/gcp/resources.md:
--------------------------------------------------------------------------------
1 | # Learning Resources for GCP
2 |
3 | ## Official Resources
4 | - [GCP Documentation](https://cloud.google.com/docs)
5 | - [Google Cloud Training](https://cloud.google.com/training)
6 |
7 | ## Books
8 | - "Google Cloud Platform for Developers" by Ted Hunter
9 | - "Official Google Cloud Certified Associate Cloud Engineer Study Guide" by Dan Sullivan
10 |
11 | ## Online Courses
12 | - [Google Cloud Fundamentals (Coursera)](https://www.coursera.org/learn/google-cloud-fundamentals-core-infrastructure)
13 | - [GCP Associate Cloud Engineer (Udemy)](https://www.udemy.com/course/google-cloud-associate-cloud-engineer/)
14 |
15 | ## Community Resources
16 | - [Google Cloud Community](https://cloud.google.com/community/)
17 | - [Google Cloud Blog](https://cloud.google.com/blog/)
18 |
--------------------------------------------------------------------------------
/topics/cloud/aws/README.md:
--------------------------------------------------------------------------------
1 | # Amazon Web Services (AWS)
2 |
3 | ## Overview
4 | AWS is the most widely adopted cloud platform, offering over 200 fully featured services from data centres globally.
5 |
6 | ## Key Services
7 | - **Compute**: EC2, Lambda, ECS, EKS.
8 | - **Storage**: S3, EBS, Glacier.
9 | - **Databases**: RDS, DynamoDB, Redshift.
10 | - **Networking**: VPC, Route 53, CloudFront.
11 | - **DevOps**: CodePipeline, CodeBuild, CodeDeploy.
12 |
13 | ## Getting Started
14 | 1. Create an AWS account: [AWS Sign-Up](https://aws.amazon.com/).
15 | 2. Install the AWS CLI:
16 | ```bash
17 | curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
18 | unzip awscliv2.zip
19 | sudo ./aws/install
20 |
21 | 3. Configure the AWS CLI:
22 | ```bash
23 | aws configure
24 |
--------------------------------------------------------------------------------
/topics/tools/ci-cd/github-actions/resources.md:
--------------------------------------------------------------------------------
1 | # Learning Resources for GitHub Actions
2 |
3 | ## Official Resources
4 | - [GitHub Actions Documentation](https://docs.github.com/en/actions)
5 | - [GitHub Marketplace](https://github.com/marketplace?type=actions)
6 |
7 | ## Books
8 | - "GitHub Actions Essentials" by Sander van Vugt
9 |
10 | ## Online Courses
11 | - [GitHub Actions: Hello World (GitHub Learning Lab)](https://lab.github.com/githubtraining/github-actions:-hello-world)
12 | - [GitHub Actions CI/CD Masterclass (Udemy)](https://www.udemy.com/course/github-actions-ci-cd-masterclass/)
13 |
14 | ## Community Resources
15 | - [GitHub Actions Community Forum](https://github.community/c/code-to-cloud/github-actions/41)
16 | - [Awesome GitHub Actions (GitHub Repo)](https://github.com/sdras/awesome-actions)
17 |
--------------------------------------------------------------------------------
/topics/monitoring/logging/elastic-stack/resources.md:
--------------------------------------------------------------------------------
1 | # Learning Resources for Elastic Stack
2 |
3 | ## Official Resources
4 | - [Elastic Stack Documentation](https://www.elastic.co/guide/index.html)
5 | - [Elastic Stack GitHub](https://github.com/elastic)
6 |
7 | ## Books
8 | - "Elasticsearch: The Definitive Guide" by Clinton Gormley and Zachary Tong
9 | - "Learning Elastic Stack 7.0" by Pranav Shukla and Sharath Kumar M N
10 |
11 | ## Online Courses
12 | - [Elasticsearch 7 and the Elastic Stack (Udemy)](https://www.udemy.com/course/elasticsearch-7-and-elastic-stack/)
13 | - [Learn Elastic Stack (Pluralsight)](https://www.pluralsight.com/courses/elastic-stack-getting-started)
14 |
15 | ## Community Resources
16 | - [Elastic Community](https://discuss.elastic.co/)
17 | - [Elastic Blog](https://www.elastic.co/blog/)
18 |
--------------------------------------------------------------------------------
/topics/monitoring/alerting/alertmanager/README.md:
--------------------------------------------------------------------------------
1 | # Alertmanager
2 |
3 | ## Overview
4 | Alertmanager is a component of the Prometheus ecosystem that handles alerts sent by client applications such as the Prometheus server.
5 |
6 | ## Key Features
7 | - **Alert Routing**: Route alerts to the correct receiver (e.g., email, Slack).
8 | - **Deduplication**: Group similar alerts to reduce noise.
9 | - **Silencing**: Mute alerts during maintenance windows.
10 |
11 | ## Getting Started
12 | 1. Install Alertmanager:
13 | ```bash
14 | wget https://github.com/prometheus/alertmanager/releases/download/v0.23.0/alertmanager-0.23.0.linux-amd64.tar.gz
15 | tar xvfz alertmanager-0.23.0.linux-amd64.tar.gz
16 | cd alertmanager-0.23.0.linux-amd64
17 | ./alertmanager
18 | ```
19 | 2. Access Alertmanager UI at `http://localhost:9093`.
20 |
--------------------------------------------------------------------------------
/topics/monitoring/logging/fluentd/README.md:
--------------------------------------------------------------------------------
1 | # Fluentd
2 |
3 | ## Overview
4 | Fluentd is an open-source data collector for unified logging layers.
5 |
6 | ## Key Features
7 | - **Unified Logging**: Collect logs from various sources.
8 | - **Flexible Configuration**: Use plugins to extend functionality.
9 | - **Scalability**: Handle high volumes of log data.
10 |
11 | ## Getting Started
12 | 1. Install Fluentd:
13 | ```bash
14 | curl -L https://toolbelt.treasuredata.com/sh/install-ubuntu-bionic-td-agent4.sh | sh
15 | ```
16 | 2. Configure Fluentd (`/etc/td-agent/td-agent.conf`):
17 | ```xml
18 |
19 | @type forward
20 | port 24224
21 |
22 |
23 | @type stdout
24 |
25 | ```
26 | 3. Start Fluentd:
27 | ```bash
28 | sudo systemctl start td-agent
29 | ```
30 |
--------------------------------------------------------------------------------
/topics/monitoring/tracing/jaeger/README.md:
--------------------------------------------------------------------------------
1 | # Jaeger
2 |
3 | ## Overview
4 | Jaeger is an open-source tracing system for monitoring and troubleshooting microservices-based distributed systems.
5 |
6 | ## Key Features
7 | - **Distributed Tracing**: Track requests across services.
8 | - **Performance Monitoring**: Identify bottlenecks and latency issues.
9 | - **Integration**: Works with OpenTracing and OpenTelemetry.
10 |
11 | ## Getting Started
12 | 1. Install Jaeger:
13 | ```bash
14 | docker run -d --name jaeger \
15 | -e COLLECTOR_ZIPKIN_HTTP_PORT=9411 \
16 | -p 5775:5775/udp \
17 | -p 6831:6831/udp \
18 | -p 6832:6832/udp \
19 | -p 5778:5778 \
20 | -p 16686:16686 \
21 | -p 14268:14268 \
22 | -p 9411:9411 \
23 | jaegertracing/all-in-one:1.30
24 | ```
25 | 2. Access Jaeger UI at `http://localhost:16686`.
26 |
--------------------------------------------------------------------------------
/topics/cloud/azure/README.md:
--------------------------------------------------------------------------------
1 | # Microsoft Azure
2 |
3 | ## Overview
4 | Azure is Microsoft's cloud platform, offering a wide range of computing, analytics, storage, and networking services.
5 |
6 | ## Key Services
7 | - **Compute**: Virtual Machines, Azure Functions, Kubernetes Service (AKS).
8 | - **Storage**: Blob Storage, Disk Storage, Archive Storage.
9 | - **Databases**: SQL Database, Cosmos DB, Azure Database for PostgreSQL.
10 | - **Networking**: Virtual Network, Load Balancer, Content Delivery Network (CDN).
11 | - **DevOps**: Azure DevOps, Pipelines, Boards.
12 |
13 | ## Getting Started
14 | 1. Create an Azure account: [Azure Sign-Up](https://azure.microsoft.com/).
15 | 2. Install the Azure CLI:
16 | ```bash
17 | curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
18 | ```
19 | 3. Log in to Azure:
20 | ```bash
21 | az login
22 | ```
23 |
--------------------------------------------------------------------------------
/topics/container/kubernetes/advanced/statefulsets/statefulset.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: StatefulSet
3 | metadata:
4 | name: mysql-statefulset
5 | spec:
6 | serviceName: mysql
7 | replicas: 3
8 | selector:
9 | matchLabels:
10 | app: mysql
11 | template:
12 | metadata:
13 | labels:
14 | app: mysql
15 | spec:
16 | containers:
17 | - name: mysql
18 | image: mysql:5.7
19 | ports:
20 | - containerPort: 3306
21 | env:
22 | - name: MYSQL_ROOT_PASSWORD
23 | valueFrom:
24 | secretKeyRef:
25 | name: mysql-secret
26 | key: password
27 | volumeClaimTemplates:
28 | - metadata:
29 | name: mysql-pvc
30 | spec:
31 | accessModes: [ "ReadWriteOnce" ]
32 | resources:
33 | requests:
34 | storage: 1Gi
--------------------------------------------------------------------------------
/topics/tools/README.md:
--------------------------------------------------------------------------------
1 | # DevOps Tools
2 |
3 | This section provides a guide to essential DevOps tools, their use cases, and how to get started with them.
4 |
5 | ## Categories of DevOps Tools
6 | 1. **Version Control**: Tools for managing source code and collaboration.
7 | 2. **CI/CD**: Tools for continuous integration and continuous delivery.
8 | 3. **Containerization**: Tools for packaging and running applications in containers.
9 | 4. **Infrastructure as Code (IaC)**: Tools for automating infrastructure provisioning.
10 | 5. **Monitoring and Logging**: Tools for observability and troubleshooting.
11 |
12 | ## How to Use This Guide
13 | - Each tool has its own folder with a `README.md` file containing details about the tool and a `resources.md` file with learning materials.
14 | - Use the resources provided to master these tools and enhance your DevOps workflows.
15 |
--------------------------------------------------------------------------------
/topics/tools/version-control/git/README.md:
--------------------------------------------------------------------------------
1 | # Git
2 |
3 | ## Overview
4 | Git is a distributed version control system used to track changes in source code during software development.
5 |
6 | ## Key Features
7 | - **Branching and Merging**: Create and merge branches for parallel development.
8 | - **Staging Area**: Selectively stage changes before committing.
9 | - **Distributed**: Every developer has a full copy of the repository.
10 |
11 | ## Common Commands
12 | - `git init`: Initialize a new Git repository.
13 | - `git clone`: Clone a remote repository.
14 | - `git add`: Stage changes for commit.
15 | - `git commit`: Commit staged changes.
16 | - `git push`: Push changes to a remote repository.
17 | - `git pull`: Fetch and merge changes from a remote repository.
18 |
19 | ## Resources
20 | - [Git Documentation](https://git-scm.com/doc)
21 | - [Pro Git Book](https://git-scm.com/book/en/v2)
22 |
--------------------------------------------------------------------------------
/topics/certifications/docker-certified-associate/README.md:
--------------------------------------------------------------------------------
1 | # Docker Certified Associate
2 |
3 | ## Overview
4 | The Docker Certified Associate certification validates your skills in using Docker for containerization and orchestration.
5 |
6 | ## Exam Details
7 | - **Duration**: 90 minutes
8 | - **Format**: Multiple-choice and performance-based tasks
9 | - **Cost**: $195 USD
10 | - **Prerequisites**: Basic understanding of Docker and containerization
11 |
12 | ## Exam Topics
13 | 1. **Orchestration**: Docker Swarm, Kubernetes.
14 | 2. **Image Creation and Management**: Dockerfile, Docker Hub.
15 | 3. **Networking and Security**: Docker networks, secrets, and security best practices.
16 |
17 | ## Resources
18 | - [Docker Certification Guide](https://www.docker.com/certification)
19 | - [Docker Documentation](https://docs.docker.com/)
20 | - [Practice Exams](https://www.whizlabs.com/docker-certified-associate/)
21 |
--------------------------------------------------------------------------------
/topics/container/helm/advanced/multi-service-app/templates/db-deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | name: {{ .Release.Name }}
5 | spec:
6 | replicas: 1
7 | selector:
8 | matchLabels:
9 | app: {{ .Release.Name }}
10 | template:
11 | metadata:
12 | labels:
13 | app: {{ .Release.Name }}
14 | spec:
15 | containers:
16 | - name: db
17 | image: "{{ .Values.db.image.repository }}:{{ .Values.db.image.tag }}"
18 | imagePullPolicy: {{ .Values.db.image.pullPolicy }}
19 | env:
20 | - name: POSTGRES_USER
21 | value: {{ .Values.db.env.POSTGRES_USER }}
22 | - name: POSTGRES_PASSWORD
23 | value: {{ .Values.db.env.POSTGRES_PASSWORD }}
24 | - name: POSTGRES_DB
25 | value: {{ .Values.db.env.POSTGRES_DB }}
26 | ports:
27 | - containerPort: 5432
--------------------------------------------------------------------------------
/topics/certifications/certified-kubernetes-administrator/README.md:
--------------------------------------------------------------------------------
1 | # Certified Kubernetes Administrator (CKA)
2 |
3 | ## Overview
4 | The CKA certification validates your ability to perform the responsibilities of a Kubernetes administrator, including installation, configuration, and management of Kubernetes clusters.
5 |
6 | ## Exam Details
7 | - **Duration**: 2 hours
8 | - **Format**: Performance-based tasks
9 | - **Cost**: $375 USD
10 | - **Prerequisites**: Basic understanding of Kubernetes concepts
11 |
12 | ## Exam Topics
13 | 1. **Cluster Architecture, Installation, and Configuration**: 25%
14 | 2. **Workloads and Scheduling**: 15%
15 | 3. **Services and Networking**: 20%
16 | 4. **Storage**: 10%
17 | 5. **Troubleshooting**: 30%
18 |
19 | ## Resources
20 | - [CKA Exam Curriculum](https://github.com/cncf/curriculum)
21 | - [Kubernetes Documentation](https://kubernetes.io/docs/home/)
22 | - [Practice Labs](https://killercoda.com/)
23 |
--------------------------------------------------------------------------------
/topics/infrastructure/configuration-management/puppet/README.md:
--------------------------------------------------------------------------------
1 | # Puppet
2 |
3 | ## Overview
4 | Puppet is a configuration management tool that automates the provisioning, configuration, and management of infrastructure.
5 |
6 | ## Key Features
7 | - **Declarative Language**: Define infrastructure state using Puppet's DSL.
8 | - **Idempotency**: Ensures consistent state across multiple runs.
9 | - **Scalability**: Manages thousands of nodes efficiently.
10 |
11 | ## Getting Started
12 | 1. Install Puppet:
13 | ```bash
14 | sudo apt update
15 | sudo apt install puppet
16 | ```
17 | 2. Create a manifest file (`site.pp`):
18 | ```puppet
19 | node 'webserver' {
20 | package { 'apache2':
21 | ensure => installed,
22 | }
23 | service { 'apache2':
24 | ensure => running,
25 | enable => true,
26 | }
27 | }
28 | ```
29 | 3. Apply the manifest:
30 | ```bash
31 | sudo puppet apply site.pp
32 |
--------------------------------------------------------------------------------
/topics/certifications/terraform-associate/README.md:
--------------------------------------------------------------------------------
1 | # HashiCorp Certified: Terraform Associate
2 |
3 | ## Overview
4 | The Terraform Associate certification validates your skills in using Terraform for infrastructure as code (IaC).
5 |
6 | ## Exam Details
7 | - **Duration**: 60 minutes
8 | - **Format**: Multiple-choice and multiple-response questions
9 | - **Cost**: $70.50 USD
10 | - **Prerequisites**: Basic understanding of Terraform and IaC concepts
11 |
12 | ## Exam Topics
13 | 1. **Terraform Basics**: Configuration, providers, and state management.
14 | 2. **Terraform Workflow**: Init, plan, apply, and destroy.
15 | 3. **Modules and Collaboration**: Reusable modules and remote state.
16 |
17 | ## Resources
18 | - [Terraform Certification Guide](https://www.hashicorp.com/certification/terraform-associate)
19 | - [Terraform Documentation](https://www.terraform.io/docs/)
20 | - [Practice Exams](https://www.whizlabs.com/hashicorp-certified-terraform-associate/)
21 |
--------------------------------------------------------------------------------
/topics/infrastructure/provisioning/vagrant/README.md:
--------------------------------------------------------------------------------
1 | # Vagrant
2 |
3 | ## Overview
4 | Vagrant is an open-source tool for building and managing virtual machine environments.
5 |
6 | ## Key Features
7 | - **Portable Environments**: Create consistent development environments.
8 | - **Provider Support**: Works with VirtualBox, VMware, Docker, and more.
9 | - **Automation**: Define environments using Vagrantfiles.
10 |
11 | ## Getting Started
12 | 1. Install Vagrant:
13 | ```bash
14 | sudo apt update
15 | sudo apt install vagrant
16 | ```
17 | 2. Create a Vagrantfile:
18 | ```ruby
19 | Vagrant.configure("2") do |config|
20 | config.vm.box = "ubuntu/focal64"
21 | config.vm.network "private_network", ip: "192.168.33.10"
22 | config.vm.provision "shell", inline: <<-SHELL
23 | apt-get update
24 | apt-get install -y apache2
25 | SHELL
26 | end
27 | ```
28 | 3. Start the VM:
29 | ```bash
30 | vagrant up
31 | ```
32 |
--------------------------------------------------------------------------------
/topics/monitoring/README.md:
--------------------------------------------------------------------------------
1 | # Monitoring
2 |
3 | This section provides a guide to monitoring tools, best practices, and real-world examples.
4 |
5 | ## What is Monitoring?
6 | Monitoring involves collecting, analyzing, and visualizing data about the performance and health of systems and applications. It helps in identifying issues, optimizing performance, and ensuring reliability.
7 |
8 | ## Key Areas of Monitoring
9 | 1. **Metrics**: Collecting and analyzing numerical data (e.g., CPU usage, memory usage).
10 | 2. **Logging**: Collecting and analyzing log data (e.g., application logs, system logs).
11 | 3. **Tracing**: Tracking requests across distributed systems.
12 | 4. **Alerting**: Notifying teams about critical issues.
13 |
14 | ## How to Use This Guide
15 | - Each area has its own folder with a `README.md` file containing details and a `resources.md` file with learning materials.
16 | - Use the resources provided to master monitoring and enhance your DevOps workflows.
17 |
--------------------------------------------------------------------------------
/topics/tools/infrastructure-as-code/ansible/README.md:
--------------------------------------------------------------------------------
1 | # Ansible
2 |
3 | ## Overview
4 | Ansible is an open-source automation tool for configuration management, application deployment, and task automation.
5 |
6 | ## Key Features
7 | - **Agentless**: Uses SSH for communication with nodes.
8 | - **Idempotent**: Ensures consistent state across multiple runs.
9 | - **YAML-Based Playbooks**: Define automation tasks in human-readable YAML.
10 |
11 | ## Getting Started
12 | 1. Install Ansible:
13 | ```bash
14 | sudo apt update
15 | sudo apt install ansible
16 | ```
17 |
18 | 2. Create an inventory file (inventory):
19 | ```bash
20 | [webservers]
21 | server1 ansible_host=192.168.1.10
22 | server2 ansible_host=192.168.1.11
23 | ```
24 |
25 | 3. Create a playbook (playbook.yml):
26 | ```bash
27 | - hosts: webservers
28 | tasks:
29 | - name: Ensure Apache is installed
30 | apt:
31 | name: apache2
32 | state: present
33 | ```
34 |
--------------------------------------------------------------------------------
/topics/infrastructure/README.md:
--------------------------------------------------------------------------------
1 | # Infrastructure Management
2 |
3 | This section provides a guide to infrastructure management, including tools, best practices, and real-world examples.
4 |
5 | ## What is Infrastructure Management?
6 | Infrastructure management involves the administration of technology components such as hardware, software, networking, and data storage. It ensures that infrastructure is reliable, scalable, and secure.
7 |
8 | ## Key Areas of Infrastructure Management
9 | 1. **Infrastructure as Code (IaC)**: Automating infrastructure provisioning using code.
10 | 2. **Configuration Management**: Managing and maintaining the consistency of systems.
11 | 3. **Provisioning**: Setting up infrastructure resources for use.
12 |
13 | ## How to Use This Guide
14 | - Each area has its own folder with a `README.md` file containing details and a `resources.md` file with learning materials.
15 | - Use the resources provided to master infrastructure management and enhance your DevOps workflows.
16 |
--------------------------------------------------------------------------------
/topics/infrastructure/configuration-management/chef/README.md:
--------------------------------------------------------------------------------
1 | # Chef
2 |
3 | ## Overview
4 | Chef is a configuration management tool that automates the deployment and management of infrastructure.
5 |
6 | ## Key Features
7 | - **Ruby-Based DSL**: Define infrastructure using Chef's Ruby-based DSL.
8 | - **Idempotency**: Ensures consistent state across multiple runs.
9 | - **Community Cookbooks**: Reusable configurations from the Chef Supermarket.
10 |
11 | ## Getting Started
12 | 1. Install Chef:
13 | ```bash
14 | curl -L https://omnitruck.chef.io/install.sh | sudo bash
15 | ```
16 | 2. Create a cookbook:
17 | ```bash
18 | chef generate cookbook my_cookbook
19 | ```
20 | 3. Define a recipe (`recipes/default.rb`):
21 | ```ruby
22 | package 'apache2' do
23 | action :install
24 | end
25 | service 'apache2' do
26 | action [:enable, :start]
27 | end
28 | ```
29 | 4. Apply the recipe:
30 | ```bash
31 | chef-client --local-mode recipes/default.rb
32 | ```
33 |
--------------------------------------------------------------------------------
/topics/infrastructure/infrastructure-as-code/terraform/README.md:
--------------------------------------------------------------------------------
1 | # Terraform
2 |
3 | ## Overview
4 | Terraform is an open-source infrastructure as code (IaC) tool for provisioning and managing cloud resources.
5 |
6 | ## Key Features
7 | - **Declarative Syntax**: Define infrastructure using HCL (HashiCorp Configuration Language).
8 | - **Multi-Cloud Support**: Manage resources across AWS, Azure, GCP, and more.
9 | - **State Management**: Track the state of your infrastructure.
10 |
11 | ## Getting Started
12 | 1. Install Terraform:
13 | ```bash
14 | sudo apt update
15 | sudo apt install terraform
16 |
17 | 2. Create a Terraform configuration file (main.tf):
18 | ```hcl
19 | provider "aws" {
20 | region = "us-east-1"
21 | }
22 |
23 | resource "aws_instance" "example" {
24 | ami = "ami-0c55b159cbfafe1f0"
25 | instance_type = "t2.micro"
26 | }
27 |
28 | 4. Apply the configuration:
29 | ```bash
30 | terraform init
31 | terraform apply
32 |
--------------------------------------------------------------------------------
/topics/tools/infrastructure-as-code/terraform/README.md:
--------------------------------------------------------------------------------
1 | # Terraform
2 |
3 | ## Overview
4 | Terraform is an open-source infrastructure as code (IaC) tool for provisioning and managing cloud resources.
5 |
6 | ## Key Features
7 | - **Declarative Syntax**: Define infrastructure using HCL (HashiCorp Configuration Language).
8 | - **Multi-Cloud Support**: Manage resources across AWS, Azure, GCP, and more.
9 | - **State Management**: Track the state of your infrastructure.
10 |
11 | ## Getting Started
12 | 1. Install Terraform:
13 | ```bash
14 | sudo apt update
15 | sudo apt install terraform
16 |
17 | 2. Create a Terraform configuration file (main.tf):
18 | ```bash
19 | provider "aws" {
20 | region = "us-east-1"
21 | }
22 |
23 | resource "aws_instance" "example" {
24 | ami = "ami-0c55b159cbfafe1f0"
25 | instance_type = "t2.micro"
26 | }
27 |
28 | 4. Apply the configuration:
29 | ```bash
30 | terraform init
31 | terraform apply
32 |
--------------------------------------------------------------------------------
/topics/tools/containerization/kubernetes/README.md:
--------------------------------------------------------------------------------
1 |
2 | # Kubernetes
3 |
4 | ## Overview
5 | Kubernetes is an open-source container orchestration platform for automating deployment, scaling, and management of containerized applications.
6 |
7 | ## Key Features
8 | - **Automated Rollouts and Rollbacks**: Deploy updates and revert changes seamlessly.
9 | - **Self-Healing**: Automatically restart failed containers.
10 | - **Service Discovery and Load Balancing**: Expose containers using DNS or IP.
11 | - **Storage Orchestration**: Mount storage systems dynamically.
12 |
13 | ## Getting Started
14 | 1. Install Minikube (for local Kubernetes):
15 | ```bash
16 | curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
17 | sudo install minikube-linux-amd64 /usr/local/bin/minikube
18 | minikube start
19 |
20 | 2. Deploy an application:
21 | ```bash
22 | kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.4
23 | kubectl expose deployment hello-minikube --type=NodePort --port=8080
24 |
--------------------------------------------------------------------------------
/topics/monitoring/metrics/grafana/README.md:
--------------------------------------------------------------------------------
1 | # Grafana
2 |
3 | ## Overview
4 | Grafana is an open-source platform for monitoring and observability, allowing you to visualize metrics, logs, and traces.
5 |
6 | ## Key Features
7 | - **Dashboards**: Create customizable dashboards for visualizing data.
8 | - **Data Source Integration**: Connect to Prometheus, InfluxDB, Elasticsearch, and more.
9 | - **Alerting**: Set up alerts based on metric thresholds.
10 |
11 | ## Getting Started
12 | 1. Install Grafana:
13 | ```bash
14 | sudo apt-get install -y apt-transport-https
15 | sudo apt-get install -y software-properties-common wget
16 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
17 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
18 | sudo apt-get update
19 | sudo apt-get install grafana
20 | sudo systemctl start grafana-server
21 | ```
22 | 2. Access Grafana at `http://localhost:3000`.
23 | 3. Add a data source (e.g., Prometheus) and create a dashboard.
24 |
--------------------------------------------------------------------------------
/topics/infrastructure/provisioning/packer/README.md:
--------------------------------------------------------------------------------
1 | # Packer
2 |
3 | ## Overview
4 | Packer is an open-source tool for creating machine images for multiple platforms from a single source configuration.
5 |
6 | ## Key Features
7 | - **Multi-Platform Support**: Create images for AWS, Azure, GCP, and more.
8 | - **Immutable Infrastructure**: Build consistent, reproducible images.
9 | - **Automation**: Integrate with CI/CD pipelines.
10 |
11 | ## Getting Started
12 | 1. Install Packer:
13 | ```bash
14 | sudo apt update
15 | sudo apt install packer
16 | ```
17 | 2. Create a Packer template (`template.json`):
18 | ```json
19 | {
20 | "builders": [
21 | {
22 | "type": "amazon-ebs",
23 | "region": "us-east-1",
24 | "source_ami": "ami-0c55b159cbfafe1f0",
25 | "instance_type": "t2.micro",
26 | "ssh_username": "ubuntu",
27 | "ami_name": "my-image-{{timestamp}}"
28 | }
29 | ]
30 | }
31 | ```
32 | 3. Build the image:
33 | ```bash
34 | packer build template.json
35 | ```
36 |
--------------------------------------------------------------------------------
/topics/cloud/multi-cloud/README.md:
--------------------------------------------------------------------------------
1 | # Multi-Cloud Strategies
2 |
3 | ## Overview
4 | Multi-cloud refers to the use of multiple cloud providers (e.g., AWS, Azure, GCP) to avoid vendor lock-in, improve resilience, and optimize costs.
5 |
6 | ## Key Benefits
7 | - **Vendor Independence**: Avoid reliance on a single provider.
8 | - **Resilience**: Distribute workloads across providers for high availability.
9 | - **Cost Optimization**: Leverage the best pricing from different providers.
10 |
11 | ## Tools for Multi-Cloud Management
12 | - **Terraform**: Infrastructure as code across multiple clouds.
13 | - **Kubernetes**: Container orchestration across clouds.
14 | - **Cloud Management Platforms (CMPs)**: Tools like CloudHealth, RightScale.
15 |
16 | ## Getting Started
17 | 1. Choose a multi-cloud tool (e.g., Terraform).
18 | 2. Define infrastructure in code:
19 | ```hcl
20 | provider "aws" {
21 | region = "us-east-1"
22 | }
23 |
24 | provider "google" {
25 | project = "my-gcp-project"
26 | region = "us-central1"
27 | }
28 | 3. Deploy resources across clouds.
29 |
--------------------------------------------------------------------------------
/topics/tools/monitoring-and-logging/grafana/README.md:
--------------------------------------------------------------------------------
1 | # Grafana
2 |
3 | ## Overview
4 | Grafana is an open-source platform for monitoring and observability, allowing you to visualize metrics, logs, and traces.
5 |
6 | ## Key Features
7 | - **Dashboards**: Create customizable dashboards for visualizing data.
8 | - **Data Source Integration**: Connect to Prometheus, InfluxDB, Elasticsearch, and more.
9 | - **Alerting**: Set up alerts based on metric thresholds.
10 |
11 | ## Getting Started
12 | 1. Install Grafana:
13 | ```bash
14 | sudo apt-get install -y apt-transport-https
15 | sudo apt-get install -y software-properties-common wget
16 | wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
17 | echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
18 | sudo apt-get update
19 | sudo apt-get install grafana
20 | sudo systemctl start grafana-server
21 |
22 | 2. Access Grafana at http://localhost:3000.
23 |
24 | 3. Add a data source (e.g., Prometheus) and create a dashboard.
25 |
--------------------------------------------------------------------------------
/topics/infrastructure/infrastructure-as-code/Ansible/README.md:
--------------------------------------------------------------------------------
1 | # Ansible
2 |
3 | ## Overview
4 | Ansible is an open-source automation tool for configuration management, application deployment, and task automation.
5 |
6 | ## Key Features
7 | - **Agentless**: Uses SSH for communication with nodes.
8 | - **Idempotent**: Ensures consistent state across multiple runs.
9 | - **YAML-Based Playbooks**: Define automation tasks in human-readable YAML.
10 |
11 | ## Getting Started
12 | 1. Install Ansible:
13 | ```bash
14 | sudo apt update
15 | sudo apt install ansible
16 | ```
17 | 2. Create an inventory file (`inventory`):
18 | ```ini
19 | [webservers]
20 | server1 ansible_host=192.168.1.10
21 | server2 ansible_host=192.168.1.11
22 | ```
23 | 3. Create a playbook (`playbook.yml`):
24 | ```yaml
25 | - hosts: webservers
26 | tasks:
27 | - name: Ensure Apache is installed
28 | apt:
29 | name: apache2
30 | state: present
31 | ```
32 | 4. Run the playbook:
33 | ```bash
34 | ansible-playbook -i inventory playbook.yml
35 | ```
36 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 Jawher Kl
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/topics/monitoring/logging/elastic-stack/README.md:
--------------------------------------------------------------------------------
1 | # Elastic Stack (ELK)
2 |
3 | ## Overview
4 | The Elastic Stack (ELK) consists of Elasticsearch, Logstash, and Kibana, and is used for searching, analyzing, and visualizing log data.
5 |
6 | ## Key Features
7 | - **Elasticsearch**: Distributed search and analytics engine.
8 | - **Logstash**: Data processing pipeline.
9 | - **Kibana**: Visualization and exploration of data.
10 |
11 | ## Getting Started
12 | 1. Install Elasticsearch:
13 | ```bash
14 | wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.15.0-amd64.deb
15 | sudo dpkg -i elasticsearch-7.15.0-amd64.deb
16 | sudo systemctl start elasticsearch
17 | ```
18 | 2. Install Logstash:
19 | ```bash
20 | wget https://artifacts.elastic.co/downloads/logstash/logstash-7.15.0.deb
21 | sudo dpkg -i logstash-7.15.0.deb
22 | sudo systemctl start logstash
23 | ```
24 | 3. Install Kibana:
25 | ```bash
26 | wget https://artifacts.elastic.co/downloads/kibana/kibana-7.15.0-amd64.deb
27 | sudo dpkg -i kibana-7.15.0-amd64.deb
28 | sudo systemctl start kibana
29 | ```
30 | 4. Access Kibana at `http://localhost:5601`.
31 |
--------------------------------------------------------------------------------
/topics/certifications/aws-certified-devops-engineer/README.md:
--------------------------------------------------------------------------------
1 | # AWS Certified DevOps Engineer - Professional
2 |
3 | ## Overview
4 | The AWS Certified DevOps Engineer - Professional certification validates your expertise in provisioning, operating, and managing distributed application systems on the AWS platform.
5 |
6 | ## Exam Details
7 | - **Duration**: 180 minutes
8 | - **Format**: Multiple-choice and multiple-response questions
9 | - **Cost**: $300 USD
10 | - **Prerequisites**: AWS Certified Developer - Associate or AWS Certified SysOps Administrator - Associate
11 |
12 | ## Exam Topics
13 | 1. **SDLC Automation**: CI/CD pipelines, infrastructure as code.
14 | 2. **Monitoring and Logging**: CloudWatch, CloudTrail, and third-party tools.
15 | 3. **Incident and Event Response**: Automating responses to incidents.
16 | 4. **High Availability and Scalability**: Designing fault-tolerant systems.
17 |
18 | ## Resources
19 | - [AWS Exam Guide](https://aws.amazon.com/certification/certified-devops-engineer-professional/)
20 | - [AWS Whitepapers](https://aws.amazon.com/whitepapers/)
21 | - [Practice Exams](https://www.whizlabs.com/aws-certified-devops-engineer-professional/)
22 |
--------------------------------------------------------------------------------
/topics/version-control/README.md:
--------------------------------------------------------------------------------
1 | # Version Control
2 |
3 | ## Introduction
4 | Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later. It is an essential tool for collaborating on software projects.
5 |
6 | ## Git Workflows
7 | Git workflows help teams collaborate on Git repositories. Some common workflows include:
8 | - **Feature Branch Workflow**
9 | - **Gitflow Workflow**
10 | - **Forking Workflow**
11 |
12 | ## Branching Strategies
13 | Branching strategies help manage the development process. Some common strategies include:
14 | - **Mainline Development**
15 | - **Feature Branching**
16 | - **Release Branching**
17 |
18 | ## Merge Request Best Practices
19 | Merge requests (or pull requests) are a critical part of the collaborative development process. Best practices include:
20 | - **Descriptive Titles and Descriptions**
21 | - **Peer Reviews**
22 | - **Automated Testing**
23 |
24 | ## Examples
25 | - [Git Workflow Example](git-workflow-example.md)
26 | - [Branching Strategy Example](branching-strategy-example.md)
27 | - [Merge Request Best Practices Example](mr-best-practices-example.md)
28 |
--------------------------------------------------------------------------------
/topics/certifications/README.md:
--------------------------------------------------------------------------------
1 | # DevOps Certifications
2 |
3 | This section provides a guide to popular DevOps certifications, including their importance, prerequisites, exam details, and resources for preparation.
4 |
5 | ## Why Get Certified?
6 | - **Validate your skills**: Certifications demonstrate your expertise in specific tools and technologies.
7 | - **Career advancement**: Many organizations prioritize certified professionals for promotions and hiring.
8 | - **Stay updated**: Certifications ensure you are up-to-date with the latest industry practices.
9 |
10 | ## Popular Certifications
11 | 1. [AWS Certified DevOps Engineer - Professional](aws-certified-devops-engineer)
12 | 2. [Certified Kubernetes Administrator (CKA)](certified-kubernetes-administrator)
13 | 3. [Docker Certified Associate](docker-certified-associate)
14 | 4. [HashiCorp Certified: Terraform Associate](terraform-associate)
15 |
16 | ---
17 |
18 | ## How to Use This Guide
19 | - Each certification has its own folder with a `README.md` file containing details about the exam and a `resources.md` file with study materials.
20 | - Use the resources provided to prepare for the exams and advance your DevOps career.
21 |
--------------------------------------------------------------------------------
/topics/cloud/gcp/README.md:
--------------------------------------------------------------------------------
1 | # Google Cloud Platform (GCP)
2 |
3 | ## Overview
4 | GCP is Google's cloud platform, offering services for computing, storage, machine learning, and data analytics.
5 |
6 | ## Key Services
7 | - **Compute**: Compute Engine, App Engine, Kubernetes Engine (GKE).
8 | - **Storage**: Cloud Storage, Persistent Disk, Cloud SQL.
9 | - **Databases**: Firestore, Bigtable, Spanner.
10 | - **Networking**: Virtual Private Cloud (VPC), Cloud Load Balancing, Cloud CDN.
11 | - **DevOps**: Cloud Build, Cloud Deployment Manager, Cloud Operations.
12 |
13 | ## Getting Started
14 | 1. Create a GCP account: [GCP Sign-Up](https://cloud.google.com/).
15 | 2. Install the Google Cloud SDK:
16 | ```bash
17 | echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
18 | sudo apt-get install apt-transport-https ca-certificates gnupg
19 | curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
20 | sudo apt-get update && sudo apt-get install google-cloud-sdk
21 | ```
22 | 3. Log in to GCP:
23 | ```bash
24 | gcloud auth login
25 | ```
26 |
--------------------------------------------------------------------------------
/topics/cloud/README.md:
--------------------------------------------------------------------------------
1 | # Cloud Computing
2 |
3 | This section provides a guide to cloud computing, including major cloud providers, their services, and best practices for using the cloud effectively.
4 |
5 | ## What is Cloud Computing?
6 | Cloud computing is the delivery of computing services (e.g., servers, storage, databases, networking, software) over the internet ("the cloud"). It enables faster innovation, flexible resources, and economies of scale.
7 |
8 | ## Benefits of Cloud Computing
9 | - **Scalability**: Easily scale resources up or down based on demand.
10 | - **Cost Efficiency**: Pay only for what you use.
11 | - **Reliability**: High availability and disaster recovery options.
12 | - **Security**: Advanced security features and compliance certifications.
13 |
14 | ## Major Cloud Providers
15 | 1. [Amazon Web Services (AWS)](#aws)
16 | 2. [Microsoft Azure](#azure)
17 | 3. [Google Cloud Platform (GCP)](#gcp)
18 | 4. [Multi-Cloud Strategies](#multi-cloud)
19 |
20 | ## How to Use This Guide
21 | - Each cloud provider has its own folder with a `README.md` file containing details about the provider and a `resources.md` file with learning materials.
22 | - Use the resources provided to master cloud computing and enhance your DevOps workflows.
23 |
--------------------------------------------------------------------------------
/topics/tools/ci-cd/github-actions/README.md:
--------------------------------------------------------------------------------
1 | # GitHub Actions
2 |
3 | ## Overview
4 | GitHub Actions is a CI/CD platform integrated directly into GitHub. It allows you to automate workflows for building, testing, and deploying your code.
5 |
6 | ## Key Features
7 | - **Event-Driven Workflows**: Trigger workflows based on GitHub events (e.g., push, pull request).
8 | - **Reusable Workflows**: Share workflows across repositories.
9 | - **Matrix Builds**: Test across multiple environments simultaneously.
10 | - **Self-Hosted Runners**: Run workflows on your own infrastructure.
11 |
12 | ## Getting Started
13 | 1. Create a `.github/workflows` directory in your repository.
14 | 2. Add a workflow file (e.g., `ci.yml`):
15 | ```yaml
16 | name: CI
17 |
18 | on:
19 | push:
20 | branches:
21 | - main
22 | pull_request:
23 | branches:
24 | - main
25 |
26 | jobs:
27 | build:
28 | runs-on: ubuntu-latest
29 | steps:
30 | - name: Checkout code
31 | uses: actions/checkout@v3
32 |
33 | - name: Set up Node.js
34 | uses: actions/setup-node@v3
35 | with:
36 | node-version: '16'
37 |
38 | - name: Install dependencies
39 | run: npm install
40 |
41 | - name: Run tests
42 | run: npm test
43 |
--------------------------------------------------------------------------------
/topics/security/trivy-example.md:
--------------------------------------------------------------------------------
1 | # Trivy Example
2 |
3 | ## Introduction
4 | Trivy is a simple and comprehensive vulnerability scanner for containers and other artifacts. It detects vulnerabilities in OS packages and application dependencies.
5 |
6 | ## Setting up Trivy
7 | 1. **Install Trivy**:
8 | ```sh
9 | sudo apt install trivy
10 | ```
11 |
12 | 2. **Verify Installation**:
13 | ```sh
14 | trivy --version
15 | ```
16 |
17 | ## Scanning Docker Images
18 | 1. **Pull a Docker Image**:
19 | ```sh
20 | docker pull your-docker-image
21 | ```
22 |
23 | 2. **Scan the Docker Image**:
24 | ```sh
25 | trivy image your-docker-image
26 | ```
27 |
28 | ## Example Configuration
29 | Create a `.trivyignore` file in the root of your project to ignore specific vulnerabilities:
30 |
31 | ```
32 | CVE-2020-15257
33 | CVE-2019-14697
34 | ```
35 |
36 | ## Integrating with CI/CD
37 | Integrate Trivy into your CI/CD pipeline to automatically scan Docker images for vulnerabilities.
38 |
39 | ### Example GitHub Actions Workflow
40 | Create a `.github/workflows/trivy.yml` file with the following content:
41 |
42 | ```yaml
43 | name: Trivy Vulnerability Scan
44 |
45 | on: [push, pull_request]
46 |
47 | jobs:
48 | trivy:
49 | runs-on: ubuntu-latest
50 | steps:
51 | - name: Checkout code
52 | uses: actions/checkout@v2
53 |
54 | - name: Set up Docker
55 | uses: docker/setup-buildx-action@v1
56 |
57 | - name: Cache Docker layers
58 | uses: actions/cache@v2
59 | with:
60 | path: /tmp/.buildx-cache
61 | key: ${{ runner.os }}-buildx-${{ github.sha }}
62 | restore-keys: |
63 | ${{ runner.os }}-buildx-
64 |
65 | - name: Scan Docker image with Trivy
66 | run: |
67 | docker pull your-docker-image
68 | trivy image your-docker-image
69 |
70 | - name: Upload Trivy report
71 | uses: actions/upload-artifact@v2
72 | with:
73 | name: trivy-report
74 | path: trivy-report.html
75 | ```
76 |
77 | ## Conclusion
78 | By integrating Trivy into your development workflow, you can continuously monitor and fix vulnerabilities, ensuring your Docker images remain secure.
79 |
--------------------------------------------------------------------------------
/topics/security/snyk-example.md:
--------------------------------------------------------------------------------
1 | # Snyk Example
2 |
3 | ## Introduction
4 | Snyk is a security tool that helps developers find and fix vulnerabilities in their dependencies, container images, Kubernetes applications, and infrastructure as code.
5 |
6 | ## Setting up Snyk
7 | 1. **Install Snyk CLI**:
8 | ```sh
9 | npm install -g snyk
10 | ```
11 |
12 | 2. **Authenticate with Snyk**:
13 | ```sh
14 | snyk auth
15 | ```
16 |
17 | ## Scanning a Project
18 | 1. **Navigate to your project directory**:
19 | ```sh
20 | cd /path/to/your/project
21 | ```
22 |
23 | 2. **Run a security test**:
24 | ```sh
25 | snyk test
26 | ```
27 |
28 | 3. **Monitor your project for vulnerabilities**:
29 | ```sh
30 | snyk monitor
31 | ```
32 |
33 | ## Example Configuration
34 | Create a `snyk.config.json` file in the root of your project with the following content:
35 |
36 | ```json
37 | {
38 | "org": "your-org-name",
39 | "token": "your-snyk-token",
40 | "projectName": "your-project-name",
41 | "files": {
42 | "package.json": {
43 | "devDependencies": true
44 | }
45 | }
46 | }
47 | ```
48 |
49 | ## Interpreting Results
50 | - **Vulnerabilities**: Snyk will output a list of vulnerabilities found in your project.
51 | - **Severity Levels**: Each vulnerability will be categorized by its severity (low, medium, high, critical).
52 | - **Fix Suggestions**: Snyk will provide suggestions on how to fix each vulnerability.
53 |
54 | ## Automating with CI/CD
55 | Integrate Snyk into your CI/CD pipeline to automatically scan your projects for vulnerabilities.
56 |
57 | ### Example GitHub Actions Workflow
58 | Create a `.github/workflows/snyk.yml` file with the following content:
59 |
60 | ```yaml
61 | name: Snyk Security Scan
62 |
63 | on: [push, pull_request]
64 |
65 | jobs:
66 | snyk:
67 | runs-on: ubuntu-latest
68 | steps:
69 | - name: Checkout code
70 | uses: actions/checkout@v2
71 |
72 | - name: Set up Node.js
73 | uses: actions/setup-node@v2
74 | with:
75 | node-version: '14'
76 |
77 | - name: Install dependencies
78 | run: npm install
79 |
80 | - name: Run Snyk to check for vulnerabilities
81 | uses: snyk/actions/setup@v1
82 | with:
83 | token: ${{ secrets.SNYK_TOKEN }}
84 |
85 | - name: Test the project
86 | run: snyk test
87 |
88 | - name: Monitor the project
89 | run: snyk monitor
90 | ```
91 |
92 | ## Conclusion
93 | By integrating Snyk into your development workflow, you can continuously monitor and fix vulnerabilities, ensuring your projects remain secure.
94 |
--------------------------------------------------------------------------------
/topics/security/owasp-zap-example.md:
--------------------------------------------------------------------------------
1 | # OWASP ZAP Example
2 |
3 | ## Introduction
4 | OWASP ZAP (Zed Attack Proxy) is an open-source security tool used for finding vulnerabilities in web applications. It is designed to be used by both security professionals and developers.
5 |
6 | ## Setting up OWASP ZAP
7 | 1. **Install OWASP ZAP**:
8 | ```sh
9 | sudo apt install zaproxy
10 | ```
11 |
12 | 2. **Start OWASP ZAP**:
13 | ```sh
14 | zap.sh
15 | ```
16 |
17 | ## Running a Security Scan
18 | 1. **Start ZAP in daemon mode**:
19 | ```sh
20 | zap.sh -daemon -config api.key=
21 | ```
22 |
23 | 2. **Run a quick scan**:
24 | ```sh
25 | zap-cli quick-scan --self-contained http://example.com
26 | ```
27 |
28 | ## Example Configuration
29 | Create a `zap-config.yaml` file with the following content:
30 |
31 | ```yaml
32 | zap:
33 | target: "http://example.com"
34 | context: "Default Context"
35 | apiKey: ""
36 | session: "zap_session.session"
37 | scanPolicyName: "Default Policy"
38 | spider:
39 | maxDepth: 5
40 | threadCount: 10
41 | ajaxSpider:
42 | maxCrawlDepth: 3
43 | maxCrawlStates: 20
44 | activeScan:
45 | policy: "Default Policy"
46 | threadCount: 5
47 | ```
48 |
49 | ## Automating with CI/CD
50 | Integrate OWASP ZAP into your CI/CD pipeline to automatically scan your web applications for vulnerabilities.
51 |
52 | ### Example GitHub Actions Workflow
53 | Create a `.github/workflows/owasp-zap.yml` file with the following content:
54 |
55 | ```yaml
56 | name: OWASP ZAP Security Scan
57 |
58 | on: [push, pull_request]
59 |
60 | jobs:
61 | zap:
62 | runs-on: ubuntu-latest
63 | steps:
64 | - name: Checkout code
65 | uses: actions/checkout@v2
66 |
67 | - name: Set up Java
68 | uses: actions/setup-java@v2
69 | with:
70 | java-version: '11'
71 |
72 | - name: Install OWASP ZAP
73 | run: sudo apt install zaproxy
74 |
75 | - name: Start OWASP ZAP in daemon mode
76 | run: zap.sh -daemon -config api.key=${{ secrets.ZAP_API_KEY }}
77 |
78 | - name: Run OWASP ZAP scan
79 | run: |
80 | zap-cli quick-scan --self-contained http://example.com
81 | zap-cli report -o zap_report.html -f html
82 |
83 | - name: Upload ZAP report
84 | uses: actions/upload-artifact@v2
85 | with:
86 | name: zap-report
87 | path: zap_report.html
88 | ```
89 |
90 | ## Conclusion
91 | By integrating OWASP ZAP into your development workflow, you can continuously monitor and fix vulnerabilities, ensuring your web applications remain secure.
92 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | lerna-debug.log*
8 | .pnpm-debug.log*
9 |
10 | # Diagnostic reports (https://nodejs.org/api/report.html)
11 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
12 |
13 | # Runtime data
14 | pids
15 | *.pid
16 | *.seed
17 | *.pid.lock
18 |
19 | # Directory for instrumented libs generated by jscoverage/JSCover
20 | lib-cov
21 |
22 | # Coverage directory used by tools like istanbul
23 | coverage
24 | *.lcov
25 |
26 | # nyc test coverage
27 | .nyc_output
28 |
29 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30 | .grunt
31 |
32 | # Bower dependency directory (https://bower.io/)
33 | bower_components
34 |
35 | # node-waf configuration
36 | .lock-wscript
37 |
38 | # Compiled binary addons (https://nodejs.org/api/addons.html)
39 | build/Release
40 |
41 | # Dependency directories
42 | node_modules/
43 | jspm_packages/
44 |
45 | # Snowpack dependency directory (https://snowpack.dev/)
46 | web_modules/
47 |
48 | # TypeScript cache
49 | *.tsbuildinfo
50 |
51 | # Optional npm cache directory
52 | .npm
53 |
54 | # Optional eslint cache
55 | .eslintcache
56 |
57 | # Optional stylelint cache
58 | .stylelintcache
59 |
60 | # Microbundle cache
61 | .rpt2_cache/
62 | .rts2_cache_cjs/
63 | .rts2_cache_es/
64 | .rts2_cache_umd/
65 |
66 | # Optional REPL history
67 | .node_repl_history
68 |
69 | # Output of 'npm pack'
70 | *.tgz
71 |
72 | # Yarn Integrity file
73 | .yarn-integrity
74 |
75 | # dotenv environment variable files
76 | .env
77 | .env.development.local
78 | .env.test.local
79 | .env.production.local
80 | .env.local
81 |
82 | # parcel-bundler cache (https://parceljs.org/)
83 | .cache
84 | .parcel-cache
85 |
86 | # Next.js build output
87 | .next
88 | out
89 |
90 | # Nuxt.js build / generate output
91 | .nuxt
92 | dist
93 |
94 | # Gatsby files
95 | .cache/
96 | # Comment in the public line in if your project uses Gatsby and not Next.js
97 | # https://nextjs.org/blog/next-9-1#public-directory-support
98 | # public
99 |
100 | # vuepress build output
101 | .vuepress/dist
102 |
103 | # vuepress v2.x temp and cache directory
104 | .temp
105 | .cache
106 |
107 | # Docusaurus cache and generated files
108 | .docusaurus
109 |
110 | # Serverless directories
111 | .serverless/
112 |
113 | # FuseBox cache
114 | .fusebox/
115 |
116 | # DynamoDB Local files
117 | .dynamodb/
118 |
119 | # TernJS port file
120 | .tern-port
121 |
122 | # Stores VSCode versions used for testing VSCode extensions
123 | .vscode-test
124 |
125 | # yarn v2
126 | .yarn/cache
127 | .yarn/unplugged
128 | .yarn/build-state.yml
129 | .yarn/install-state.gz
130 | .pnp.*
--------------------------------------------------------------------------------
/topics/ci-cd/gitlab-ci/README.md:
--------------------------------------------------------------------------------
1 | ### GitLab CI/CD Pipeline Example
2 |
3 | This example demonstrates a basic GitLab CI/CD pipeline for a Node.js application.
4 |
5 | ## Overview
6 | GitLab CI/CD is a continuous integration and continuous delivery tool built into GitLab. It automates the process of building, testing, and deploying your code. This example provides a basic configuration for setting up a CI/CD pipeline using GitLab CI/CD for a Node.js application.
7 |
8 | ### Prerequisites
9 | - A Node.js application
10 | - GitLab account
11 | - GitLab project setup
12 |
13 | ### Configuration File: `.gitlab-ci.yml`
14 | ```yaml
15 | stages:
16 | - build
17 | - test
18 | - deploy
19 |
20 | build:
21 | stage: build
22 | script:
23 | - npm install
24 |
25 | test:
26 | stage: test
27 | script:
28 | - npm test
29 |
30 | deploy:
31 | stage: deploy
32 | script:
33 | - npm run deploy
34 | ```
35 |
36 | ### Explanation
37 | - **stages**: Defines the stages of the pipeline.
38 | - **build**: The build stage where dependencies are installed.
39 | - **test**: The test stage where tests are run.
40 | - **deploy**: The deploy stage where the application is deployed.
41 | - **build**: Defines the build job.
42 | - **stage**: Specifies the stage to which this job belongs.
43 | - **script**: The commands to be executed for this job.
44 | - **test**: Defines the test job.
45 | - **stage**: Specifies the stage to which this job belongs.
46 | - **script**: The commands to be executed for this job.
47 | - **deploy**: Defines the deploy job.
48 | - **stage**: Specifies the stage to which this job belongs.
49 | - **script**: The commands to be executed for this job.
50 |
51 | ### Additional Configuration Examples
52 |
53 | #### Example 1: Adding Environment Variables
54 |
55 | ```yaml
56 | stages:
57 | - build
58 | - test
59 | - deploy
60 |
61 | variables:
62 | NODE_ENV: production
63 |
64 | build:
65 | stage: build
66 | script:
67 | - npm install
68 |
69 | test:
70 | stage: test
71 | script:
72 | - npm test
73 |
74 | deploy:
75 | stage: deploy
76 | script:
77 | - npm run deploy
78 | ```
79 |
80 | #### Example 2: Using Docker for Build Environment
81 |
82 | ```yaml
83 | image: node:14
84 |
85 | stages:
86 | - build
87 | - test
88 | - deploy
89 |
90 | build:
91 | stage: build
92 | script:
93 | - npm install
94 |
95 | test:
96 | stage: test
97 | script:
98 | - npm test
99 |
100 | deploy:
101 | stage: deploy
102 | script:
103 | - npm run deploy
104 | ```
105 |
106 | These additional examples show how to add environment variables and use Docker as a build environment to optimize your CI/CD pipeline.
107 |
108 | ### Conclusion
109 | This guide provides a basic setup for a GitLab CI/CD pipeline for a Node.js application. By customizing the `.gitlab-ci.yml` file, you can tailor the CI/CD process to fit the specific needs of your project.
110 |
--------------------------------------------------------------------------------
/topics/security/README.md:
--------------------------------------------------------------------------------
1 | # Security in DevOps
2 |
3 | ## Introduction
4 | Security is a critical aspect of DevOps, often referred to as DevSecOps. Integrating security practices into the DevOps workflow ensures that security is considered at every stage of the development and deployment process. This approach helps identify and mitigate security vulnerabilities early and continuously.
5 |
6 | ## Best Practices for DevSecOps
7 | - **Shift-Left Security**: Incorporate security early in the development process.
8 | - **Continuous Monitoring**: Regularly monitor applications and infrastructure for security threats.
9 | - **Automated Security Testing**: Integrate automated security tests into the CI/CD pipeline.
10 | - **Use of Security Tools**: Leverage tools to identify and address vulnerabilities.
11 |
12 | ## Tools for DevSecOps
13 | ### Snyk
14 | Snyk is a developer-first security tool that helps find and fix vulnerabilities in dependencies, container images, Kubernetes applications, and infrastructure as code.
15 |
16 | #### Example Usage
17 | 1. **Setting up Snyk**:
18 | ```sh
19 | npm install -g snyk
20 | snyk auth
21 | ```
22 | 2. **Scanning a Project**:
23 | ```sh
24 | snyk test
25 | ```
26 | 3. **Monitoring a Project**:
27 | ```sh
28 | snyk monitor
29 | ```
30 |
31 | ### OWASP ZAP
32 | OWASP ZAP (Zed Attack Proxy) is an open-source security tool for finding vulnerabilities in web applications.
33 |
34 | #### Example Usage
35 | 1. **Installing OWASP ZAP**:
36 | ```sh
37 | sudo apt install zaproxy
38 | ```
39 | 2. **Running a Security Scan**:
40 | ```sh
41 | zap.sh -daemon -config api.key=
42 | zap-cli quick-scan --self-contained http://example.com
43 | ```
44 | 3. **Automating with CI/CD**:
45 | - Add OWASP ZAP to your CI/CD pipeline to automatically scan web applications.
46 |
47 | ### Trivy
48 | Trivy is a simple and comprehensive vulnerability scanner for containers and other artifacts.
49 |
50 | #### Example Usage
51 | 1. **Installing Trivy**:
52 | ```sh
53 | sudo apt install trivy
54 | ```
55 | 2. **Scanning Docker Images**:
56 | ```sh
57 | trivy image
58 | ```
59 | 3. **Integrating with CI/CD**:
60 | - Use Trivy in your CI/CD pipeline to scan Docker images for vulnerabilities.
61 |
62 | ## Example Implementations
63 | ### Snyk Example
64 | - [Snyk Example Implementation](snyk-example.md)
65 |
66 | ### OWASP ZAP Example
67 | - [OWASP ZAP Example Implementation](owasp-zap-example.md)
68 |
69 | ### Trivy Example
70 | - [Trivy Example Implementation](trivy-example.md)
71 |
72 | ## Conclusion
73 | Integrating security into DevOps practices is essential for building robust and secure applications. By following best practices and using the right tools, you can ensure that security is a continuous and integral part of your development workflow.
74 |
75 | ## References
76 | - [Snyk Documentation](https://snyk.io/docs/)
77 | - [OWASP ZAP Documentation](https://www.zaproxy.org/)
78 | - [Trivy Documentation](https://github.com/aquasecurity/trivy)
79 |
--------------------------------------------------------------------------------
/topics/ci-cd/README.md:
--------------------------------------------------------------------------------
1 | # Continuous Integration & Continuous Deployment (CI/CD)
2 |
3 | Gain a comprehensive understanding of Continuous Integration and Continuous Deployment (CI/CD) concepts and tools. This guide provides practical insights and demo pipeline setups to help you implement CI/CD practices effectively.
4 |
5 | ## Table of Contents
6 |
7 | - [Introduction](#introduction)
8 | - [Concepts](#concepts)
9 | - [Popular CI/CD Tools](#popular-cicd-tools)
10 | - [Jenkins](#jenkins)
11 | - [GitHub Actions](#github-actions)
12 | - [GitLab CI/CD](#gitlab-cicd)
13 | - [CircleCI](#circleci)
14 | - [Demo Pipeline Setups](#demo-pipeline-setups)
15 | - [Conclusion](#conclusion)
16 |
17 | ## Introduction
18 |
19 | Continuous Integration (CI) and Continuous Deployment (CD) are essential practices in DevOps that enable teams to deliver code changes more frequently and reliably. This section covers the fundamental concepts of CI/CD and dives into popular tools used to automate these processes.
20 |
21 | ## Concepts
22 |
23 | - **Continuous Integration (CI)**: The practice of automatically integrating code changes from multiple contributors into a shared repository several times a day.
24 | - **Continuous Deployment (CD)**: The process of automatically deploying every change that passes all stages of the production pipeline to the end-users.
25 |
26 | ## Popular CI/CD Tools
27 |
28 | ### Jenkins
29 |
30 | Jenkins is an open-source automation server that enables developers to build, test, and deploy their applications. It supports a wide range of plugins to integrate with various tools and technologies.
31 |
32 | ### GitHub Actions
33 |
34 | GitHub Actions is a CI/CD tool that allows you to automate your workflows directly from your GitHub repository. It provides a simple way to build, test, and deploy code using YAML configuration files.
35 |
36 | ### GitLab CI/CD
37 |
38 | GitLab CI/CD is a built-in part of GitLab that provides powerful continuous integration and deployment capabilities. It uses a simple syntax to define CI/CD pipelines in a `.gitlab-ci.yml` file.
39 |
40 | ### CircleCI
41 |
42 | CircleCI is a cloud-based CI/CD tool that automates the process of software development. It integrates seamlessly with GitHub and provides fast and reliable builds and deployments.
43 |
44 | ## Demo Pipeline Setups
45 |
46 | This section provides step-by-step guides to setting up demo CI/CD pipelines for a sample application. The demos include configuration files and scripts for each CI/CD tool to demonstrate the entire process from code integration to deployment.
47 |
48 | - [Jenkins Example Pipeline](jenkins/README.md)
49 | - [GitHub Actions Example Pipeline](github-actions/README.md)
50 | - [GitLab CI/CD Example Pipeline](gitlab-ci/README.md)
51 | - [CircleCI Example Pipeline](circleci/README.md)
52 |
53 | ## Conclusion
54 |
55 | Implementing CI/CD practices can significantly improve the efficiency and reliability of your software development process. By understanding the concepts and leveraging the right tools, you can automate the integration and deployment of your code, ensuring faster delivery and higher quality.
--------------------------------------------------------------------------------
/topics/ci-cd/jenkins/README.md:
--------------------------------------------------------------------------------
1 | ### Jenkins CI/CD Pipeline Example
2 |
3 | This example demonstrates a basic Jenkins pipeline for a Node.js application.
4 |
5 | ## Overview
6 |
7 | Jenkins is an open-source automation server that enables developers to build, test, and deploy their software. This example provides a basic configuration for setting up a CI/CD pipeline using Jenkins for a Node.js application.
8 |
9 | ### Prerequisites
10 |
11 | - A Node.js application
12 | - Jenkins installed and configured
13 | - Jenkins project setup
14 |
15 | ### Configuration File: `Jenkinsfile`
16 |
17 | ```groovy
18 | pipeline {
19 | agent any
20 |
21 | stages {
22 | stage('Build') {
23 | steps {
24 | sh 'npm install'
25 | }
26 | }
27 | stage('Test') {
28 | steps {
29 | sh 'npm test'
30 | }
31 | }
32 | stage('Deploy') {
33 | steps {
34 | sh 'npm run deploy'
35 | }
36 | }
37 | }
38 | }
39 | ```
40 |
41 | ### Explanation
42 |
43 | - **pipeline**: Defines the pipeline structure.
44 | - **agent**: Specifies where the pipeline or a specific stage runs. `any` means it runs on any available agent.
45 | - **stages**: Contains a sequence of stages to be executed.
46 | - **stage('Build')**: The build stage installs the project dependencies.
47 | - **stage('Test')**: The test stage runs the project's tests.
48 | - **stage('Deploy')**: The deploy stage deploys the application.
49 |
50 | ### Additional Configuration Examples
51 |
52 | #### Example 1: Using Docker for Build Environment
53 |
54 | ```groovy
55 | pipeline {
56 | agent {
57 | docker {
58 | image 'node:14'
59 | }
60 | }
61 |
62 | stages {
63 | stage('Build') {
64 | steps {
65 | sh 'npm install'
66 | }
67 | }
68 | stage('Test') {
69 | steps {
70 | sh 'npm test'
71 | }
72 | }
73 | stage('Deploy') {
74 | steps {
75 | sh 'npm run deploy'
76 | }
77 | }
78 | }
79 | }
80 | ```
81 |
82 | #### Example 2: Adding Post Actions
83 |
84 | ```groovy
85 | pipeline {
86 | agent any
87 |
88 | stages {
89 | stage('Build') {
90 | steps {
91 | sh 'npm install'
92 | }
93 | }
94 | stage('Test') {
95 | steps {
96 | sh 'npm test'
97 | }
98 | }
99 | stage('Deploy') {
100 | steps {
101 | sh 'npm run deploy'
102 | }
103 | }
104 | }
105 |
106 | post {
107 | success {
108 | echo 'Pipeline succeeded!'
109 | }
110 | failure {
111 | echo 'Pipeline failed!'
112 | }
113 | }
114 | }
115 | ```
116 |
117 | These additional examples show how to use Docker as a build environment and how to add post actions to the pipeline to handle success and failure cases.
118 |
119 | ### Conclusion
120 |
121 | This guide provides a basic setup for a Jenkins pipeline for a Node.js application. By customizing the `Jenkinsfile`, you can tailor the CI/CD process to fit the specific needs of your project.
122 |
--------------------------------------------------------------------------------
/topics/case-studies/README.md:
--------------------------------------------------------------------------------
1 | # Case Studies
2 | Explore real-world scenarios that demonstrate effective problem-solving using DevOps practices. These case studies highlight diverse challenges and the innovative solutions employed by teams to overcome them.
3 |
4 | ## Table of Contents
5 | - [Introduction](#introduction)
6 | - [Case Study 1: Continuous Integration and Continuous Deployment (CI/CD)](#case-study-1-continuous-integration-and-continuous-deployment-cicd)
7 | - [Case Study 2: Infrastructure as Code (IaC)](#case-study-2-infrastructure-as-code-iac)
8 | - [Case Study 3: Monitoring and Logging](#case-study-3-monitoring-and-logging)
9 | - [Case Study 4: Security Integration in DevOps](#case-study-4-security-integration-in-devops)
10 | - [Conclusion](#conclusion)
11 |
12 | ## Introduction
13 | This section of the repository is dedicated to providing detailed case studies that illustrate how various DevOps practices can be applied to solve real-world problems. Each case study includes an overview of the problem, the approach taken, the tools and technologies used, and the outcomes achieved.
14 |
15 | ## Case Study 1: Continuous Integration and Continuous Deployment (CI/CD)
16 | ### Problem
17 | The team was facing frequent integration issues and deployment bottlenecks, leading to delays in releasing new features.
18 |
19 | ### Solution
20 | - Implemented a CI/CD pipeline using Jenkins and GitHub Actions.
21 | - Automated testing and deployment processes.
22 | - Enhanced collaboration between development and operations teams.
23 |
24 | ### Outcome
25 | - Reduced integration issues by 80%.
26 | - Accelerated release cycles from bi-weekly to daily deployments.
27 |
28 | ## Case Study 2: Infrastructure as Code (IaC)
29 |
30 | ### Problem
31 | Manual infrastructure management was leading to inconsistencies and prolonged setup times.
32 |
33 | ### Solution
34 | - Adopted Infrastructure as Code (IaC) using Terraform.
35 | - Standardized infrastructure configurations.
36 | - Enabled version control for infrastructure changes.
37 |
38 | ### Outcome
39 | - Achieved consistent and reproducible environments.
40 | - Reduced infrastructure provisioning time by 70%.
41 |
42 | ## Case Study 3: Monitoring and Logging
43 |
44 | ### Problem
45 | Lack of visibility into system performance and application logs was hindering incident response.
46 |
47 | ### Solution
48 | - Integrated monitoring tools such as Prometheus and Grafana.
49 | - Implemented centralized logging using ELK stack (Elasticsearch, Logstash, Kibana).
50 | - Set up alerting for critical metrics and logs.
51 |
52 | ### Outcome
53 | - Improved system visibility and proactive monitoring.
54 | - Decreased mean time to resolution (MTTR) for incidents by 60%.
55 |
56 | ## Case Study 4: Security Integration in DevOps
57 |
58 | ### Problem
59 | Security vulnerabilities were being identified late in the development process, causing costly fixes.
60 |
61 | ### Solution
62 | - Integrated security practices into the CI/CD pipeline.
63 | - Conducted regular security scans using tools like OWASP ZAP and Snyk.
64 | - Fostered a security-first mindset within the development team.
65 |
66 | ### Outcome
67 | - Reduced security vulnerabilities in production by 50%.
68 | - Enhanced overall security posture of the applications.
69 |
70 | ## Conclusion
71 | These case studies provide valuable insights into the practical application of DevOps practices to solve real-world challenges. By adopting these practices, teams can enhance their efficiency, collaboration, and overall effectiveness in delivering high-quality software.
72 |
--------------------------------------------------------------------------------
/topics/container/README.md:
--------------------------------------------------------------------------------
1 | ### Containerization and Orchestration
2 |
3 | This section provides comprehensive guides and tutorials on containerization and orchestration using Docker, Kubernetes, and Helm.
4 |
5 | ## Overview
6 |
7 | Containerization and orchestration are essential concepts in modern DevOps practices. This section covers the basics and advanced topics of Docker, Kubernetes, and Helm, providing practical examples and best practices.
8 |
9 | ### Proposed Subsections
10 |
11 | 1. Docker Basics
12 | 2. Advanced Docker Topics
13 | 3. Kubernetes Basics
14 | 4. Kubernetes Advanced Topics
15 | 5. Helm Charts and Best Practices
16 |
17 | ## Docker Basics
18 |
19 | Learn the fundamentals of Docker, including installation, creating Dockerfiles, and managing containers.
20 |
21 | ### Installation
22 |
23 | - Step-by-step guide to install Docker on various operating systems.
24 |
25 | ### Creating Dockerfiles
26 |
27 | - How to write Dockerfiles to containerize applications.
28 | - Examples of Dockerfiles for different programming languages.
29 |
30 | ### Managing Containers
31 |
32 | - Commands to manage Docker containers.
33 | - Best practices for managing container lifecycles.
34 |
35 | ## Advanced Docker Topics
36 |
37 | Dive deeper into Docker with advanced topics such as networking, volume management, and Docker Compose.
38 |
39 | ### Networking
40 |
41 | - Understanding Docker networking.
42 | - Configuring bridge and overlay networks.
43 |
44 | ### Volume Management
45 |
46 | - How to manage data with Docker volumes.
47 | - Persistent storage options for containers.
48 |
49 | ### Docker Compose
50 |
51 | - Writing `docker-compose.yml` files.
52 | - Multi-container applications with Docker Compose.
53 |
54 | ## Kubernetes Basics
55 |
56 | An introduction to Kubernetes, covering core concepts, installation, and basic usage.
57 |
58 | ### Core Concepts
59 |
60 | - Overview of Kubernetes architecture.
61 | - Understanding Pods, Nodes, and Clusters.
62 |
63 | ### Installation
64 |
65 | - Installing Kubernetes on various platforms.
66 | - Setting up a local Kubernetes cluster with Minikube.
67 |
68 | ### Basic Usage
69 |
70 | - Creating and managing Pods.
71 | - Deployments, Services, and ConfigMaps.
72 |
73 | ## Kubernetes Advanced Topics
74 |
75 | Explore advanced Kubernetes topics such as RBAC, networking, and monitoring.
76 |
77 | ### Role-Based Access Control (RBAC)
78 |
79 | - Setting up RBAC in Kubernetes.
80 | - Best practices for managing permissions.
81 |
82 | ### Networking
83 |
84 | - Kubernetes networking model.
85 | - Configuring Ingress controllers.
86 |
87 | ### Monitoring
88 |
89 | - Tools for monitoring Kubernetes clusters.
90 | - Setting up Prometheus and Grafana for monitoring.
91 |
92 | ## Helm Charts and Best Practices
93 |
94 | Guides on using Helm to manage Kubernetes applications and best practices for Helm chart development.
95 |
96 | ### Introduction to Helm
97 |
98 | - What is Helm and why use it?
99 | - Installing and configuring Helm.
100 |
101 | ### Creating Helm Charts
102 |
103 | - Writing Helm charts for Kubernetes applications.
104 | - Packaging and deploying Helm charts.
105 |
106 | ### Best Practices
107 |
108 | - Versioning and managing Helm charts.
109 | - Using Helm for CI/CD pipelines.
110 |
111 | ### Conclusion
112 |
113 | This section provides a comprehensive guide to containerization and orchestration using Docker, Kubernetes, and Helm. By following the tutorials and best practices, you will be able to effectively manage containerized applications and Kubernetes clusters.
114 |
--------------------------------------------------------------------------------
/topics/ci-cd/circleci/README.md:
--------------------------------------------------------------------------------
1 | ### CircleCI CI/CD Pipeline Example
2 |
3 | This example demonstrates a basic CircleCI pipeline for a Node.js application.
4 |
5 | ## Overview
6 |
7 | CircleCI is a continuous integration and continuous delivery (CI/CD) platform that automates the process of building, testing, and deploying your code. This example provides a basic configuration for setting up a CI/CD pipeline using CircleCI for a Node.js application.
8 |
9 | ### Prerequisites
10 |
11 | - A Node.js application
12 | - CircleCI account
13 | - CircleCI project setup
14 |
15 | ### Configuration File: `.circleci/config.yml`
16 |
17 | ```yaml
18 | version: 2.1
19 |
20 | jobs:
21 | build:
22 | docker:
23 | - image: circleci/node:14
24 | steps:
25 | - checkout
26 | - run:
27 | name: Install dependencies
28 | command: npm install
29 | - run:
30 | name: Run tests
31 | command: npm test
32 | - run:
33 | name: Deploy application
34 | command: npm run deploy
35 |
36 | workflows:
37 | version: 2
38 | build_and_deploy:
39 | jobs:
40 | - build
41 | ```
42 |
43 | ### Explanation
44 |
45 | - **version**: Specifies the CircleCI configuration version.
46 | - **jobs**: Defines a sequence of steps to be executed. In this example, there is one job named `build`.
47 | - **docker**: Specifies the Docker image to use for the job. Here, it uses `circleci/node:14`.
48 | - **steps**: Lists the steps to be performed in the job.
49 | - **checkout**: Checks out the source code.
50 | - **run**: Executes the specified commands. The example includes installing dependencies, running tests, and deploying the application.
51 | - **workflows**: Defines a workflow named `build_and_deploy` that runs the `build` job.
52 |
53 | ### Additional Configuration Examples
54 |
55 | #### Example 1: Adding Environment Variables
56 |
57 | ```yaml
58 | version: 2.1
59 |
60 | jobs:
61 | build:
62 | docker:
63 | - image: circleci/node:14
64 | environment:
65 | NODE_ENV: production
66 | steps:
67 | - checkout
68 | - run:
69 | name: Install dependencies
70 | command: npm install
71 | - run:
72 | name: Run tests
73 | command: npm test
74 | - run:
75 | name: Deploy application
76 | command: npm run deploy
77 |
78 | workflows:
79 | version: 2
80 | build_and_deploy:
81 | jobs:
82 | - build
83 | ```
84 |
85 | #### Example 2: Parallel Job Execution
86 |
87 | ```yaml
88 | version: 2.1
89 |
90 | jobs:
91 | build:
92 | docker:
93 | - image: circleci/node:14
94 | steps:
95 | - checkout
96 | - run:
97 | name: Install dependencies
98 | command: npm install
99 |
100 | test:
101 | docker:
102 | - image: circleci/node:14
103 | steps:
104 | - checkout
105 | - run:
106 | name: Run tests
107 | command: npm test
108 |
109 | deploy:
110 | docker:
111 | - image: circleci/node:14
112 | steps:
113 | - checkout
114 | - run:
115 | name: Deploy application
116 | command: npm run deploy
117 |
118 | workflows:
119 | version: 2
120 | build_test_deploy:
121 | jobs:
122 | - build
123 | - test
124 | - deploy
125 | ```
126 |
127 | These additional examples show how to add environment variables and run jobs in parallel to optimize your CI/CD pipeline.
128 |
129 | ### Conclusion
130 |
131 | This guide provides a basic setup for a CircleCI pipeline for a Node.js application. By customizing the `config.yml` file, you can tailor the CI/CD process to fit the specific needs of your project.
132 |
--------------------------------------------------------------------------------
/topics/container/helm/README.md:
--------------------------------------------------------------------------------
1 |
2 | ### Helm
3 |
4 | This section provides comprehensive guides and tutorials on Helm, covering basics to advanced topics.
5 |
6 | ## Overview
7 |
8 | Helm is a package manager for Kubernetes that helps you define, install, and upgrade complex Kubernetes applications. This section covers Helm installation, creating Helm charts, and best practices for managing Helm charts.
9 |
10 | ### Proposed Subsections
11 |
12 | 1. Helm Basics
13 | 2. Creating Helm Charts
14 | 3. Best Practices
15 |
16 | ## Helm Basics
17 |
18 | Learn the fundamentals of Helm, including installation and basic usage.
19 |
20 | ### Installation
21 |
22 | - Step-by-step guide to install Helm on various operating systems.
23 |
24 | #### Example
25 |
26 | ```bash
27 | # Install Helm on Ubuntu
28 | curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
29 | ```
30 |
31 | ### Basic Usage
32 |
33 | - Helm commands to manage charts and releases.
34 | - How to search for and install charts from repositories.
35 |
36 | #### Example Commands
37 |
38 | ```bash
39 | # Add a Helm repository
40 | helm repo add stable https://charts.helm.sh/stable
41 |
42 | # Update Helm repositories
43 | helm repo update
44 |
45 | # Install a chart
46 | helm install my-release stable/nginx
47 |
48 | # List releases
49 | helm list
50 | ```
51 |
52 | ## Creating Helm Charts
53 |
54 | Learn how to create your own Helm charts to package Kubernetes applications.
55 |
56 | ### Chart Structure
57 |
58 | - Overview of the Helm chart structure and files.
59 |
60 | #### Example Structure
61 |
62 | ```
63 | mychart/
64 | Chart.yaml
65 | values.yaml
66 | templates/
67 | deployment.yaml
68 | service.yaml
69 | ```
70 |
71 | ### Writing Templates
72 |
73 | - How to write templates for Kubernetes resources.
74 | - Using Go templating syntax in Helm charts.
75 |
76 | #### Example Deployment Template
77 |
78 | ```yaml
79 | apiVersion: apps/v1
80 | kind: Deployment
81 | metadata:
82 | name: {{ .Release.Name }}
83 | spec:
84 | replicas: {{ .Values.replicas }}
85 | selector:
86 | matchLabels:
87 | app: {{ .Release.Name }}
88 | template:
89 | metadata:
90 | labels:
91 | app: {{ .Release.Name }}
92 | spec:
93 | containers:
94 | - name: {{ .Chart.Name }}
95 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
96 | ports:
97 | - containerPort: 80
98 | ```
99 |
100 | ## Best Practices
101 |
102 | Guidelines and best practices for developing and managing Helm charts.
103 |
104 | ### Versioning
105 |
106 | - How to version Helm charts and manage dependencies.
107 |
108 | ### Security
109 |
110 | - Best practices for securing Helm charts and releases.
111 |
112 | ### CI/CD Integration
113 |
114 | - Integrating Helm with CI/CD pipelines for automated deployments.
115 |
116 | #### Example CI/CD Pipeline
117 |
118 | ```yaml
119 | name: CI Pipeline
120 |
121 | on:
122 | push:
123 | branches:
124 | - main
125 |
126 | jobs:
127 | build:
128 | runs-on: ubuntu-latest
129 |
130 | steps:
131 | - name: Checkout code
132 | uses: actions/checkout@v2
133 |
134 | - name: Set up Helm
135 | run: |
136 | curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
137 |
138 | - name: Lint Helm chart
139 | run: helm lint mychart
140 |
141 | - name: Package Helm chart
142 | run: helm package mychart
143 | ```
144 |
145 | ### Conclusion
146 |
147 | This section provides a comprehensive guide to Helm, covering installation, basics, and advanced topics. By following these tutorials and best practices, you will be able to effectively manage Kubernetes applications using Helm.
148 |
--------------------------------------------------------------------------------
/topics/ci-cd/github-actions/README.md:
--------------------------------------------------------------------------------
1 | ### GitHub Actions CI/CD Pipeline Example
2 |
3 | This example demonstrates a basic GitHub Actions pipeline for a Node.js application.
4 |
5 | ## Overview
6 |
7 | GitHub Actions is a powerful CI/CD platform integrated directly into GitHub. It allows you to automate the process of building, testing, and deploying your code. This example provides a basic configuration for setting up a CI/CD pipeline using GitHub Actions for a Node.js application.
8 |
9 | ### Prerequisites
10 |
11 | - A Node.js application
12 | - GitHub repository
13 |
14 | ### Configuration File: `.github/workflows/ci.yml`
15 |
16 | ```yaml
17 | name: CI Pipeline
18 |
19 | on:
20 | push:
21 | branches:
22 | - main
23 |
24 | jobs:
25 | build:
26 | runs-on: ubuntu-latest
27 |
28 | steps:
29 | - name: Checkout code
30 | uses: actions/checkout@v2
31 |
32 | - name: Set up Node.js
33 | uses: actions/setup-node@v2
34 | with:
35 | node-version: '14'
36 |
37 | - name: Install dependencies
38 | run: npm install
39 |
40 | - name: Run tests
41 | run: npm test
42 | ```
43 |
44 | ### Explanation
45 |
46 | - **name**: Specifies the name of the workflow.
47 | - **on**: Defines the events that trigger the workflow. This example triggers on `push` events to the `main` branch.
48 | - **jobs**: Contains the jobs to be executed.
49 | - **build**: Defines the build job.
50 | - **runs-on**: Specifies the type of runner to use.
51 | - **steps**: Lists the sequence of steps to be executed in the job.
52 | - **Checkout code**: Checks out the source code.
53 | - **Set up Node.js**: Sets up the Node.js environment.
54 | - **Install dependencies**: Installs project dependencies.
55 | - **Run tests**: Runs the project's tests.
56 |
57 | ### Additional Configuration Examples
58 |
59 | #### Example 1: Adding Environment Variables
60 |
61 | ```yaml
62 | name: CI Pipeline
63 |
64 | on:
65 | push:
66 | branches:
67 | - main
68 |
69 | jobs:
70 | build:
71 | runs-on: ubuntu-latest
72 |
73 | steps:
74 | - name: Checkout code
75 | uses: actions/checkout@v2
76 |
77 | - name: Set up Node.js
78 | uses: actions/setup-node@v2
79 | with:
80 | node-version: '14'
81 |
82 | - name: Set environment variables
83 | run: |
84 | echo "NODE_ENV=production" >> $GITHUB_ENV
85 |
86 | - name: Install dependencies
87 | run: npm install
88 |
89 | - name: Run tests
90 | run: npm test
91 | ```
92 |
93 | #### Example 2: Running Jobs in Parallel
94 |
95 | ```yaml
96 | name: CI Pipeline
97 |
98 | on:
99 | push:
100 | branches:
101 | - main
102 |
103 | jobs:
104 | build:
105 | runs-on: ubuntu-latest
106 |
107 | steps:
108 | - name: Checkout code
109 | uses: actions/checkout@v2
110 |
111 | - name: Set up Node.js
112 | uses: actions/setup-node@v2
113 | with:
114 | node-version: '14'
115 |
116 | - name: Install dependencies
117 | run: npm install
118 |
119 | test:
120 | runs-on: ubuntu-latest
121 |
122 | steps:
123 | - name: Checkout code
124 | uses: actions/checkout@v2
125 |
126 | - name: Set up Node.js
127 | uses: actions/setup-node@v2
128 | with:
129 | node-version: '14'
130 |
131 | - name: Run tests
132 | run: npm test
133 | ```
134 |
135 | These additional examples show how to add environment variables and run jobs in parallel to optimize your CI/CD pipeline.
136 |
137 | ### Conclusion
138 |
139 | This guide provides a basic setup for a GitHub Actions pipeline for a Node.js application. By customizing the `.github/workflows/ci.yml` file, you can tailor the CI/CD process to fit the specific needs of your project.
140 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # DevOps Guide
2 |
3 | 
4 | 
5 | 
6 | 
7 | 
8 |
9 | 
10 |
11 | Welcome to the **DevOps Guide** repository! This project serves as a comprehensive resource for anyone interested in learning and implementing DevOps practices, tools, and workflows.
12 |
13 | Whether you are a beginner exploring the fundamentals or a seasoned professional looking to refine your skills, this repository is designed to provide value at every level.
14 |
15 | ---
16 |
17 | ## 📁 Repository Structure
18 |
19 | The repository is organized into key areas of DevOps, each focusing on specific practices and tools:
20 |
21 | ### 1. **CI/CD**
22 | - Concepts of Continuous Integration and Continuous Deployment.
23 | - Tutorials for tools like GitHub Actions, Jenkins, and GitLab CI/CD.
24 | - Example pipelines for real-world applications.
25 |
26 | ### 2. **Infrastructure as Code (IaC)**
27 | - Guides on Terraform, Ansible, and AWS CloudFormation.
28 | - Examples of setting up cloud resources using IaC.
29 |
30 | ### 3. **Containerization and Orchestration**
31 | - Docker basics and advanced topics.
32 | - Kubernetes tutorials, YAML configuration examples, and Helm charts.
33 |
34 | ### 4. **Monitoring and Logging**
35 | - Tutorials for Prometheus, Grafana, and the ELK Stack.
36 | - How to set up monitoring dashboards and alerts.
37 |
38 | ### 5. **Version Control**
39 | - Git workflows, branching strategies, and best practices for version control.
40 |
41 | ### 6. **DevSecOps**
42 | - Security best practices in DevOps workflows.
43 | - Tools like Snyk, Trivy, and OWASP ZAP.
44 |
45 | ---
46 |
47 | ## 🚀 Getting Started
48 |
49 | Follow these steps to begin exploring the repository:
50 |
51 | 1. Clone the repository:
52 | ```bash
53 | git clone https://github.com/JawherKl/devops-guide.git
54 | ```
55 | 2. Navigate to a topic folder of interest, such as `CI-CD` or `Monitoring`.
56 | 3. Follow the step-by-step guides and examples provided in the markdown files.
57 |
58 | ---
59 |
60 | ## 🌟 Key Features
61 |
62 | - **Hands-on Labs:** Interactive tutorials with real-world examples.
63 | - **End-to-End Workflows:** Demo applications showcasing complete DevOps pipelines.
64 | - **Best Practices:** Guides to improve efficiency, scalability, and security in DevOps workflows.
65 | - **Scripts and Tools:** Ready-to-use scripts and configurations for common DevOps tasks.
66 |
67 | ---
68 |
69 | ## 🤝 Contributions
70 |
71 | Contributions are welcome! If you have improvements, ideas, or tools to share, please feel free to contribute:
72 |
73 | 1. Fork the repository.
74 | 2. Create a feature branch:
75 | ```bash
76 | git checkout -b feature/your-feature-name
77 | ```
78 | 3. Commit your changes:
79 | ```bash
80 | git commit -m "Add your message here"
81 | ```
82 | 4. Push to the branch:
83 | ```bash
84 | git push origin feature/your-feature-name
85 | ```
86 | 5. Open a Pull Request.
87 |
88 | For detailed guidelines, check out the `CONTRIBUTING.md` file.
89 |
90 | ---
91 |
92 | ## 📖 Future Plans
93 |
94 | - Add **cloud-specific sections** for AWS, Azure, and GCP.
95 | - Include guides for popular **DevOps certifications**.
96 | - Add more real-world **case studies** and advanced workflows.
97 |
98 | ---
99 |
100 | ## 🛠️ Tools Covered
101 |
102 | - **CI/CD:** Jenkins, GitHub Actions, GitLab CI/CD, CircleCI
103 | - **IaC:** Terraform, Ansible, AWS CloudFormation
104 | - **Containers:** Docker, Kubernetes, Helm
105 | - **Monitoring:** Prometheus, Grafana, ELK Stack
106 | - **Security:** Snyk, OWASP ZAP, Trivy
107 |
108 | ---
109 |
110 | ## 📬 Feedback
111 |
112 | We value your feedback! If you have any suggestions, issues, or ideas, please feel free to open an issue or contact us directly via the repository's Discussions tab.
113 |
114 | ---
115 |
116 | ## 📜 License
117 |
118 | This repository is licensed under the MIT License. See the `LICENSE` file for more details.
119 |
120 | ---
121 |
122 | ## 🌟 Stargazers over time
123 | [](https://starchart.cc/JawherKl/node-api-postgres)
124 |
--------------------------------------------------------------------------------
/topics/container/docker/README.md:
--------------------------------------------------------------------------------
1 | ## **1. Basics**
2 |
3 | ### **1.1 Simple Dockerfile**
4 | #### `README.md`
5 | ```markdown
6 | # Simple Dockerfile Example
7 |
8 | This example demonstrates how to create a basic `Dockerfile` for a Python application.
9 |
10 | ## Steps to Run
11 |
12 | 1. Build the Docker image:
13 | ```bash
14 | docker build -t my-python-app .
15 | ```
16 |
17 | 2. Run the container:
18 | ```bash
19 | docker run -p 4000:80 my-python-app
20 | ```
21 |
22 | 3. Access the application:
23 | Open your browser and go to `http://localhost:4000`.
24 |
25 | ## Key Concepts
26 | - **Base Image**: Using `python:3.9-slim` as the base image.
27 | - **Working Directory**: Setting the working directory with `WORKDIR`.
28 | - **Copying Files**: Copying application files into the container with `COPY`.
29 | - **Installing Dependencies**: Installing Python dependencies using `pip`.
30 | - **Exposing Ports**: Making the application accessible on port 80.
31 | - **Environment Variables**: Setting environment variables with `ENV`.
32 | - **Running the Application**: Using `CMD` to specify the command to run the application.
33 | ```
34 |
35 | ---
36 |
37 | ### **1.2 Simple docker-compose.yml**
38 | #### `README.md`
39 | ```markdown
40 | # Simple docker-compose.yml Example
41 |
42 | This example demonstrates how to use `docker-compose.yml` to define and run a single-service application.
43 |
44 | ## Steps to Run
45 |
46 | 1. Start the application:
47 | ```bash
48 | docker-compose up
49 | ```
50 |
51 | 2. Access the application:
52 | Open your browser and go to `http://localhost:4000`.
53 |
54 | 3. Stop the application:
55 | ```bash
56 | docker-compose down
57 | ```
58 |
59 | ## Key Concepts
60 | - **Service Definition**: Defining a service (`web`) in `docker-compose.yml`.
61 | - **Port Mapping**: Mapping container port 80 to host port 4000.
62 | - **Environment Variables**: Setting environment variables for the service.
63 | - **Build Context**: Building the Docker image from the current directory.
64 | ```
65 |
66 | ---
67 |
68 | ## **2. Advanced**
69 |
70 | ### **2.1 Multi-Stage Build Dockerfile**
71 | #### `README.md`
72 | ```markdown
73 | # Multi-Stage Build Example
74 |
75 | This example demonstrates how to use multi-stage builds in Docker to reduce the size of the final image.
76 |
77 | ## Steps to Run
78 |
79 | 1. Build the Docker image:
80 | ```bash
81 | docker build -t my-node-app .
82 | ```
83 |
84 | 2. Run the container:
85 | ```bash
86 | docker run -p 3000:80 my-node-app
87 | ```
88 |
89 | 3. Access the application:
90 | Open your browser and go to `http://localhost:3000`.
91 |
92 | ## Key Concepts
93 | - **Multi-stage builds**: Separating the build and runtime environments to reduce image size.
94 | - **Build Stage**: Using `node:16` to build the application.
95 | - **Runtime Stage**: Using `nginx:alpine` to serve the built application.
96 | - **Copying Artifacts**: Copying only the necessary files from the build stage to the runtime stage.
97 | ```
98 |
99 | ---
100 |
101 | ### **2.2 Multi-Service App with docker-compose.yml**
102 | #### `README.md`
103 | ```markdown
104 | # Multi-Service App Example
105 |
106 | This example demonstrates how to use `docker-compose.yml` to define and run a multi-service application (web app, Redis, and PostgreSQL).
107 |
108 | ## Steps to Run
109 |
110 | 1. Start the application:
111 | ```bash
112 | docker-compose up
113 | ```
114 |
115 | 2. Access the web application:
116 | Open your browser and go to `http://localhost:5000`.
117 |
118 | 3. Stop the application:
119 | ```bash
120 | docker-compose down
121 | ```
122 |
123 | ## Key Concepts
124 | - **Service Dependencies**: Using `depends_on` to define service dependencies.
125 | - **Port Mapping**: Mapping container ports to host ports.
126 | - **Environment Variables**: Setting environment variables for the database.
127 | - **Volumes**: Persisting PostgreSQL data using Docker volumes.
128 | ```
129 |
130 | ---
131 |
132 | ### **2.3 Custom Networks in docker-compose.yml**
133 | #### `README.md`
134 | ```markdown
135 | # Custom Networks Example
136 |
137 | This example demonstrates how to use custom networks in `docker-compose.yml` for better service isolation.
138 |
139 | ## Steps to Run
140 |
141 | 1. Start the application:
142 | ```bash
143 | docker-compose up
144 | ```
145 |
146 | 2. Access the web application:
147 | Open your browser and go to `http://localhost:5000`.
148 |
149 | 3. Stop the application:
150 | ```bash
151 | docker-compose down
152 | ```
153 |
154 | ## Key Concepts
155 | - **Custom Networks**: Creating separate networks (`frontend` and `backend`) for services.
156 | - **Service Isolation**: Isolating services by attaching them to specific networks.
157 | - **Network Communication**: Allowing services to communicate within the same network.
158 | ```
159 |
160 | ---
161 |
162 | ## **3. Real-World Examples**
163 |
164 | ### **3.1 Dockerfile for a Node.js Application**
165 | #### `README.md`
166 | ```markdown
167 | # Node.js Application Example
168 |
169 | This example demonstrates how to create a `Dockerfile` for a Node.js application with environment variables and health checks.
170 |
171 | ## Steps to Run
172 |
173 | 1. Build the Docker image:
174 | ```bash
175 | docker build -t my-node-app .
176 | ```
177 |
178 | 2. Run the container:
179 | ```bash
180 | docker run -p 3000:3000 my-node-app
181 | ```
182 |
183 | 3. Access the application:
184 | Open your browser and go to `http://localhost:3000`.
185 |
186 | ## Key Concepts
187 | - **Environment Variables**: Using `ENV` to set environment variables.
188 | - **Health Checks**: Adding a health check to monitor the application.
189 | - **Port Exposure**: Exposing the application on port 3000.
190 | ```
191 |
192 | ---
193 |
194 | ### **3.2 docker-compose.yml for a Microservices Architecture**
195 | #### `README.md`
196 | ```markdown
197 | # Microservices Architecture Example
198 |
199 | This example demonstrates how to use `docker-compose.yml` to define and run a microservices-based application.
200 |
201 | ## Steps to Run
202 |
203 | 1. Start the application:
204 | ```bash
205 | docker-compose up
206 | ```
207 |
208 | 2. Access the services:
209 | - Auth Service: `http://localhost:3001`
210 | - User Service: `http://localhost:3002`
211 |
212 | 3. Stop the application:
213 | ```bash
214 | docker-compose down
215 | ```
216 |
217 | ## Key Concepts
218 | - **Microservices**: Running multiple services (`auth-service`, `user-service`, and `db`) in a single `docker-compose.yml` file.
219 | - **Service Communication**: Using environment variables to configure service communication.
220 | - **Database Persistence**: Persisting PostgreSQL data using Docker volumes.
221 | ```
222 |
223 | ---
224 |
225 | ## **4. General README.md for the `container` Section**
226 | #### `README.md`
227 | ```markdown
228 | # Containerization with Docker
229 |
230 | This section provides examples and guides for working with Docker, including `Dockerfile` and `docker-compose.yml` configurations.
231 |
232 | ## Topics Covered
233 | 1. **Basics**
234 | - Simple `Dockerfile` for a Python application.
235 | - Simple `docker-compose.yml` for a single-service application.
236 |
237 | 2. **Advanced**
238 | - Multi-stage builds to reduce image size.
239 | - Multi-service applications with `docker-compose.yml`.
240 | - Custom networks for service isolation.
241 |
242 | 3. **Real-World Examples**
243 | - `Dockerfile` for a Node.js application with health checks.
244 | - Microservices architecture with `docker-compose.yml`.
245 |
246 | ## How to Use
247 | Navigate to each subfolder to find detailed examples and instructions.
248 |
249 | ## Contributing
250 | Feel free to contribute by adding more examples or improving existing ones. Open a pull request to get started!
251 | ```
252 |
--------------------------------------------------------------------------------
/topics/container/kubernetes/README.md:
--------------------------------------------------------------------------------
1 | ## **1. Basics Section**
2 |
3 | ### **1.1 Pod Definition (`pod.yaml`)**
4 | **File:** `basics/pod.yaml`
5 | **README.md:** `basics/README.md`
6 |
7 | ```markdown
8 | # Kubernetes Pod Example
9 |
10 | This example demonstrates how to create a simple Kubernetes Pod running an NGINX container.
11 |
12 | ## Steps to Apply
13 |
14 | 1. Apply the Pod configuration:
15 | ```bash
16 | kubectl apply -f pod.yaml
17 | ```
18 |
19 | 2. Check the status of the Pod:
20 | ```bash
21 | kubectl get pods
22 | ```
23 |
24 | 3. View the logs of the Pod:
25 | ```bash
26 | kubectl logs nginx-pod
27 | ```
28 |
29 | ## Key Concepts
30 | - **Pod**: The smallest deployable unit in Kubernetes, which can contain one or more containers.
31 | - **Container**: A lightweight, standalone executable package that includes everything needed to run an application.
32 | - **Labels**: Key-value pairs used to organize and select resources.
33 | ```
34 |
35 | ---
36 |
37 | ### **1.2 Deployment Definition (`deployment.yaml`)**
38 | **File:** `basics/deployment.yaml`
39 | **README.md:** `basics/README.md`
40 |
41 | ```markdown
42 | # Kubernetes Deployment Example
43 |
44 | This example demonstrates how to create a Kubernetes Deployment to manage multiple replicas of an NGINX application.
45 |
46 | ## Steps to Apply
47 |
48 | 1. Apply the Deployment configuration:
49 | ```bash
50 | kubectl apply -f deployment.yaml
51 | ```
52 |
53 | 2. Check the status of the Deployment:
54 | ```bash
55 | kubectl get deployments
56 | ```
57 |
58 | 3. Check the Pods created by the Deployment:
59 | ```bash
60 | kubectl get pods
61 | ```
62 |
63 | ## Key Concepts
64 | - **Deployment**: Manages a set of identical Pods and ensures the desired number of replicas are running.
65 | - **Replicas**: The number of Pods that should be running at any given time.
66 | - **Rolling Updates**: Allows zero-downtime updates to the application.
67 | ```
68 |
69 | ---
70 |
71 | ### **1.3 Service Definition (`service.yaml`)**
72 | **File:** `basics/service.yaml`
73 | **README.md:** `basics/README.md`
74 |
75 | ```markdown
76 | # Kubernetes Service Example
77 |
78 | This example demonstrates how to create a Kubernetes Service to expose an NGINX Deployment.
79 |
80 | ## Steps to Apply
81 |
82 | 1. Apply the Service configuration:
83 | ```bash
84 | kubectl apply -f service.yaml
85 | ```
86 |
87 | 2. Check the status of the Service:
88 | ```bash
89 | kubectl get services
90 | ```
91 |
92 | 3. Access the NGINX application:
93 | - If using a LoadBalancer, use the external IP provided by the Service.
94 | - If using Minikube or a local cluster, use `kubectl port-forward`:
95 | ```bash
96 | kubectl port-forward svc/nginx-service 8080:80
97 | ```
98 | Then open `http://localhost:8080` in your browser.
99 |
100 | ## Key Concepts
101 | - **Service**: Provides a stable IP address and DNS name for accessing Pods.
102 | - **LoadBalancer**: Exposes the Service externally using a cloud provider's load balancer.
103 | - **Port Forwarding**: Allows local access to a Service running in the cluster.
104 | ```
105 |
106 | ---
107 |
108 | ## **2. Advanced Section**
109 |
110 | ### **2.1 Multi-Container Pod (`pod.yaml`)**
111 | **File:** `advanced/multi-container-pod/pod.yaml`
112 | **README.md:** `advanced/multi-container-pod/README.md`
113 |
114 | ```markdown
115 | # Multi-Container Pod Example
116 |
117 | This example demonstrates how to create a Pod with multiple containers: one for the application and one for a logging sidecar.
118 |
119 | ## Steps to Apply
120 |
121 | 1. Apply the Pod configuration:
122 | ```bash
123 | kubectl apply -f pod.yaml
124 | ```
125 |
126 | 2. Check the status of the Pod:
127 | ```bash
128 | kubectl get pods
129 | ```
130 |
131 | 3. View the logs of the sidecar container:
132 | ```bash
133 | kubectl logs multi-container-pod -c log-sidecar
134 | ```
135 |
136 | ## Key Concepts
137 | - **Multi-Container Pod**: A Pod that runs multiple containers sharing the same network and storage.
138 | - **Sidecar Pattern**: A helper container that assists the main application container (e.g., logging, monitoring).
139 | - **Volume**: Shared storage between containers in the same Pod.
140 | ```
141 |
142 | ---
143 |
144 | ### **2.2 Ingress Resource (`ingress.yaml`)**
145 | **File:** `advanced/ingress/ingress.yaml`
146 | **README.md:** `advanced/ingress/README.md`
147 |
148 | ```markdown
149 | # Kubernetes Ingress Example
150 |
151 | This example demonstrates how to create an Ingress resource to route traffic to different services.
152 |
153 | ## Steps to Apply
154 |
155 | 1. Apply the Ingress configuration:
156 | ```bash
157 | kubectl apply -f ingress.yaml
158 | ```
159 |
160 | 2. Check the status of the Ingress:
161 | ```bash
162 | kubectl get ingress
163 | ```
164 |
165 | 3. Access the application:
166 | - Ensure your DNS points to the Ingress controller's IP.
167 | - Visit `http://myapp.example.com/app1` and `http://myapp.example.com/app2`.
168 |
169 | ## Key Concepts
170 | - **Ingress**: Manages external access to services in a cluster, typically HTTP/HTTPS.
171 | - **Host-Based Routing**: Routes traffic based on the hostname.
172 | - **Path-Based Routing**: Routes traffic based on the URL path.
173 | ```
174 |
175 | ---
176 |
177 | ### **2.3 ConfigMap and Secrets**
178 | **File:** `advanced/configmap-secrets/configmap.yaml` and `advanced/configmap-secrets/secret.yaml`
179 | **README.md:** `advanced/configmap-secrets/README.md`
180 |
181 | ```markdown
182 | # ConfigMap and Secrets Example
183 |
184 | This example demonstrates how to use ConfigMaps and Secrets to manage configuration and sensitive data in Kubernetes.
185 |
186 | ## Steps to Apply
187 |
188 | 1. Apply the ConfigMap:
189 | ```bash
190 | kubectl apply -f configmap.yaml
191 | ```
192 |
193 | 2. Apply the Secret:
194 | ```bash
195 | kubectl apply -f secret.yaml
196 | ```
197 |
198 | 3. Verify the resources:
199 | ```bash
200 | kubectl get configmaps
201 | kubectl get secrets
202 | ```
203 |
204 | ## Key Concepts
205 | - **ConfigMap**: Stores non-sensitive configuration data as key-value pairs.
206 | - **Secret**: Stores sensitive data (e.g., passwords, tokens) in an encrypted format.
207 | - **Environment Variables**: Inject ConfigMap and Secret data into Pods as environment variables.
208 | ```
209 |
210 | ---
211 |
212 | ### **2.4 StatefulSet (`statefulset.yaml`)**
213 | **File:** `advanced/statefulsets/statefulset.yaml`
214 | **README.md:** `advanced/statefulsets/README.md`
215 |
216 | ```markdown
217 | # StatefulSet Example
218 |
219 | This example demonstrates how to create a StatefulSet for deploying stateful applications like MySQL.
220 |
221 | ## Steps to Apply
222 |
223 | 1. Apply the StatefulSet configuration:
224 | ```bash
225 | kubectl apply -f statefulset.yaml
226 | ```
227 |
228 | 2. Check the status of the StatefulSet:
229 | ```bash
230 | kubectl get statefulsets
231 | ```
232 |
233 | 3. Check the Pods and Persistent Volume Claims (PVCs):
234 | ```bash
235 | kubectl get pods
236 | kubectl get pvc
237 | ```
238 |
239 | ## Key Concepts
240 | - **StatefulSet**: Manages stateful applications with stable network identities and persistent storage.
241 | - **Persistent Volume (PV)**: Provides durable storage for Pods.
242 | - **Persistent Volume Claim (PVC)**: Requests storage from a PV.
243 | ```
244 |
245 | ---
246 |
247 | ## **3. Real-World Examples**
248 |
249 | ### **3.1 Kubernetes Deployment with Environment Variables**
250 | **File:** `advanced/deployment-env/deployment.yaml`
251 | **README.md:** `advanced/deployment-env/README.md`
252 |
253 | ```markdown
254 | # Deployment with Environment Variables Example
255 |
256 | This example demonstrates how to create a Deployment that uses environment variables from a ConfigMap and Secret.
257 |
258 | ## Steps to Apply
259 |
260 | 1. Apply the Deployment configuration:
261 | ```bash
262 | kubectl apply -f deployment.yaml
263 | ```
264 |
265 | 2. Check the status of the Deployment:
266 | ```bash
267 | kubectl get deployments
268 | ```
269 |
270 | 3. Verify the environment variables in the Pod:
271 | ```bash
272 | kubectl exec -- env | grep APP_
273 | ```
274 |
275 | ## Key Concepts
276 | - **Environment Variables**: Pass configuration and sensitive data to containers.
277 | - **ConfigMap**: Stores non-sensitive configuration data.
278 | - **Secret**: Stores sensitive data securely.
279 | ```
280 |
281 | ---
282 |
283 | ### **3.2 Horizontal Pod Autoscaler (HPA)**
284 | **File:** `advanced/hpa/hpa.yaml`
285 | **README.md:** `advanced/hpa/README.md`
286 |
287 | ```markdown
288 | # Horizontal Pod Autoscaler (HPA) Example
289 |
290 | This example demonstrates how to create an HPA to automatically scale a Deployment based on CPU usage.
291 |
292 | ## Steps to Apply
293 |
294 | 1. Apply the HPA configuration:
295 | ```bash
296 | kubectl apply -f hpa.yaml
297 | ```
298 |
299 | 2. Check the status of the HPA:
300 | ```bash
301 | kubectl get hpa
302 | ```
303 |
304 | 3. Generate load to trigger scaling:
305 | - Use a tool like `kubectl run` or a load testing tool to increase CPU usage.
306 |
307 | ## Key Concepts
308 | - **Horizontal Pod Autoscaler (HPA)**: Automatically scales the number of Pods based on resource usage.
309 | - **Metrics**: CPU, memory, or custom metrics used for scaling.
310 | - **Scaling Policies**: Define how scaling should behave (e.g., min/max replicas).
311 | ```
312 |
--------------------------------------------------------------------------------