Skip to content

Commit fe18cce

Browse files
authored
return to using the kubectl binary, not k0s (#382)
1 parent f5f74fb commit fe18cce

File tree

4 files changed

+12
-20
lines changed

4 files changed

+12
-20
lines changed

.github/workflows/dependencies.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ jobs:
2323
run: |
2424
export VERSION=`curl https://api.github.com/repos/openebs/charts/releases/latest | jq -r .name | tr -d openebs-`
2525
sed -i "/^OPENEBS_CHART_VERSION/c\OPENEBS_CHART_VERSION = $VERSION" Makefile
26+
- name: Kubectl
27+
run: |
28+
export VERSION=`curl -L -s https://dl.k8s.io/release/stable.txt`
29+
sed -i "/^KUBECTL_VERSION/c\KUBECTL_VERSION = $VERSION" Makefile
2630
- name: K0s
2731
run: |
2832
# Remove the '-ec.X' suffix and only update if the prefix (upstream k0s release) has changed.

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ EMBEDDED_OPERATOR_CHART_VERSION = 0.22.7
1313
OPENEBS_CHART_URL = https://openebs.github.io/charts
1414
OPENEBS_CHART_NAME = openebs/openebs
1515
OPENEBS_CHART_VERSION = 3.10.0
16+
KUBECTL_VERSION = v1.29.1
1617
K0S_VERSION = v1.29.1+k0s.1
1718
K0S_BINARY_SOURCE_OVERRIDE =
1819
TROUBLESHOOT_VERSION = v0.83.0
@@ -44,6 +45,12 @@ pkg/goods/bins/k0s: Makefile
4445
chmod +x pkg/goods/bins/k0s
4546
touch pkg/goods/bins/k0s
4647

48+
pkg/goods/bins/kubectl: Makefile
49+
mkdir -p pkg/goods/bins
50+
curl -L -o pkg/goods/bins/kubectl "https://dl.k8s.io/release/$(KUBECTL_VERSION)/bin/linux/amd64/kubectl"
51+
chmod +x pkg/goods/bins/kubectl
52+
touch pkg/goods/bins/kubectl
53+
4754
pkg/goods/bins/kubectl-support_bundle: Makefile
4855
mkdir -p pkg/goods/bins
4956
mkdir -p output/tmp/support-bundle
@@ -75,6 +82,7 @@ embedded-release: embedded-cluster-linux-amd64 output/tmp/release.tar.gz output/
7582
.PHONY: static
7683
static: pkg/goods/bins/k0s \
7784
pkg/goods/bins/kubectl-preflight \
85+
pkg/goods/bins/kubectl \
7886
pkg/goods/bins/kubectl-support_bundle
7987

8088
.PHONY: embedded-cluster-linux-amd64

cmd/embedded-cluster/install.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -257,15 +257,6 @@ func runOutro(c *cli.Context) error {
257257
return addons.NewApplier(opts...).Outro(c.Context)
258258
}
259259

260-
// linkK0s is a helper function that links the k0s binary to the embedded cluster bins dir as 'kubectl'.
261-
func linkK0s() error {
262-
if err := os.Symlink(defaults.K0sBinaryPath(), defaults.PathToEmbeddedClusterBinary("kubectl")); err != nil {
263-
return fmt.Errorf("unable to create symlink: %w", err)
264-
}
265-
266-
return nil
267-
}
268-
269260
// installCommands executes the "install" command. This will ensure that a k0s.yaml file exists
270261
// and then run `k0s install` to apply the cluster. Once this is finished then a "kubeconfig"
271262
// file is created. Resulting kubeconfig is stored in the configuration dir.
@@ -348,11 +339,6 @@ var installCommand = &cli.Command{
348339
metrics.ReportApplyFinished(c, err)
349340
return err
350341
}
351-
logrus.Debugf("linking k0s binary")
352-
if err := linkK0s(); err != nil {
353-
metrics.ReportApplyFinished(c, err)
354-
return err
355-
}
356342
metrics.ReportApplyFinished(c, nil)
357343
return nil
358344
},

cmd/embedded-cluster/join.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,6 @@ var joinCommand = &cli.Command{
182182
return err
183183
}
184184

185-
logrus.Debugf("linking k0s binary")
186-
if err := linkK0s(); err != nil {
187-
metrics.ReportJoinFailed(c.Context, jcmd.MetricsBaseURL, jcmd.ClusterID, err)
188-
return err
189-
}
190-
191185
metrics.ReportJoinSucceeded(c.Context, jcmd.MetricsBaseURL, jcmd.ClusterID)
192186
logrus.Infof("Join finished")
193187
return nil

0 commit comments

Comments
 (0)