version: '3'
services:
a:
image: ubuntu
command: sleep 999
b:
image: ubuntu
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 | |
## | |
## This aims to be an alternative to `kubectl drain NODE`, overcoming | |
## some of its limitations. A GitHub issue was closed a while ago | |
## without any solution or alternatives. | |
## | |
## https://github.com/kubernetes/kubernetes/issues/48307 | |
## | |
## Even though `kubectl drain` respects PDBs defined by the user, |
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
# ## Configure 'ip' variable to bind kubernetes services on a | |
# ## different ip than the default iface | |
k8s-master01-prd-20190426 | |
k8s-master02-prd-20190426 | |
k8s-etcd01-prd-20190426 | |
k8s-etcd02-prd-20190426 | |
k8s-etcd03-prd-20190426 | |
k8s-etcd04-prd-20190426 | |
k8s-etcd05-prd-20190426 | |
k8s-node01-prd-20190426 |
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
# /usr/bin/ansible-playbook cluster.yml -b -i inventory/inventory.ini | |
PLAY [localhost] *************************************************************** | |
TASK [Check ansible version >=2.7.8] ******************************************* | |
Thursday 02 May 2019 20:59:59 -0300 (0:00:00.029) 0:00:00.029 ********** | |
ok: [localhost] => { | |
"changed": false, | |
"msg": "All assertions passed" | |
} |
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 | |
NODE_NAME=$1 | |
ROLLOUT_CMD=$2 | |
if [[ "$NODE_NAME" == "" ]]; then | |
echo " | |
USAGE: ./drain.sh <NODE_NAME> | |
Drains a node from its Deployments/Stateful set pods. |