Skip to content
This repository was archived by the owner on Nov 11, 2024. It is now read-only.

Commit e2678a5

Browse files
committed
Add Kubernetes setup script on CentOS
Signed-off-by: Zhizhen Tang <[email protected]>
1 parent d33333d commit e2678a5

File tree

7 files changed

+109
-24
lines changed

7 files changed

+109
-24
lines changed

deployment/kubernetes/update_yaml.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,11 @@ def input_node_name(service_name, image_name="sw"):
210210

211211
yaml_utils.dump_yaml_file(data, fileName)
212212
i += 1
213-
create_node = input("Do you still need to deploy the vod transcode service? ([y] or [n]):")
213+
create_node = input("Do you still need to deploy the live transcode service? ([y] or [n]):")
214214
while True:
215215
if create_node.lower() == "y" or create_node.lower() == "n":
216216
break
217217
else:
218-
create_node = input("Do you still need to deploy the vod transcode service? ([y] or [n]):")
218+
create_node = input("Do you still need to deploy the live transcode service? ([y] or [n]):")
219219
if create_node.lower() == "n":
220220
break

script/Kubernetes_remove_ubuntu.sh renamed to script/Kubernetes_remove.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,19 @@ try_command kubeadm reset
3737
try_command iptables -F && iptables -t nat -F && iptables -t mangle -F && iptables -X
3838

3939
# Remove Package
40-
try_command apt-get remove kubelet kubeadm kubectl
41-
try_command apt -y autoremove
40+
try_command lsb_release -si > /dev/null
41+
42+
LINUX_DISTRO=`lsb_release -si`
43+
44+
if [ "$LINUX_DISTRO" == "Ubuntu" ]; then
45+
try_command apt-get remove kubelet kubeadm kubectl
46+
try_command apt -y autoremove
47+
elif [ "$LINUX_DISTRO" == "CentOS" ]; then
48+
try_command yum autoremove kubelet kubeadm kubectl
49+
else
50+
echo -e $ECHO_PREFIX_INFO "The removal will be cancelled."
51+
echo -e $ECHO_PREFIX_INFO "The CDN-Transcode-Sample does not support this OS, please use Ubuntu 18.04 or CentOS 7.6.\n"
52+
exit 1
53+
fi
54+
55+
echo -e $ECHO_PREFIX_INFO "removal completed."

script/Kubernetes_setup_ubuntu_master.sh renamed to script/Kubernetes_setup_master.sh

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,26 +44,53 @@ proxy_http=$http_proxy
4444
proxy_https=$https_proxy
4545
export http_proxy=$proxy_http
4646
export https_proxy=$proxy_https
47-
try_command apt-get update && apt-get install -y apt-transport-https curl
48-
try_command curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
49-
try_command cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
47+
48+
try_command swapoff -a
49+
50+
try_command lsb_release -si > /dev/null
51+
52+
LINUX_DISTRO=`lsb_release -si`
53+
54+
if [ "$LINUX_DISTRO" == "Ubuntu" ]; then
55+
try_command apt-get update && apt-get install -y apt-transport-https curl
56+
try_command curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
57+
try_command cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
5058
deb https://apt.kubernetes.io/ kubernetes-xenial main
5159
EOF
52-
try_command apt-get update
53-
try_command apt-get install -y kubelet kubeadm kubectl
54-
try_command apt-mark hold kubelet kubeadm kubectl
60+
try_command apt-get update
61+
try_command apt-get install -y kubelet kubeadm kubectl
62+
try_command apt-mark hold kubelet kubeadm kubectl
63+
elif [ "$LINUX_DISTRO" == "CentOS" ]; then
64+
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
65+
[kubernetes]
66+
name=Kubernetes
67+
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
68+
enabled=1
69+
gpgcheck=1
70+
repo_gpgcheck=1
71+
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
72+
exclude=kube*
73+
EOF
74+
yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes
75+
else
76+
echo -e $ECHO_PREFIX_INFO "The installation will be cancelled."
77+
echo -e $ECHO_PREFIX_INFO "The CDN-Transcode-Sample does not support this OS, please use Ubuntu 18.04 or CentOS 7.6.\n"
78+
exit 1
79+
fi
80+
5581
try_command systemctl enable --now kubelet
5682
try_command systemctl start kubelet
5783

58-
try_command swapoff -a
5984
try_command modprobe br_netfilter
85+
6086
try_command cat <<EOF > /etc/sysctl.d/k8s.conf
6187
net.bridge.bridge-nf-call-ip6tables = 1
6288
net.bridge.bridge-nf-call-iptables = 1
6389
EOF
6490
try_command sysctl --system
6591

6692
# Docker cgroupdriver
93+
try_command mkdir -p /etc/docker
6794
try_command cat > /etc/docker/daemon.json <<EOF
6895
{
6996
"exec-opts": ["native.cgroupdriver=systemd"],
@@ -93,3 +120,5 @@ export http_proxy=$proxy_http
93120
export https_proxy=$proxy_https
94121
try_command kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/a70459be0084506e4ec919aa1c114638878db11b/Documentation/kube-flannel.yml
95122
try_command sed -i '/- kube-apiserver/a\\ - --service-node-port-range=1-65535' /etc/kubernetes/manifests/kube-apiserver.yaml
123+
124+
echo -e $ECHO_PREFIX_INFO "Installation completed."

script/Kubernetes_setup_ubuntu_node.sh renamed to script/Kubernetes_setup_node.sh

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,52 @@ fi
4040

4141
# Install packages
4242
# Set Proxy if need
43-
try_command apt-get update && apt-get install -y apt-transport-https curl
44-
try_command curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
45-
try_command cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
43+
try_command swapoff -a
44+
45+
try_command lsb_release -si > /dev/null
46+
47+
LINUX_DISTRO=`lsb_release -si`
48+
49+
if [ "$LINUX_DISTRO" == "Ubuntu" ]; then
50+
try_command apt-get update && apt-get install -y apt-transport-https curl
51+
try_command curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
52+
try_command cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
4653
deb https://apt.kubernetes.io/ kubernetes-xenial main
4754
EOF
48-
try_command apt-get update
49-
try_command apt-get install -y kubelet kubeadm kubectl
50-
try_command apt-mark hold kubelet kubeadm kubectl
55+
try_command apt-get update
56+
try_command apt-get install -y kubelet kubeadm kubectl
57+
try_command apt-mark hold kubelet kubeadm kubectl
58+
elif [ "$LINUX_DISTRO" == "CentOS" ]; then
59+
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
60+
[kubernetes]
61+
name=Kubernetes
62+
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
63+
enabled=1
64+
gpgcheck=1
65+
repo_gpgcheck=1
66+
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
67+
exclude=kube*
68+
EOF
69+
yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes
70+
else
71+
echo -e $ECHO_PREFIX_INFO "The installation will be cancelled."
72+
echo -e $ECHO_PREFIX_INFO "The CDN-Transcode-Sample does not support this OS, please use Ubuntu 18.04 or CentOS 7.6.\n"
73+
exit 1
74+
fi
75+
5176
try_command systemctl enable --now kubelet
5277
try_command systemctl start kubelet
5378

54-
try_command swapoff -a
5579
try_command modprobe br_netfilter
80+
5681
try_command cat <<EOF > /etc/sysctl.d/k8s.conf
5782
net.bridge.bridge-nf-call-ip6tables = 1
5883
net.bridge.bridge-nf-call-iptables = 1
5984
EOF
6085
try_command sysctl --system
6186

6287
# Docker cgroupdriver
88+
try_command mkdir -p /etc/docker
6389
try_command cat > /etc/docker/daemon.json <<EOF
6490
{
6591
"exec-opts": ["native.cgroupdriver=systemd"],
@@ -74,3 +100,5 @@ try_command systemctl daemon-reload
74100
try_command systemctl restart docker
75101
try_command systemctl restart kubelet
76102
try_command kubeadm config images pull
103+
104+
echo -e $ECHO_PREFIX_INFO "Installation completed."

script/install_dependency.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ if [ "$LINUX_DISTRO" == "Ubuntu" ]; then
5757
try_command apt-get install -y docker-ce docker-ce-cli containerd.io
5858
try_command curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
5959
try_command curl -L https://github.com/kubernetes/kompose/releases/download/v1.18.0/kompose-linux-amd64 -o /usr/local/bin/kompose
60-
try_command chmod +x /usr/local/bin/kompose
60+
try_command chmod +x /usr/local/bin/kompose
6161
try_command apt-get install -y python3-pip
6262
try_command pip3 install ruamel.yaml
6363
elif [ "$LINUX_DISTRO" == "CentOS" ]; then
@@ -67,8 +67,8 @@ elif [ "$LINUX_DISTRO" == "CentOS" ]; then
6767
try_command yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
6868
try_command yum install -y docker-ce docker-ce-cli containerd.io
6969
try_command curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
70-
try_command curl -L https://github.com/kubernetes/kompose/releases/download/v1.18.0/kompose-linux-amd64 -o /usr/local/bin/kompose
71-
try_command chmod +x /usr/local/bin/kompose
70+
try_command curl -L https://github.com/kubernetes/kompose/releases/download/v1.18.0/kompose-linux-amd64 -o /usr/bin/kompose
71+
try_command chmod +x /usr/bin/kompose
7272
try_command yum install -y epel-release
7373
try_command yum install -y python36 python36-pip
7474
try_command pip3 install ruamel.yaml

script/nfs_setup_ubuntu.sh renamed to script/nfs_setup.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,19 @@ fi
3636
try_command echo -e "$PWD/../volume/video/archive *(rw,sync,no_root_squash,no_all_squash,no_subtree_check)" > /etc/exports
3737
try_command echo -e "$PWD/../volume/video/dash *(rw,sync,no_root_squash,no_all_squash,no_subtree_check)" >> /etc/exports
3838
try_command echo -e "$PWD/../volume/video/hls *(rw,sync,no_root_squash,no_all_squash,no_subtree_check)" >> /etc/exports
39-
try_command apt-get install nfs-kernel-server
40-
try_command /etc/init.d/nfs-kernel-server restart
39+
40+
try_command lsb_release -si > /dev/null
41+
42+
LINUX_DISTRO=`lsb_release -si`
43+
44+
if [ "$LINUX_DISTRO" == "Ubuntu" ]; then
45+
try_command apt-get install nfs-kernel-server
46+
try_command /etc/init.d/nfs-kernel-server restart
47+
elif [ "$LINUX_DISTRO" == "CentOS" ]; then
48+
try_command yum install -y rpcbind nfs-utils
49+
try_command systemctl start rpcbind nfs-server
50+
else
51+
echo -e $ECHO_PREFIX_INFO "The installation will be cancelled."
52+
echo -e $ECHO_PREFIX_INFO "The CDN-Transcode-Sample does not support this OS, please use Ubuntu 18.04 or CentOS 7.6.\n"
53+
exit 1
54+
fi

xcode-server/ffmpeg-hw/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ RUN wget -O - ${X265_REPO} | tar xz && mv x265-${X265_VER} x265 && \
144144

145145
# Fetch SVT-HEVC
146146
ARG SVT_HEVC_VER=252ff3d18bc1997a5af989ad4e67e025c93dbf68
147-
+ARG SVT_HEVC_REPO=https://github.com/OpenVisualCloud/SVT-HEVC.git
147+
ARG SVT_HEVC_REPO=https://github.com/OpenVisualCloud/SVT-HEVC.git
148148

149149
RUN git clone ${SVT_HEVC_REPO} && \
150150
cd SVT-HEVC/Build/linux && \

0 commit comments

Comments
 (0)