-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpackages.sh
69 lines (61 loc) · 1.78 KB
/
packages.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
# Collection of functions to manage packages on SUSE Linux distributions
#######################################
# Install kubectl (Kubernetes CLI) on SUSE Linux
# Arguments:
# kubernetesVersion
# Examples:
# suselinux_install_kubectl 'v1.30'
#######################################
suselinux_install_kubectl() {
local kubernetesVersion=$1
# adds keys for new packages to be installed
cat <<EOF | sudo tee /etc/zypp/repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://pkgs.k8s.io/core:/stable:/$kubernetesVersion/rpm/
enabled=1
gpgcheck=1
gpgkey=https://pkgs.k8s.io/core:/stable:/$kubernetesVersion/rpm/repodata/repomd.xml.key
EOF
# refreshes packages and import new keys
zypper --gpg-auto-import-keys refresh
# installs Kubernetes CLI
zypper install -y kubectl
}
#######################################
# Install kubectl (Kubernetes CLI) on SUSE Linux
# Examples:
# suselinux_install_kubectl
#######################################
suselinux_install_helm() {
zypper install -y helm
}
#######################################
# Install git on SUSE Linux
# Examples:
# suselinux_install_kubectl
#######################################
suselinux_install_git() {
zypper install -y git
}
#######################################
# Install open-iscsi on SUSE Linux
# Examples:
# suselinux_install_openiscsi
#######################################
suselinux_install_openiscsi() {
zypper --gpg-auto-import-keys -q refresh
zypper --gpg-auto-import-keys -q install -y open-iscsi
systemctl -q enable iscsid
systemctl start iscsid
modprobe iscsi_tcp
}
#######################################
# Install Podman on SUSE Linux
# Examples:
# suselinux_install_kubectl
#######################################
suselinux_install_podman() {
zypper install -y podman
}