Verified Commit bbae1c73 authored by Radim Peša's avatar Radim Peša
Browse files

Migrating workers to hpc.

parent e2f57747
......@@ -6,6 +6,7 @@ retry_files_enabled = False
deprecation_warnings=False
remote_user = ubuntu
host_key_checking = False
forks = 50
[inventory]
#enable_plugins = openstack,host_list, script, yaml, ini, auto
......
#!/bin/bash
docker rm -f $(sudo docker ps -aq);
docker volume rm $(sudo docker volume ls -q);
rm -rf /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 mount in $(mount | grep tmpfs | grep '/var/lib/kubelet' | awk '{ print $3 }') /var/lib/kubelet /var/lib/rancher; do umount $mount; done
rm -f /var/lib/containerd/io.containerd.metadata.v1.bolt/meta.db
sudo systemctl restart containerd
sudo systemctl restart docker
IPTABLES="/sbin/iptables"
cat /proc/net/ip_tables_names | while read table; do
$IPTABLES -t $table -L -n | while read c chain rest; do
if test "X$c" = "XChain" ; then
$IPTABLES -t $table -F $chain
fi
done
$IPTABLES -t $table -X
done
......@@ -5,7 +5,7 @@
name: "{{ username }}"
shell: /bin/bash
password: "{{ username_pwd }}"
- name: Add ssh keys to user
authorized_key:
user: "{{ username }}"
......@@ -53,14 +53,15 @@
owner: "{{ username }}"
group: "{{ username }}"
#- name: Copy scripts to tools
# copy:
# dest: "{{ tools_dir }}"
# owner: "{{ username }}"
# group: "{{ username }}"
# with_items:
# - renew_cert.sh
# when: inventory_hostname == "dataportal.edirex.ics.muni.cz"
- name: Copy scripts to tools
copy:
src: "{{ item }}"
dest: "{{ tools_dir }}"
owner: "{{ username }}"
group: "{{ username }}"
with_items:
- clean_k8s.sh
#- name: Certificate renew job in cron
# cron:
......
......@@ -3,7 +3,7 @@ resource "openstack_compute_instance_v2" "k8s_cluster_worker" {
count = "${var.k8s_worker_node_count}"
name = "${var.k8s_cluster_name}-worker-${count.index + 1}"
image_name = "${var.image_name}"
flavor_name = "${var.flavor_4cpu16ram}"
flavor_name = "${var.flavor_hpc_4cpu16ram}"
key_pair = "${var.key_pair}"
security_groups = ["ingress_ssh", "ingress_icmp", "default", "allow_ingress_http_https"]
......
......@@ -67,5 +67,5 @@ variable "k8s_master_node_count" {
}
variable "k8s_worker_node_count" {
default = "10"
default = "7"
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment