Skip to content

Instantly share code, notes, and snippets.

View nilesh93's full-sized avatar
🎯
Focusing

Nilesh Jayanandana nilesh93

🎯
Focusing
  • @platformer-com
  • Colombo, Sri Lanka
View GitHub Profile
#!/bin/bash
sudo apt-get update
sudo apt install nfs-kernel-server
sudo mkdir -p /data
sudo chown nobody:nogroup /data
sudo chmod 777 /data
# add ip address ranges
#!/bin/bash
curl -o /usr/local/bin/cfssl https://pkg.cfssl.org/R1.2/cfssl_linux-amd64
curl -o /usr/local/bin/cfssljson https://pkg.cfssl.org/R1.2/cfssljson_linux-amd64
chmod +x /usr/local/bin/cfssl*
export PATH=$PATH:/usr/local/bin
#!/bin/bash
## Generic installation on all nodes
## Enable IP Forwarding
sysctl -w net.ipv4.ip_forward=1
sed -i 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/g' /etc/sysctl.conf
sudo sysctl -p /etc/sysctl.conf
## Disable Swap
swapoff -a
#!bin/bash
sudo ufw allow http
sudo ufw allow https
sudo ufw allow 6443/tcp # apiserver
sudo ufw allow 7000/tcp # stats
sudo ufw allow 9101/tcp # metrics exporter
sudo apt-get -y install haproxy
sudo service haproxy restart
apiVersion: kubeadm.k8s.io/v1beta1
kind: ClusterConfiguration
kubernetesVersion: v1.14.3 # change according to kubeadm supported version
apiServer:
certSANs:
- 127.0.0.1
- cluster-api.example.com # change according to your requirements
extraArgs:
authorization-mode: Node,RBAC
feature-gates: "TTLAfterFinished=true"
#!/bin/bash
yum -y update
yum -y install net-tools wget telnet yum-utils device-mapper-persistent-data lvm2
### Add Docker repository.
yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo -y
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: nfs-busybox
spec:
replicas: 1
selector:
matchLabels:
name: nfs-busybox
template:
apiVersion: v1
kind: PersistentVolume
metadata:
name: nfs
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteMany
nfs:
apiVersion: v1
kind: Service
metadata:
name: nfs-server
spec:
# clusterIP: 10.3.240.20
ports:
- name: nfs
port: 2049
- name: mountd
@nilesh93
nilesh93 / nfs-server.yaml
Created July 30, 2018 14:49
Kubernetes NFS Server 001
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: nfs-server
spec:
replicas: 1
selector:
matchLabels:
role: nfs-server
template: