This file contains 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 | |
sudo systemctl stop kubelet docker flanneld etcd2 && sudo rm -rf /etc/kubernetes/manifests/* && sudo rm -rf /etc/kubernetes/cni/ && sudo rm -rf /etc/systemd/system/kubelet.service && sudo rm -rf /etc/systemd/system/flanneld.service.d && sudo rm -rf /etc/systemd/system/docker.service.d/ && sudo rm -rf /var/lib/etcd2/* && sudo systemctl start etcd2 | |
sudo iptables --flush | |
sudo iptables -tnat --flush | |
sudo systemctl start kubeinstall.service | |
sudo systemctl start flanneld docker kubelet |
This file contains 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
apt-get install -y apt-transport-https ca-certificates && \ | |
apt-key adv \ | |
--keyserver hkp://ha.pool.sks-keyservers.net:80 \ | |
--recv-keys 58118E89F3A912897C070ADBF76221572C52609D && \ | |
echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list && \ | |
apt-get update && \ | |
apt-get install -y docker-engine=1.12.6-0~ubuntu-xenial && \ | |
docker run -d --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.2.0 <server-url> |
This file contains 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 | |
while true; do | |
kubectl get pvc --all-namespaces -o json | jq '.items[] | select(.metadata.annotations["volume.beta.kubernetes.io/storage-class"]=="auto-provision" and .status.phase=="Pending")' | jq -r '[.metadata.name, .spec.resources.requests.storage] | @csv' | sed s/\"//g | sed s/Gi//g | sed s/-pvc/-pv/ | awk -F ',' '{ print "./kismatic volume add " $2 " " $1 " -r 1 -d 2 -c=\"auto-provision\" -a 10.10.*.*"}' | sh | |
sleep 10 | |
done; |
This file contains 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
# --volume-plugin-dir=/var/lib/rancher/etc/vol-plugins | |
apt update && apt install -y docker.io && docker pull rancher/server:stable && docker pull rancher/agent:v1.2.6 | |
apt update && apt install -y docker.io && docker pull rancher/agent:v1.2.6 | |
docker run -d --name=rancher-server --restart=unless-stopped -p 8080:8080 rancher/server:stable |
This file contains 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
# --volume-plugin-dir=/var/lib/rancher/etc/vol-plugins | |
apt update && apt install -y docker.io && docker pull rancher/server:stable && docker pull rancher/agent:v1.2.6 | |
apt update && apt install -y docker.io && docker pull rancher/agent:v1.2.6 | |
docker run -d --name=rancher-server --restart=unless-stopped -p 8080:8080 rancher/server:stable | |
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl | |
chmod a+x kubectl | |
mv kubectl /usr/local/bin | |
mkdir ~/.kube | |
touch ~/.kube/config |
This file contains 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 | |
apt-get update | |
apt-get install -y \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - | |
add-apt-repository \ |
This file contains 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 openebs | |
kubectl apply -f https://raw.githubusercontent.com/openebs/openebs/master/k8s/openebs-operator.yaml | |
kubectl apply -f https://raw.githubusercontent.com/openebs/openebs/master/k8s/openebs-storageclasses.yaml | |
# install helm | |
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash |
This file contains 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/sh | |
docker run -d --name "gitlab-runner-$1" --restart always \ | |
-v /var/run/docker.sock:/var/run/docker.sock \ | |
-v /srv/gitlab-runner/config:/etc/gitlab-runner \ | |
gitlab/gitlab-runner:latest | |
docker exec -it "gitlab-runner-$1" gitlab-runner register -n \ | |
--url "$3/ci" \ | |
--registration-token "$2" \ |
This file contains 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
#cloud-config | |
package_update: true | |
runcmd: | |
- snap install docker --channel=17.03/stable | |
This file contains 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
public class Hard { | |
public static void main(String[] args) { | |
for(int i = 0; i < 100; i++) { | |
for(int j = 0; j < 100; j++) { | |
assert addWithoutPlus(i,j) == i + j; | |
} | |
} |
OlderNewer