Skip to main content
Sign in
Snippets Groups Projects
Commit 2a0d4a21 authored by František Dvořák's avatar František Dvořák
Browse files

Moar refactoring and cleanups - common directory for ansible

parent 1a8f3ff2
Branches gpu_staging
No related tags found
No related merge requests found
Showing
with 175 additions and 16 deletions
# export the NFS directory to all the cluster members
/exports {% for host in groups['allnodes'] -%}{{ hostvars[host].ansible_default_ipv4.address }}(rw,async,no_root_squash,no_subtree_check) {{ hostvars[host].ansible_default_ipv6.address }}(rw,async,no_root_squash,no_subtree_check) {% endfor -%}
address {
email-domain {{ fromdomain }};
};
---
#
# Upgrade kubernetes cluster
#
# https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade/
#
# Usage example:
#
# VERSION=1.30.2
# ansible-playbook playbooks/upgrade.yaml --extra-vars "version=$VERSION"
#
- name: Upgrade and hold kubeadm package
hosts: master,ingress,nfs,worker,gpu
become: true
tasks:
- name: New k8s repository
copy:
dest: /etc/apt/sources.list.d/pkgs_k8s_io_core_stable_v1_30_deb.list
content: deb https://pkgs.k8s.io/core:/stable:/v1.30/deb/ /
mode: 0644
- name: Upgrade packages
apt:
name: kubeadm={{ version }}*
state: present
force: true
update_cache: true
- name: Hold packages
dpkg_selections:
name: "{{ item }}"
selection: hold
loop:
- kubeadm
- name: Upgrade k8s master
hosts: master
become: true
tasks:
- name: Upgrade kubeadm
command: |
kubeadm upgrade apply --yes v{{ version }}
when: true
- name: Upgrade k8s nodes
hosts: ingress,nfs,worker,gpu
become: true
tasks:
- name: Upgrade kubeadm
command: |
kubeadm upgrade node
when: true
- name: Upgrade and hold packages
hosts: master,ingress,nfs,worker,gpu
become: true
tasks:
- name: Upgrade packages
apt:
name: kubectl={{ version }}*, kubelet={{ version }}*
state: present
force: true
update_cache: true
- name: Hold packages
dpkg_selections:
name: "{{ item }}"
selection: hold
loop:
- kubectl
- kubelet
- name: Restart kubelet
systemd:
state: restarted
name: kubelet
- name: Cleanup old k8s repository
file:
path: /etc/apt/sources.list.d/pkgs_k8s_io_core_stable_v1_29_deb.list
state: absent
# pinned by grycap.kubernetes
# - name: Upgrade networking
# hosts: master
# become: true
# tasks:
# - name: Upgrade weave
# shell: |
# set -o pipefail
# kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
# environment:
# KUBECONFIG: /etc/kubernetes/admin.conf
# args:
# executable: /bin/bash
# when: true
variable "ip_pool" {
type = string
description = "The name of the public IP pool for the servers"
}
variable "net_name" {
type = string
description = "The name of the IPv4 network"
}
variable "net6_name" {
type = string
description = "The name of the IPv6 network"
}
variable "site_name" {
type = string
description = "Site identifier for internal host names"
}
variable "gpu_flavor_name" {
type = string
description = "Name of the GPU flavor"
}
variable "master_flavor_name" {
type = string
description = "Name of the master flavor"
}
variable "worker_flavor_name" {
type = string
description = "Name of the worker flavor"
}
variable "extra_workers" {
type = number
description = "Number of extra workers to create"
}
variable "gpu_workers" {
type = number
description = "Number of GPU workers to create"
}
variable "docker_volumes_size" {
type = number
description = "Size of volumes for docker (GB)"
}
variable "nfs_volume_size" {
type = number
description = "Size of volume for NFS server (GB)"
}
variable "scratch_volumes_size" {
type = number
description = "Size of volume for ephemeral volumes (GB)"
}
variable "squid_volume_size" {
type = number
description = "Size of volume for squid proxy, CVMFS cache (GB)"
}
../../cesnet-central/playbooks/cvmfs.yaml ../../common/playbooks/cvmfs.yaml
\ No newline at end of file \ No newline at end of file
../../../cesnet-central/playbooks/files/calico.yaml ../../../common/playbooks/files/calico.yaml
\ No newline at end of file \ No newline at end of file
../../../cesnet-central/playbooks/files/etc ../../../common/playbooks/files/etc
\ No newline at end of file \ No newline at end of file
../../../cesnet-central/playbooks/files/usr ../../../common/playbooks/files/usr
\ No newline at end of file \ No newline at end of file
../../cesnet-central/playbooks/k8s.yaml ../../common/playbooks/k8s.yaml
\ No newline at end of file \ No newline at end of file
../../cesnet-central/playbooks/squid.yaml ../../common/playbooks/squid.yaml
\ No newline at end of file \ No newline at end of file
# export the NFS directory to all the cluster members
/exports {% for host in groups['allnodes'] -%}{{ hostvars[host].ansible_default_ipv4.address }}(rw,async,no_root_squash,no_subtree_check) {% endfor -%}
../../../../common/playbooks/templates/etc/exports.ipv4
\ No newline at end of file
../../../../cesnet-central/playbooks/templates/etc/mailutils.conf ../../../../common/playbooks/templates/etc/mailutils.conf
\ No newline at end of file \ No newline at end of file
../../../../common/playbooks/templates/etc/squid
\ No newline at end of file
../../../../../../cesnet-central/playbooks/templates/etc/squid/conf.d/allcluster.conf
\ No newline at end of file
/home/valtri/notebooks-operations.eosc/cesnet-central/playbooks/upgrade.yaml ../../common/playbooks/upgrade.yaml
\ No newline at end of file \ No newline at end of file
../../cesnet-central/playbooks/cvmfs.yaml ../../common/playbooks/cvmfs.yaml
\ No newline at end of file \ No newline at end of file
../../../cesnet-central/playbooks/files/calico.yaml ../../../common/playbooks/files/calico.yaml
\ No newline at end of file \ No newline at end of file
../../../cesnet-central/playbooks/files/etc ../../../common/playbooks/files/etc
\ No newline at end of file \ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment