bazelbuild / rules_k8s

This repository contains rules for interacting with Kubernetes configurations / clusters.
Apache License 2.0
291 stars 136 forks source link

kubectl toolchain not found on arm64 linux #641

Closed fengye87 closed 3 years ago

fengye87 commented 3 years ago

I have a very simple repo which can be built using bazel on Linux + AMD64 platform. However, when I tried to build and deploy it on Linux + ARM64, I got a no matching toolchains found for types @io_bazel_rules_k8s//toolchains/kubectl:toolchain_type error. Here's some detailed output:

[fengye87@fengye87-dev-arm bazel-go-sample]$ bazel run --toolchain_resolution_debug //deploy:deploy.apply
INFO: Build option --platforms has changed, discarding analysis cache.
INFO: ToolchainResolution: Target platform @local_config_platform//:host: Selected execution platform @local_config_platform//:host,
INFO: ToolchainResolution:     Type @io_bazel_rules_k8s//toolchains/kubectl:toolchain_type: target @local_config_platform//:host: Rejected toolchain @k8s_config//:toolchain; mismatching values: x86_64
INFO: ToolchainResolution:     Type @io_bazel_rules_k8s//toolchains/kubectl:toolchain_type: target @local_config_platform//:host: Rejected toolchain @k8s_config//:toolchain; mismatching values: osx, x86_64
INFO: ToolchainResolution:     Type @io_bazel_rules_k8s//toolchains/kubectl:toolchain_type: target @local_config_platform//:host: Rejected toolchain @k8s_config//:toolchain; mismatching values: windows, x86_64
INFO: ToolchainResolution:   Type @io_bazel_rules_k8s//toolchains/kubectl:toolchain_type: target platform @local_config_platform//:host: No toolchains found.
ERROR: While resolving toolchains for target //deploy:crd-greeter.apply: no matching toolchains found for types @io_bazel_rules_k8s//toolchains/kubectl:toolchain_type
ERROR: Analysis of target '//deploy:deploy.apply' failed; build aborted: no matching toolchains found for types @io_bazel_rules_k8s//toolchains/kubectl:toolchain_type
INFO: Elapsed time: 0.171s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 109 targets configured)
FAILED: Build did NOT complete successfully (0 packages loaded, 109 targets configured)

What changes should I make to make the build work? Appreciate your help!

Dev OS: CentOS 7 + ARM64 K8s node OS: CentOS 7 + ARM64 kubectl version: 1.20.4 kubectl location: /usr/local/bin/kubectl