Skip to content

Instantly share code, notes, and snippets.

View saiyam1814's full-sized avatar
🎯
Focusing

Saiyam Pathak saiyam1814

🎯
Focusing
View GitHub Profile
@saiyam1814
saiyam1814 / kubeadm + containerd 1.23
Created December 8, 2021 06:00
kubeadm + containerd 1.23
Node=74.220.21.97
OS - Ubuntu 20.04
cat <<EOF | sudo tee /etc/modules-load.d/containerd.conf
overlay
br_netfilter
EOF
sudo modprobe overlay
sudo modprobe br_netfilter
flux bootstrap github \
--owner=$GITHUB_USER \
--repository=cncfminutes \
--branch=main \
--path=./clusters/my-cluster
git clone https://github.com/$GITHUB_USER/cncfminutes\
cd cncfminutes
flux create source git podinfo \
helm repo add influxdata https://helm.influxdata.com/
helm upgrade --install my-release influxdata/influxdb2
helm upgrade --install telegraf-ds influxdata/telegraf-ds
create cluster role for the required access
kubectl edit cm telegraf-ds
kubectl get svc
Admin password for Influx dashboard ->
echo $(kubectl get secret my-release-influxdb2-auth -o "jsonpath={.data['admin-password']}" --namespace default | base64 --decode)
sudo curl -sSLf k0s.sh | sudo sh
sudo k0s install controller
sudo curl -sSLf k0s.sh | sudo sh
sudo k0s install controller --enable-worker
k0s kubectl get nodes
sudo systemctl start k0scontroller
sudo systemctl enable k0scontroller
sudo k0s kubectl get nodes
sudo cp /var/lib/k0s/pki/admin.conf ~/admin.conf
export KUBECONFIG=~/admin.conf
@saiyam1814
saiyam1814 / gist:e239021ef17298badbb9e76c678efc8a
Created July 5, 2021 02:51
Kubernetes + containerd setup and longhorn deep dive
Controlplane=74.220.21.97
worker1=74.220.17.184
worker2=74.220.20.154
worker3=74.220.18.125
cat <<EOF | sudo tee /etc/modules-load.d/containerd.conf
overlay
br_netfilter
EOF
# Fleet multi cluster setup
kubectl config view -o json --raw | jq -r '.clusters[].cluster["certificate-authority-data"]' | base64 -d > ca.pem
API_SERVER_URL="https://212.2.246.8:6443"
API_SERVER_CA="ca.pem"
helm -n fleet-system install --create-namespace --wait fleet-crd https://github.com/rancher/fleet/releases/download/v0.3.3/fleet-crd-0.3.3.tgz
helm -n fleet-system install --create-namespace --wait \
--set apiServerURL="${API_SERVER_URL}" \
--set-file apiServerCA="${API_SERVER_CA}" \
fleet https://github.com/rancher/fleet/releases/download/v0.3.3/fleet-0.3.3.tgz
@saiyam1814
saiyam1814 / gist:7b4f5e9d6024bed53c731aa56efaad95
Last active March 20, 2021 14:01
Kubernetes application deployment
Kind cluster create
https://kind.sigs.k8s.io/docs/user/quick-start/
kind create cluster --name=demo --kubeconfig=/Users/saiyampathak/config
kind delete cluster --name=demo
===========================================================================
K3s Kubernetes
curl -sfL https://get.k3s.io | sh -
kubectl create deployment test --image=saiyam911/ketch-cd:v2
@saiyam1814
saiyam1814 / gist:20009bcbe24470c16825e5d7113b1b3f
Last active March 1, 2021 04:54
Ketch Canary Deployment
Create a Kubernetes cluster (Civo K3s in this case)
Have traefik2 Installed
Cert manager installed ->
kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v1.0.3/cert-manager.yaml
Install Ketch Controller -> kubectl apply -f https://github.com/shipa-corp/ketch/releases/download/v0.2.0/ketch-controller.yaml
Get the ingress IP
create Ketch pool ->
ketch pool add saiyam --ingress-service-endpoint 212.2.243.96 --ingress-type traefik
create the app ->
ketch app create demo --pool saiyam
curl -sfL https://get.k3s.io | sh -
kubectl apply -f https://raw.githubusercontent.com/longhorn/longhorn/v1.1.0/deploy/longhorn.yaml
kubectl edit svc longhorn-frontend -n longhorn-system
kubectl patch storageclass local-path -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'
kubectl patch storageclass longhorn -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
az connectedk8s list -otable
az connectedk8s connect --name democivo --resource-group Demo1 --location eastus --tags cloud=civo --kube-config=civo3
az k8sconfiguration create --name test --cluster-name democivo --resource-group Demo1 --operator-instance-name democivo --operator-namespace demo --repository-url https://github.com/saiyam1814/azurearc --scope cluster --cluster-type connectedClusters