Skip to content

Instantly share code, notes, and snippets.

@dmancloud
dmancloud / How to Install SonarQube in Ubuntu Linux.md
Last active June 28, 2024 17:34
How to Install SonarQube in Linux

How to Install Sonarqube in Ubuntu Linux

Prerequsites

Virtual Machine running Ubuntu 22.04 or newer

Install Postgresql 15

sudo apt update
sudo apt upgrade

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
@dmancloud
dmancloud / howto-use-kubernetes-secrets.md
Last active October 30, 2023 14:17
How to use Kubernetes Secrets

How to use Kubernetes Secrets

Create Kubernetes secrets using kubectl and --from-literal

The easiest ways to create the Kubernetes secret is by using the kubectl command and --from-literal flag. For example to understand Kubernetes secret creation we need three things.

  • secret-name - test-secret
  • username - test-user
  • password - testP@ssword
kubectl create secret generic test-secret --from-literal=username=test-user --from-literal=password=testP@ssword
@dmancloud
dmancloud / customize-your-terminal-on-macos-like-a-pro.md
Last active May 19, 2024 23:52
Customize Your Terminal On MacOS Like A Pro

Customize Your Terminal On MacOS Like A Pro

Customize your terminal using iTerm2, oh-my-zsh and powerlevel10k works on both Macbook Intel and Macbook M1.

Install Brew

The Missing Package Manager for macOS

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install iTerm2

iTerm2 has better color fidelity than the built in Terminal, so your themes will look better.

@dmancloud
dmancloud / argocd-webhook-configuration.md
Last active October 30, 2023 14:18
Argo CD Git Webhook Configuration

Argo CD Git Webhook Configuration

By default, Argo CD polls the Git repositories every 3 minutes to detect the changes made on the repo. If you want to remove the delay, you can configure a webhook event to send a notification to the API server.

Create a Webhook in GitHub

Login to your Github repository and navigate to settings > webhooks and click add webhook

The payload URL is your ArgoCD Server + /api/webhook

For example.

https://argocd.example.com/api/webhook

@dmancloud
dmancloud / argocd-installation-part-2.md
Last active April 17, 2024 04:29
ArgoCD Installation Part 2

ArgoCD Installation Part 2 - Quick Start

Argo CD is a declarative continuous delivery tool for Kubernetes applications. It uses the GitOps style to create and manage Kubernetes clusters. When any changes are made to the application configuration in Git, Argo CD will compare it with the configurations of the running application and notify users to bring the desired and live state into sync.

Argo CD has been developed under the Cloud Native Computing Foundation’s (CNCF) Argo Project- a project, especially for Kubernetes application lifecycle management. The project also includes Argo Workflow, Argo Rollouts, and Argo Events.. Each solves a particular set of problems in the agile development process and make the Kubernetes application delivery scalable and secure.

Upgrade Packages & Install Prerequisites

Install ArgoCD

kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
@dmancloud
dmancloud / monitoring-kubernetes.md
Last active November 27, 2023 12:47
Grafana and Prometheus - Monitoring Kubernetes

Monitoring Kubernetes with Grafana and Prometheus

Grafana and Prometheus are a powerful monitoring solutions that allow you to visualize, query, and alert metrics no matter where they are stored.

Getting Started

You will need

  • A kubernetes cluster
  • kubectl installed locally
  • helm installed locally

Create a Monitoring Namespace

@dmancloud
dmancloud / pi-hole-with-recursive-dns.md
Last active November 1, 2022 13:39
Pi-Hole Using Your Own Recursive DNS Server

Pi-Hole Using Your Own Recursive DNS Server

Pi-Hole is a great Self-Hosted DNS Service. It keeps ads from loading, and will run as a Docker container or virtual machine you'd like. You can also completely bypass 3rd party DNS servers like 8.8.8.8, 1.1.1.1, 208.67. 222.222, or the ones ran by your ISP.

Prerequisites

Linux VM (in this tutorial we are using Debian 11)

Install Pi-Hole

sudo curl -sSL https://install.pi-hole.net | bash
@dmancloud
dmancloud / wildcard-certificates-with-traefik-lets-encrypt.md
Last active October 30, 2023 14:19
Wildcard Certificates with Traefik + cert-manager + Let's Encrypt in Kubernetes Tutorial
@dmancloud
dmancloud / kube-vip-service-loadbalancer.md
Last active October 30, 2023 14:19
Service LoadBalancer using leader election for ARP (Layer 2)

kube-vip - Service LoadBalancer using leader election (ARP)

kube-vip provides Kubernetes clusters with a virtual IP and load balancer for both the control plane (for building a highly-available cluster) and Kubernetes Services of type LoadBalancer without relying on any external hardware or software.

Documentation - https://kube-vip.io/docs/

Quickstart

Download & Deploy kube-vip controller

curl -sfL https://raw.githubusercontent.com/kube-vip/kube-vip-cloud-provider/main/manifest/kube-vip-cloud-controller.yaml > /var/lib/rancher/rke2/server/manifests/kube-vip-cloud-controller.yaml
@dmancloud
dmancloud / ha-rke2-with-kube-vip.md
Last active October 30, 2023 14:18
Highly Available (HA) Kubernetes Cluster with RKE2 & kube-vip

HA Kubernetes Cluster with RKE2 & kube-vip

Infrastructure

  • 3 Virtual Machines (nodes) with Static IP Addresses
  • Debian 11
  • DNS configured for each of the nodes and the floating IP Address (VIP)

Upgrade Packages & Install Prerequisites

sudo apt-get update && sudo apt upgrade -y
sudo apt-get -y install gnupg2 ca-certificates curl apt-transport-https iptables