Skip to content

Commit 9754515

Browse files
committed
Fixed installation of Stackable package repo and switch to openjdk-11
1 parent a715066 commit 9754515

File tree

1 file changed

+54
-16
lines changed

1 file changed

+54
-16
lines changed

quickstart/stackable-quickstart.sh

Lines changed: 54 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,38 @@ function install_prereqs {
2727
. /etc/os-release
2828

2929
if [ "$ID" = "centos" ] || [ "$ID" = "redhat" ]; then
30-
if [ "$VERSION" = "8" ] || [ "$VERSION" = "7" ]; then
30+
if [ "$VERSION_ID" = "8" ] || [ "$VERSION_ID" = "7" ]; then
3131
echo "$ID $VERSION found"
32-
REPO_URL="https://repo.stackable.tech/repository/rpm-${REPO_TYPE}/el${VERSION}"
32+
REPO_URL="https://repo.stackable.tech/repository/rpm-${REPO_TYPE}/el${VERSION_ID}"
3333
INSTALLER=/usr/bin/yum
3434
install_prereqs_redhat
3535
else
36-
echo "Only Redhat/CentOS 7 & 8 are supported. This host is running $VERSION."
36+
echo "Only Redhat/CentOS 7 & 8 are supported. This host is running $VERSION_ID."
37+
exit 1
3738
fi
38-
elif [ "$ID" = "ubuntu" ] || [ "$ID" = "debian" ]; then
39-
REPO_URL="https://repo.stackable.tech/repository/deb-${REPO_TYPE}"
40-
INSTALLER=apt
41-
install_prereqs_debian
39+
elif [ "$ID" = "ubuntu" ]; then
40+
if [ "$VERSION_ID" = "20.04" ]; then
41+
echo "$ID $VERSION_ID found"
42+
REPO_URL="https://repo.stackable.tech/repository/deb-${REPO_TYPE}"
43+
INSTALLER=apt
44+
install_prereqs_ubuntu
45+
else
46+
echo "Only Ubuntu 20.04 LTS is supported. This host is running $ID $VERSION_ID."
47+
exit 1
48+
fi
49+
elif [ "$ID" = "debian" ]; then
50+
if [ "$VERSION_ID" = "10" ]; then
51+
echo "$ID $VERSION_ID found"
52+
REPO_URL="https://repo.stackable.tech/repository/deb-${REPO_TYPE}"
53+
INSTALLER=apt
54+
install_prereqs_debian
55+
else
56+
echo "Only Debian 10 is supported. This host is running $ID $VERSION_ID."
57+
exit 1
58+
fi
59+
else
60+
echo "Unsupported operating system detected: $ID $VERSION_ID"
61+
exit 1
4262
fi
4363
}
4464

@@ -51,7 +71,7 @@ function install_prereqs_redhat {
5171
fi
5272

5373
# Download the Stackable GPG key used for package signing
54-
/usr/bin/yum -y install gnupg2 java-1.8.0-openjdk
74+
/usr/bin/yum -y install gnupg2 java-11-openjdk curl
5575
/usr/bin/curl -s "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xce45c7a0a3e41385acd4358916dd12f5c7a6d76a" > /etc/pki/rpm-gpg/RPM-GPG-KEY-stackable
5676
/usr/bin/rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-stackable
5777

@@ -65,7 +85,6 @@ gpgcheck=0" > /etc/yum.repos.d/stackable.repo
6585
/usr/bin/yum clean all
6686
}
6787

68-
6988
function install_prereqs_debian {
7089
echo "Installing Stackable APT repo"
7190

@@ -74,12 +93,25 @@ function install_prereqs_debian {
7493
exit 1
7594
fi
7695

77-
apt-get install gnupg openjdk-8-jdk -y
96+
apt-get -y install gnupg openjdk-11-jdk curl
7897
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 16dd12f5c7a6d76a
7998
echo "deb $REPO_URL buster main" > /etc/apt/sources.list.d/stackable.list
8099
apt update
81100
}
82101

102+
function install_prereqs_ubuntu {
103+
echo "Installing Stackable APT repo"
104+
105+
if [ -z $REPO_URL ]; then
106+
/usr/bin/echo "No YUM repo URL found, exiting."
107+
exit 1
108+
fi
109+
110+
apt-get -y install gnupg openjdk-11-jdk curl
111+
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 16dd12f5c7a6d76a
112+
echo "deb $REPO_URL buster main" > /etc/apt/sources.list.d/stackable.list
113+
apt update
114+
}
83115

84116
function install_k8s {
85117
echo "Installing K8s"
@@ -106,7 +138,7 @@ function install_crds {
106138

107139
function install_stackable_k8s_repo {
108140
echo Installing Stackable package repo
109-
cat <<EOF | kubectl apply -f -
141+
kubectl apply -f - <<EOF
110142
apiVersion: "stable.stackable.de/v1"
111143
kind: Repository
112144
metadata:
@@ -116,6 +148,7 @@ spec:
116148
properties:
117149
url: https://repo.stackable.tech/repository/packages/
118150
EOF
151+
119152
}
120153

121154
function check_operator_list {
@@ -289,24 +322,29 @@ install_prereqs
289322
# Install the K3s Kubernetes distribution
290323
install_k8s
291324

292-
# Install the Stackable Kubernetes repo
293-
install_stackable_k8s_repo
325+
# Install the Stackable CRDs
326+
install_crds
294327

295328
# Install the Stackable operators for the chosen components
296329
install_stackable_operators
297330

298-
# Install the Stackable CRDs
299-
install_crds
300-
301331
# Install the Stackable agent
302332
install_stackable_agent
303333

334+
# Install the Stackable Kubernetes repo
335+
install_stackable_k8s_repo
336+
304337
# Deploy Stackable Components
305338
for OPERATOR in ${OPERATORS[@]}; do
306339
echo "Deploying ${OPERATOR}"
307340
deploy_${OPERATOR}
308341
done
309342

343+
# Tested on CentOS 8
344+
# Tested on Ubuntu 20.04
345+
# Testing Debian 9
346+
# Testing Debian 10
347+
310348
# TODO: Create TLS certificate
311349
# TODO: Create Spark client configuration
312350
# TODO: Install Python

0 commit comments

Comments
 (0)