Skip to content

Instantly share code, notes, and snippets.

@arashkaffamanesh
arashkaffamanesh / RKE-TF-installer.sh
Created February 9, 2020 08:01 — forked from csiens/RKE-TF-installer.sh
Wrapper to setup an RKE cluster with TungstenFabric as the CNI
#!/usr/bin/env bash
#
# Run this as root on the first master node. You must be able to ssh as the root user to each node via ssh keys
# installed at /root/.ssh/ on the first master node. The public ssh key MUST be in the /root/.ssh/authorized_keys
# file on ALL nodes including the first master. Use "ssh-keygen" to create an ssh keypair and use "ssh-copy-id NODE_IP"
# to distribute the public key to ALL nodes. The nodes also need to be configured for passwordless sudo, most cloud
# providers and infrastructure provisioners do this by default.
#
# The following commands are used to perpare a generic EC2 or GCE instance and run the script.
# # enter an interactive sudo session
1) Install Ubuntu on nodes and set hostname and IP on all nodes
2) Prepare nodes. Run these commands as the root user on all nodes
#turn off swap
swapoff -a
#install packages
apt-get install -y ntp docker.io
@arashkaffamanesh
arashkaffamanesh / README.md
Created December 18, 2019 22:15 — forked from mhausenblas/README.md
Scripting EKS on ARM

EKS on ARM

The xarm-install.sh script allows you to install and use Amazon EKS on ARM (xARM) with a single command.

Make sure you have aws, eksctl, kubectl, and jq installed. So far tested with bash on macOS.

chmod +x xarm-install.sh

./xarm-install.sh
@arashkaffamanesh
arashkaffamanesh / create_user_and_kubeconfig_rancher2.sh
Created December 9, 2019 11:14 — forked from superseb/create_user_and_kubeconfig_rancher2.sh
Create local user and generate kubeconfig in Rancher 2 via API
#!/bin/bash
RANCHERENDPOINT=https://your_rancher_endpoint/v3
# The name of the cluster where the user needs to be added
CLUSTERNAME=your_cluster_name
# Username, password and realname of the user
USERNAME=username
PASSWORD=password
REALNAME=myrealname
# Role of the user
GLOBALROLE=user

I've been working with Kafka for over 7 years. I inevitably find myself doing the same set of activities while I'm developing or working with someone else's system. Here's a set of Kafka productivity hacks for doing a few things way faster than you're probably doing them now. 🔥

Get the tools

@arashkaffamanesh
arashkaffamanesh / kubernetes-latest-image.md
Created April 19, 2019 21:43 — forked from BrandonPotter/kubernetes-latest-image.md
Force Kubernetes to pull latest container image in a deployment

Force Kubernetes to pull latest container image in a deployment

kubectl patch deployment DEPLOYMENT_NAME -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"`date +'%s'`\"}}}}}"
for SERVICES in etcd kube-apiserver kube-controller-manager kube-scheduler flanneld; do
	systemctl restart $SERVICES
	systemctl enable $SERVICES
	systemctl status $SERVICES
done

restart kubelet/node services

for SERVICES in kube-proxy kubelet flanneld docker; do

systemctl restart $SERVICES

apiVersion: v1
kind: Namespace
metadata:
name: rook-ceph-system
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: cephclusters.ceph.rook.io
spec:
#!/bin/sh
docker rm -f $(docker ps -qa)
docker rmi -f $(docker images -q)
docker volume rm $(docker volume ls -q)
for mount in $(mount | grep tmpfs | grep '/var/lib/kubelet' | awk '{ print $3 }') /var/lib/kubelet /var/lib/rancher; do umount $mount; done
cleanupdirs="/etc/ceph /etc/cni /etc/kubernetes /opt/cni /opt/rke /run/secrets/kubernetes.io /run/calico /run/flannel /var/lib/calico /var/lib/etcd /var/lib/cni /var/lib/kubelet /var/lib/rancher/rke/log /var/log/containers /var/log/pods /var/run/calico"
for dir in $cleanupdirs; do
echo "Removing $dir"
rm -rf $dir
done
@arashkaffamanesh
arashkaffamanesh / helm-cheatsheet.md
Created November 26, 2018 12:43 — forked from tuannvm/cka.md
#Helm #Kubernetes #cheatsheet, happy helming!