Skip to content

Commit fff9339

Browse files
authored
Merge pull request #3485 from ntnn/tilt-expose-etcd
Expose etcd in tilt
2 parents 74cdaf1 + a447a61 commit fff9339

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

contrib/tilt/Tiltfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,20 @@ k8s_resource(
310310
],
311311
)
312312

313+
k8s_resource(
314+
workload='alpha-etcd',
315+
port_forwards=[
316+
port_forward(name="kcp-alpha-etcd", local_port=30100, container_port=2379),
317+
],
318+
)
319+
320+
k8s_resource(
321+
workload='beta-etcd',
322+
port_forwards=[
323+
port_forward(name="kcp-beta-etcd", local_port=30101, container_port=2379),
324+
],
325+
)
326+
313327
k8s_resource(
314328
workload='proxy-front-proxy',
315329
port_forwards=[

contrib/tilt/extract-etcd-certs.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2025 The KCP Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
18+
# Add alpha-etcd and beta-etcd in /etc/hosts, then:
19+
#
20+
# etcdctl \
21+
# --endpoints alpha-etcd:30100 \
22+
# --cacert ./contrib/tilt/etcd-ca.crt \
23+
# --cert ./contrib/tilt/etcd-alpha-client.crt \
24+
# --key ./contrib/tilt/etcd-alpha-client.key \
25+
# endpoint health
26+
27+
cd "$(dirname "$0")"
28+
29+
kubectl --context kind-kcp -n kcp-certs get secret certs-etcd-peer-ca -o jsonpath='{.data.ca\.crt}' \
30+
| base64 -d > etcd-ca.crt
31+
32+
for name in alpha beta; do
33+
kubectl --context kind-kcp -n kcp-certs get secret "$name-etcd-client-cert" -o jsonpath='{.data.tls\.crt}' \
34+
| base64 -d > "etcd-$name-client.crt"
35+
kubectl --context kind-kcp -n kcp-certs get secret "$name-etcd-client-cert" -o jsonpath='{.data.tls\.key}' \
36+
| base64 -d > "etcd-$name-client.key"
37+
done

0 commit comments

Comments
 (0)