forked from scylladb/scylla-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-dependencies.sh
executable file
·83 lines (69 loc) · 2.07 KB
/
install-dependencies.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
#
# This file is open source software, licensed to you under the terms
# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
# distributed with this work for additional information regarding copyright
# ownership. You may not use this file except in compliance with the License.
#
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
set -euo pipefail
. /etc/os-release
debian_packages=(
ca-certificates
etcd
git
make
)
fedora_packages=(
etcd
git-core
golang-bin
make
# Unfortunately podman doesn't work very well with kubernetes. See
# https://fedoramagazine.org/docker-and-fedora-32/ for how to get
# docker to work on a current fedora.
moby-engine
)
if [ "$ID" = "fedora" ]
then
sudo dnf install -y "${fedora_packages[@]}"
fi
if [ "$ID" = "ubuntu" ] || [ "$ID" = "debian" ]
then
# If someone has a non-system installation of go, just use that.
if ! which go
then
sudo apt-get install golang
fi
# Similarly for docker
if ! which docker
then
sudo apt-get install -y docker.io
fi
sudo apt-get install -y "${debian_packages[@]}"
fi
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.3.0 sigs.k8s.io/kustomize/kustomize/v3@v3.5.1 github.com/goreleaser/goreleaser@v0.138.0
mkdir -p tmp
cd tmp
# Kubernetes commands don't work with "go get"
# https://github.com/kubernetes/kubernetes/issues/79384
git clone https://github.com/kubernetes/kubernetes.git
cd kubernetes
# v1.19.x requires go 1.15.0
git checkout v1.18.9
make WHAT=cmd/kube-apiserver
cp _output/bin/kube-apiserver $(go env GOPATH)/bin
cd ..
cd ..
rm -rf tmp
# KUBEBUILDER_ASSETS has to be a single directory
cp /usr/bin/etcd $(go env GOPATH)/bin