Posted on April 23, 2024 by cprime-admin -
Part 1: GitLab Overview
- What is GitLab?
- Sequential DevOps vs. Concurrent DevOps
- Concurrent DevOps with GitLab
- GitLab Flows
- GitLab Recommended Process
- GitLab Workflow Components
- Demo Exercises: GitLab Features
Part 2: GitLab Components and Navigation
- GitLab Organization
- GitLab Epics
- Issue: The Starting Point for your workflow
- Issue Organization
- GitLab Workflow Example
- Demo Exercises: GitLab Navigation
- Hands-On Labs: Create a Project & Issue
Part 3: Git Basics
- What is Git?
- Git Key Terms
- Why Git is so popular
- Centralized vs. Distributed
- Basic Git workflow within GitLab
- Common Commands
- Demo Exercises: Working Locally with Git
- Hands-On Labs: Working Locally with Git
Part 4: Basic Code Creation in GitLab
- Code Review- Typical Workflow
- Code Review Workflow- GitLab tools to use
- Additional Tools for Code Review & Collaboration
- Demo Exercises: Merge Request in GitLab
- Demo Exercises: Assigning, Reviewing, and Approving in GitLab
- Demo Exercises: Additional Tools for working with code
- Hands-On Labs: Code Creation and Review
Part 5: GitLab's CI/CD Functions
- What is CI/CD?
- CI/CD Advantages
- Concurrent DevOps lifecycle
- CI/CD Features in GitLab
- CI/CD Automated tasks
- GitLab CI/CD Key Ingredients
- Anatomy of a CI/CD Pipeline
- Demo Exercises: CI/CD Examples
- Hands-on Labs: CI/CD Pipelines
Part 6: GitLab's Package and Release Features
- What are Package and Container Registries?
- Release Features in GitLab
- What is Auto DevOps?
- Demo Exercises: Auto DevOps and Interactive Web Terminal
Part 7: GitLab Security Scanning
- Demo Exercises: Using SAST Templates
- Hands-On Labs: How to run a SAST scan
- Hands-On Labs: View the scanning reports in the Security Dashboard
Posted on October 21, 2021 by cprime-admin -
Part 1: GitLab Overview and Organization
- GitLab Workflow Components
- Planning a Project
- The Plan Stage: Project Management
- GitLab Organization – Groups, Projects, and Issues, oh my!
Part 2: GitLab Plan Stage
- Organizing the Work
- Planning the Work
- Doing the Work
- Document the Work
- GitLab Agile Planning Structures
Part 3: Planning Functions in GitLab
- Issues: The Starting Point for your Workflow
- Issues Keep Everyone Connected and Synchronized
- What Can you Expect on an Issue Page?
- Hands-On Lab: Issues and Labels
- Hands-On Lab: Quick Actions
- Why Milestones are Important
- The Use of Kanban Boards
- GitLab's Service Desk
- Utilizing Wikis
- Hands-On Lab: Create a Wiki Page
- Hands-On Lab: Epics and Kanban Boards
- Project Management Review Quiz
- Hands-On Lab: Practice Lab 1
- Hands-On Lab: Practice Lab 2
Posted on June 25, 2021 by cprime-admin -
Part 1: Introduction
- Required knowledge
- Git: Committing code and creating pull requests
- Kubernetes: Deploying a service to Kubernetes and basic checks with kubectl
- Docker: Pushing an image to a Docker repository
- CI/CD: GitOps reverses the traditional understanding of continuous integration/continuous development.
- Core concepts: A quick introduction
- Immutable infrastructure
- Infrastructure as code
- Orchestration
- Convergence
- CI/CD
- What GitOps is not
- GitOps is not infrastructure as code.
- GitOps doesn't replace continuous integration (CI).
- The use case: Deploying a highly available microservice
- Deploying a microservice to Kubernetes, with all the surrounding infrastructure to make it available
Part 2: Setting up the Tools
- Kubernetes
- In advance: Setting up a cluster from scratch is time-consuming, even if you use a managed solution like EKS. Pre-allocating a cluster per person is something you can do in advance.
- Preparation: Setting up kubectl
- Every participant should have credentials to connect to the cluster using kubectl.
- Preparation: Access a cluster through kubectl/k9s.
- Check running pods.
- Check deployments.
- Repository
- Preparation: Infrastructure repository
- An empty repository in GitHub/GitLab to use for deploying infrastructure
- Application repository
- Strictly speaking, you don't need to separate the application and infrastructure, but it's easier to understand what goes where this way.
- A sample application that serves a web server with a hello world response as the baseline (NodeJS-based, for instance)
- ArgoCD
- Why ArgoCD?
- ArgoCD is tightly integrated with Kubernetes and closely follows the GitOps mindset. Therefore, it's a good tool to showcase GitOps.
- Exercise: Add ArgoCD to the cluster.
- Create namespace.
- Deploy ArgoCD to the cluster.
- Access ArgoCD using the CLI.
Part 3: Deploying a Microservice
- Exercise: Prepare a simple microservice to be deployed in k8s.
- Build sample application as a Docker container (Dockerfile can be provided in advance)
- Push service to a Docker registry (cloud-native, docker.io, or quay.io)
- Exercise: Create a k8s deployment.
- Create a Kubernetes deployment definition in code for the application (here's a sample).
- Push code to infrastructure repository.
- Create an application in ArgoCD.
- This time, you'll use the ArgoCD CLI so you can see that part. You'll move to use Git from here on, which is more aligned to GitOps.
- Sync the application.
- Again, use the CLI.
- Test: Use kubectl check to ensure that deployment works.
- Automated synchronization
- Pull versus push: How ArgoCD can read from a repository and automatically apply the changes
- Exercise: Activate synchronization so that further changes happen when you push code to the infrastructure repository.
- Exercise: Create a k8s service. (A deployment alone doesn't expose the microservice, so let's build on that.)
- Create service definition.
- Pull request
- This is an opportunity to introduce the pull request aspect of the flow. You can extend pull requests so that extra checks are performed, using something like GitHub Actions.
- Implementing CI with something like GitHub Actions isn't part of the exercise, although it's something that you can complete as an extra exercise. (See the bonus section at the end of this post.)
- Test: Carry out a kubectl check to prove that service was deployed.
- Exercise: Create a load balancer. (You still can't access service from the outside.)
- Create loadbalancer k8s definition for cloud provider.
- Pull request
- Test: Curl to load balancer address to ensure that service is actually online.
- Exercise: Update the application.
- Change something in the application, such as the body of the response of a route in the application.
- Rebuild container with a new tag and push it to Docker registry.
- Update k8s deployment to use new tag.
- Pull request
- Test: New version of the app should be deployed.
- Exercise: Update the infrastructure. (Why do this? So you can demonstrate that changing the application and the infrastructure results in blurry boundaries.)
- Update k8s deployment to be highly available (more than one replica).
- Pull request
- Test: kubectl shows that there are multiple pods running.
- Wrap-up: This covers the workflow of deploying an application and then performing updates and changes on it.
- This is the core of GitOps!
- There are also other, more advanced use cases to cover.
Part 4: Promoting Changes Through Different Environments
- In advance: Prepare a second cluster.
- As with the first cluster, this is something to have prepared in advance.
- Preparation: Register the cluster in ArgoCD to allow deployments to it.
- From development to production
- Which options are there to represent different stages?
- This is an open discussion, as there's no set recipe to do environment promotion, with different options:
- Use different infrastructure repositories.
- Use different folders in the same infrastructure repository.
- Use branches.
- Exercise: Promotion of a version
- Set up a second cluster (production) to read from a different folder.
- Copy the infrastructure created for the first folder into this one.
- Pull request
- Test: Second cluster should have the service available as well.
- More advanced deployment scenarios (Controlled release is an important part of releasing traffic, especially to production. It's worth talking about the options that you have that can be based on the exact same building blocks as explained before.)
- Exercise: Blue/Green
- Enable Argo Rollouts in cluster.
- Test: Observe rolling deployment with kubectl.
- Install argo-rollouts plugin for kubectl.
- Create rollout to apply to existing microservice.
- Canary release
- Theory only (This can be a good lead-in to a discussion of the merits and tradeoffs of different deployment strategies.)
- Exercise: Error handling (This exercise shows that failure in infra deployment is expected and is handled through code changes—not panicked actions!)
- Introduce an error in the hello world application (this results in a thrown exception instead of starting the webserver).
- Rebuild the container with a new tag and push it to Docker registry.
- Update k8s deployment to use new tag.
- Pull request
- Test: Confirm with kubectl that deployment is failing.
- Revert a failed change through code.
Part 4: Security in GitOps
- Accessing resources
- kubectl shouldn't replace observability, such as logging and monitoring (similar to secure shell—SSH—into a production server)
- Secrets
- No plaintext secrets should ever be stored in Git.
- Vault
- This is theory only because it's probably too much to do for a practical exercise.
- Exercise: Sealed secrets
- Depending on time, this can be treated as theory or as an exercise. Furthermore, you can split it in two depending on how much time you have.
- Modify microservice to read the secret and make it available through a request.
- Provision secrets in the infrastructure repository.
- Use secrets from either the cluster or the application.
- Install the sealed secrets controller.
- Inject an encrypted secret in the infrastructure repository.
- Modify Kubernetes deployment to inject a secret into the microservice.
Part 7: Recap
- Core concepts: Infra as code, Git as the source of truth, pull model, converging changes
- Core flow: declare infrastructure, commit it, pull request for review, merge to apply
- Next steps
- Automated promotion (If a deployment to a staging environment succeeds, then trigger a deployment to production.)
- Observability (microservices that export metrics, logging aggregator, and monitoring)
Bonus exercises
- Replace manual steps (push Docker container, build application code) with CI, such as GitHub actions.
- Introduce templating (Jsonnet, Helm) to foster reuse of Kubernetes resources.
- Exercise: Parameterize deployment so that port can be defined as configuration. Deploy a second copy of the same service with a different name, running on a different port.
- Install more advanced resources in the cluster using the same mechanism, such as an ingress controller.
Posted on October 17, 2020 by cprime-admin -
Part 1: Course Introduction
- Azure Repos-Chef-Azure Pipelines: A DevOps Pipeline
- Course Purpose
- Agenda
- Introductions
- Lab Environments
Part 2: Technology Overview
- Git – Source Control Management
- Chef – Configuration Management
- Azure Pipelines – Continuous Integration
- An End-To-End CI/CD (Continuous Integration/Continuous Deployment) Pipeline
Part 3: Git/Azure Repos – Source Control Management
- Git purpose and Workflow
- Git configuration
- Getting help with git
- Basic git commands
- Remote, status, add, commit, push, log, diff
- Creating and checking out branches
- Creating a repository in Azure Repo
- Accessing a private repository with SSH keys
- Pull requests
- Merging and deleting branches
Part 4: Chef – Configuration Management
- Chef purpose and use cases
- Chef basics: Resources, recipes, and cookbooks
- Chef policy files
- Integration testing with Inspec and Test kitchen
- Chef variables: Attributes and Ohai
- Dynamic file creation with templates
- Using Chef Supermarket and community cookbooks
- Wrapper cookbooks
- Automating infrastructure with Chef Search
- Centralized management with Chef Infra Server
- Automating Chef convergence
- Managing nodes with policy groups
Part 5: Azure Pipelines
- CI/CD = Continuous Integration / Continuous Deployment
- Purpose
- Projects
- Jobs
- YAML scripting – CI/CD as Code
- Managing credentials and secret files
- Integrating with Source Control Management: Azure Repos
- Triggers: Scheduled Polling and Webhooks
- Automated cookbook linting: Foodcritic and Cookstyle
- Automated cookbook testing with Test Kitchen
- Azure Pipelines Integration with Chef Server
- Creating Separate Build and Release Pipelines
- Continuous Deployment of Chef cookbooks with Azure Pipelines
Posted on October 17, 2020 by cprime-admin -
Part 1: Technology Overview
- Git – Source Control Management
- Ansible – Configuration Management
- Jenkins – Continuous Integration/Continuous Deployment
Part 2: Git – Source Control Management
- Purpose overview and use cases
- Git workflow
- Configuring git on your local machine
- Getting help with Git
- Local vs. Global vs. System configurations
- Basic Git Commands
- Creating local git repositories
- Branching and merging
- Using remote repositories
- Pushing code to Github using public and private SSH keys
Part 3: Ansible – Configuration Management
- Ansible purpose and use cases
- Architecture and call flow
- Ansible installation, configuration, and validation
- Control nodes and managed nodes
- Ansible managed hosts
- Host inventory; hosts and groups
- Repeatable code: Playbooks
- Introduction to YAML
- Modularizing code: Roles
- Ansible variables
- Dynamic configuration with facts
- Finding errors: Ansible unit testing
- Ensuring code quality: Ansible integration testing
Part 4: Jenkins – Continuous Integration / Continuous Deployment
- CI/CD overview, use cases and history
- Plugin architecture
- Initializing a Jenkins server
- Projects and jobs
- Freestyle jobs
- CI/CD as Code: Pipeline projects
- Declarative vs. scripted pipelines
- Jenkins Environment variables and parameters
- Distributed architecture: Master and agent nodes
- Views and Folders
- Managing credentials and secrets
- Integrating with git Source Control Management
- Triggers: Webhooks and Polling
- Notifications: Instant messaging and SMTP Email
- Approval inputs
- Testing Ansible playbooks in Jenkins
- Multibranch Pipelines: Reading entire repositories
- Conditional Logic
- Deploying Ansible playbooks with Jenkins: An automated end-to-end deployment pipeline
Posted on October 17, 2020 by cprime-admin -
Part 1: Source Control Management with Git
- Purpose and overview of Git
- Use cases for Git
- Git flow
- Git providers
- Git configuration
- Finding help on Git
- Creating Local Git Repositories
- Basic Commands: add, commit, status, log
- Comparing commits: git diff
- Using a Repository: git push
- Branches: creating, merging and deleting
- Resolving merge conflicts
- Managing Pull Requests
- Using SSH keys with git platform private repositories
Part 2: Continuous Integration/Continuous Deployment with Jenkins
- Continuous Integration / Continuous Delivery (CI/CD): Jenkins
- CI/CD = Continuous Integration / Continuous Deployment
- Jenkins use case, purpose & history
- Architecture
- Using Plugins
- Initializing a Jenkins Master
- Projects / jobs
- Freestyle UI jobs
- CI/CD as Code: Pipeline Projects
- Declarative versus Scripted pipelines
- Views and folders
- Managing credentials and secrets
- Distributing workloads – Master and Agent nodes
- Integrating with Git: Source Control Management
- Triggers: Scheduled Polling and Webhooks
- Notifications: Instant Messaging Integration
- Requiring human input and approval
- Automated code linting and testing
- Jenkins Integration with managed nodes
- Continuous deployment through Jenkins
Part 3: Code Deployment and Release Management
- Java
- Building an artifact
- Storing Artifacts locally
- Python
- Building an artifact
- Storing Artifacts locally
Part 4: Notifications with Slack
- Integration setup
- Using Slack for CI/CD notifications
Part 5: Linux Management
Posted on October 17, 2020 by cprime-admin -
Part 1: Git – Basic and Advanced Commands
1. Getting started with Git & GitHub
- Why Git?
- Installing Git on Windows
- Installing Git on Mac
- Installing Git on Linux
- Signing up to GitHub
- HTTPS
- SSH
- Understanding Git
2. Basic Git Commands
- Configuration
- Initializing a repository
- Adding commits
- Adding a remote
- Pushing to the remote
- Fetching from the remote
- Pulling from the remote
- Creating a branch
- Merging
- Cloning
- Reset
- Revert
3. Advanced Git Commands
- Amending commits
- Rebasing
- Interactive rebasing
- Cherry-picking
- Bisect
- Aliases
- Hooks
- Git hooks allow you to run scripts before or after certain Git actions (e.g., modify the commit message prior to committing).
Part 2: GitHub – Team and Enterprise Applications
1. Getting started with GitHub
- Two-factor authentication
- Searching GitHub
- Starring repositories
- Following people
- Watching repositories
- Commit email addresses
- Notifications
2. Options for teams
- Organization accounts
- Organization accounts allow you to combine multiple GitHub users into an organization. A single GitHub user can be a member of several organizations. A repository can also be owned by an organization instead of a single user.
- Teams
- Organization accounts allow you to combine multiple GitHub users into an organization. A single GitHub user can be a member of several organizations. A repository can also be owned by an organization instead of a single user.
- Paid plans
- GitHub offers a lot of functionality for free. But companies often need more. The paid plans allow things like private repositories, fine-grained access control, extra support, etc.
3. Working in teams
- GitHub Flow
- GitHub Flow is an easy branching strategy. It starts from a master branch and creates only feature branches from there. The feature branches only get merged into the master branch when approved and ready for release. This allows a team to have a rapid cadence of releases, but it also creates some requirements that need to be addressed. For example, you will need a good CI/CD pipeline, a business that accepts rapid releases, possibly a good feature toggle system, etc.
- Git Flow
- GitFlow is a more complex branching strategy but allows for a more secure development and deployment pace. It's often more fit for larger enterprises. Luckily, there are CLI plugins and GUI tools that support GitFlow and make it easy to work with. This way, developers don't have to remember the specific commands and branching flows.
- Documentation
- Issues
- Projects
- GitHub projects give teams a Kanban board to organize and visualize their work. It's a step up from GitHub Issues.
- Releases
- Git allows developers to create tags in their repositories. In GitHub, you can easily link these tags to "Releases." A release can contain release notes, providing a nice overview of what changed over time.