Skip to content

Commit 92a3ce2

Browse files
authored
k8stopo: Remove the deprecated Kubernetes topo (#13303)
Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
1 parent 7830175 commit 92a3ce2

69 files changed

Lines changed: 15 additions & 3767 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.golangci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
run:
2-
go: 1.19
2+
go: 1.20
33
timeout: 10m
4-
skip-dirs:
5-
- go/vt/topo/k8stopo/client
64

75
linters-settings:
86
errcheck:

Makefile

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -380,64 +380,6 @@ minimaltools:
380380
dependency_check:
381381
./tools/dependency_check.sh
382382

383-
install_k8s-code-generator: tools/tools.go go.mod
384-
go install k8s.io/code-generator/cmd/deepcopy-gen
385-
go install k8s.io/code-generator/cmd/client-gen
386-
go install k8s.io/code-generator/cmd/lister-gen
387-
go install k8s.io/code-generator/cmd/informer-gen
388-
389-
DEEPCOPY_GEN=$(VTROOTBIN)/deepcopy-gen
390-
CLIENT_GEN=$(VTROOTBIN)/client-gen
391-
LISTER_GEN=$(VTROOTBIN)/lister-gen
392-
INFORMER_GEN=$(VTROOTBIN)/informer-gen
393-
394-
GEN_BASE_DIR ?= vitess.io/vitess/go/vt/topo/k8stopo
395-
396-
client_go_gen: install_k8s-code-generator
397-
echo $$(date): Regenerating client-go code
398-
# Delete and re-generate the deepcopy types
399-
find $(VTROOT)/go/vt/topo/k8stopo/apis/topo/v1beta1 -name "zz_generated.deepcopy.go" -delete
400-
401-
# We output to ./ and then copy over the generated files to the appropriate path
402-
# This is done so we don't have rely on the repository being cloned to `$GOPATH/src/vitess.io/vitess`
403-
404-
$(DEEPCOPY_GEN) -o ./ \
405-
--input-dirs $(GEN_BASE_DIR)/apis/topo/v1beta1 \
406-
-O zz_generated.deepcopy \
407-
--bounding-dirs $(GEN_BASE_DIR)/apis \
408-
--go-header-file ./go/vt/topo/k8stopo/boilerplate.go.txt
409-
410-
# Delete existing code
411-
rm -rf go/vt/topo/k8stopo/client
412-
413-
# Generate clientset
414-
$(CLIENT_GEN) -o ./ \
415-
--clientset-name versioned \
416-
--input-base $(GEN_BASE_DIR)/apis \
417-
--input 'topo/v1beta1' \
418-
--output-package $(GEN_BASE_DIR)/client/clientset \
419-
--fake-clientset=true \
420-
--go-header-file ./go/vt/topo/k8stopo/boilerplate.go.txt
421-
422-
# Generate listers
423-
$(LISTER_GEN) -o ./ \
424-
--input-dirs $(GEN_BASE_DIR)/apis/topo/v1beta1 \
425-
--output-package $(GEN_BASE_DIR)/client/listers \
426-
--go-header-file ./go/vt/topo/k8stopo/boilerplate.go.txt
427-
428-
# Generate informers
429-
$(INFORMER_GEN) -o ./ \
430-
--input-dirs $(GEN_BASE_DIR)/apis/topo/v1beta1 \
431-
--output-package $(GEN_BASE_DIR)/client/informers \
432-
--versioned-clientset-package $(GEN_BASE_DIR)/client/clientset/versioned \
433-
--listers-package $(GEN_BASE_DIR)/client/listers \
434-
--go-header-file ./go/vt/topo/k8stopo/boilerplate.go.txt
435-
436-
# Move and cleanup
437-
mv vitess.io/vitess/go/vt/topo/k8stopo/client go/vt/topo/k8stopo/
438-
mv vitess.io/vitess/go/vt/topo/k8stopo/apis/topo/v1beta1/zz_generated.deepcopy.go go/vt/topo/k8stopo/apis/topo/v1beta1/zz_generated.deepcopy.go
439-
rm -rf vitess.io/vitess/go/vt/topo/k8stopo/
440-
441383
vtadmin_web_install:
442384
cd web/vtadmin && npm install
443385

bootstrap.sh

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -171,35 +171,6 @@ install_etcd() {
171171
ln -snf "$dist/etcd-${version}-${platform}-${target}/etcdctl" "$VTROOT/bin/etcdctl"
172172
}
173173

174-
175-
# Download and install k3s, link k3s binary into our root
176-
install_k3s() {
177-
local version="$1"
178-
local dist="$2"
179-
case $(uname) in
180-
Linux) local platform=linux;;
181-
*) echo "WARNING: unsupported platform. K3s only supports running on Linux, the k8s topology will not be available for local examples."; return;;
182-
esac
183-
184-
case $(get_arch) in
185-
aarch64) local target="-arm64";;
186-
x86_64) local target="";;
187-
arm64) local target="-arm64";;
188-
*) echo "WARNING: unsupported architecture, the k8s topology will not be available for local examples."; return;;
189-
esac
190-
191-
file="k3s${target}"
192-
193-
local dest="$dist/k3s${target}-${version}-${platform}"
194-
# This is how we'd download directly from source:
195-
# download_url=https://github.com/rancher/k3s/releases/download
196-
# wget -O $dest "$download_url/$version/$file"
197-
"${VTROOT}/tools/wget-retry" -O $dest "${VITESS_RESOURCES_DOWNLOAD_URL}/$file-$version"
198-
chmod +x $dest
199-
ln -snf $dest "$VTROOT/bin/k3s"
200-
}
201-
202-
203174
# Download and install consul, link consul binary into our root.
204175
install_consul() {
205176
local version="$1"
@@ -299,9 +270,6 @@ install_all() {
299270
# etcd
300271
install_dep "etcd" "v3.5.6" "$VTROOT/dist/etcd" install_etcd
301272

302-
# k3s
303-
command -v k3s || install_dep "k3s" "v1.0.0" "$VTROOT/dist/k3s" install_k3s
304-
305273
# consul
306274
if [ "$BUILD_CONSUL" == 1 ] ; then
307275
install_dep "Consul" "1.11.4" "$VTROOT/dist/consul" install_consul

changelog/18.0/18.0.0/summary.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- **[New command line flags and behavior](#new-flag)**
88
- [VTOrc flag `--allow-emergency-reparent`](#new-flag-toggle-ers)
99
- **[Deprecations and Deletions](#deprecations-and-deletions)**
10+
- [Deleted `k8stopo`](#deleted-k8stopo)
1011

1112

1213
## <a id="major-changes"/>Major Changes
@@ -22,3 +23,7 @@ The users that want VTOrc to fix the replication issues, but don't want it to ru
2223
By default, VTOrc will be able to run `EmergencyReparentShard`. The users must specify the flag to `false` to change the behaviour.
2324

2425
### <a id="deprecations-and-deletions"/>Deprecations and Deletions
26+
27+
#### <a id="deleted-k8stopo"/>Deleted `k8stopo`
28+
29+
The `k8stopo` has been deprecated in Vitess 17, also see https://github.com/vitessio/vitess/issues/13298. With Vitess 18 the `k8stopo` has been removed.

examples/backups/start_cluster.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ source ../common/env.sh
2222
# start topo server
2323
if [ "${TOPO}" = "zk2" ]; then
2424
CELL=zone1 ../common/scripts/zk-up.sh
25-
elif [ "${TOPO}" = "k8s" ]; then
26-
CELL=zone1 ../common/scripts/k3s-up.sh
2725
else
2826
CELL=zone1 ../common/scripts/etcd-up.sh
2927
fi

examples/common/env.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,6 @@ if [ "${TOPO}" = "zk2" ]; then
5656
TOPOLOGY_FLAGS="--topo_implementation zk2 --topo_global_server_address ${ZK_SERVER} --topo_global_root /vitess/global"
5757

5858
mkdir -p "${VTDATAROOT}/tmp"
59-
elif [ "${TOPO}" = "k8s" ]; then
60-
# Set topology environment parameters.
61-
K8S_ADDR="localhost"
62-
K8S_PORT="8443"
63-
K8S_KUBECONFIG=$VTDATAROOT/tmp/k8s.kubeconfig
64-
# shellcheck disable=SC2034
65-
TOPOLOGY_FLAGS="--topo_implementation k8s --topo_k8s_kubeconfig ${K8S_KUBECONFIG} --topo_global_server_address ${K8S_ADDR}:${K8S_PORT} --topo_global_root /vitess/global"
6659
elif [ "${TOPO}" = "consul" ]; then
6760
# Set up topology environment parameters.
6861
CONSUL_SERVER=127.0.0.1

examples/common/scripts/k3s-down.sh

Lines changed: 0 additions & 28 deletions
This file was deleted.

examples/common/scripts/k3s-up.sh

Lines changed: 0 additions & 57 deletions
This file was deleted.

examples/local/101_initial_cluster.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ SIDECAR_DB_NAME=${SIDECAR_DB_NAME:-"_vt"}
3131
# start topo server
3232
if [ "${TOPO}" = "zk2" ]; then
3333
CELL=zone1 ../common/scripts/zk-up.sh
34-
elif [ "${TOPO}" = "k8s" ]; then
35-
CELL=zone1 ../common/scripts/k3s-up.sh
3634
elif [ "${TOPO}" = "consul" ]; then
3735
CELL=zone1 ../common/scripts/consul-up.sh
3836
else

examples/local/401_teardown.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ done
4242

4343
if [ "${TOPO}" = "zk2" ]; then
4444
CELL=zone1 ../common/scripts/zk-down.sh
45-
elif [ "${TOPO}" = "k8s" ]; then
46-
CELL=zone1 ../common/scripts/k3s-down.sh
4745
elif [ "${TOPO}" = "consul" ]; then
4846
CELL=zone1 ../common/scripts/consul-down.sh
4947
else

0 commit comments

Comments
 (0)