This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Create and describe an alpine and an nginx pod then delete pods | |
#Create and describe alpine pod | |
echo “apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: alpine | |
namespace: default | |
spec: | |
containers: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Creates two kubernetes jobs using yaml config and displays the description and log of the job | |
echo “apiVersion: batch/v1 | |
kind: Job | |
metadata: | |
name: pi | |
spec: | |
template: | |
spec: | |
containers: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#install kubernetes on CentOS | |
#run as root | |
#kubernetes will refuse to run on CentOS if swapoff is on | |
#line 1 & 2 ensure swapoff doesn’t interfere with k8 | |
swapoff -a | |
sed -i '/ swap swap /s/^/#/' /etc/fstab | |
yum -y update | |
yum -y install docker | |
systemctl enable docker && systemctl start docker | |
echo “[kubernetes] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Initiate Kubernetes Master using flannel for CNI | |
#Run command as regular user | |
sudo kubeadm init --pod-network-cidr=10.244.0.0/16 | |
mkdir -p $HOME/.kube | |
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config | |
sudo chown $(id -u):$(id -g) $HOME/.kube/config | |
#Install and start flannel for CNI on pods |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#install kubernetes on ubuntu | |
#run commands as root | |
apt-get upgrade | |
apt-get install docker.io | |
echo “{ | |
"exec-opts": ["native.cgroupriver=systemd"] | |
}” >> /etc/docker/daemon.json | |
apt-get install curl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Installs Java 8 and Jenkins on Debian based machine such as Ubuntu | |
#Run if a java version greater than java 8 is installed | |
#sudo apt-get -y remove java | |
sudo apt-get -y install java-1.8.0-openjdk | |
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add - | |
#Appends sources lists to include jenkins pkg repo | |
echo 'deb https://pkg.jenkins.io/debian binary/' >> /etc/apt/sources.list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Installs Java 8 and Jenkins on CentOS7 | |
#Run if a java version greater than java 8 is installed | |
#sudo apt-get -y remove java | |
sudo yum -y install java-1.8.0-openjdk | |
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo | |
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
yum update | |
yum install docker | |
systemctl enable docker && systemctl start docker && systemctl status docker | |
#Replace *user* with actual user name | |
usermod -aG docker user | |
NewerOlder