rancher-bind

module
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2023 License: Apache-2.0

README

rancher-bind

What is it?

This repository hosts the backend implementation for the kube-bind project for rancher.

This allows external clusters to consume rancher native services without a need for installation.

  • The exposed rancher CRDs gets installed in the consumer cluster, objects are syncronized with the provider side.
  • Permissions for the consumer cluster access are added gradually based on the APIServiceBinding spec.
  • The service provider does not inject controllers/operators into the service consumer's cluster.

Functionality, such as fine-grained kubeconfig for rancher cluster is exposed via plugin commands.

Prerequisites

Try it out

Fine-grained kubeconfig for Rancher cluster
# export KUBECONFIG=/tmp/rancher-kubeconfig
kubectl krew index add rancher-bind https://github.com/Danil-Grigorev/rancher-bind.git
kubectl krew install rancher-bind/rancher-bind
kubectl rancher-bind -f ./example-role.yaml -d > kubeconfig
cat kubeconfig
# Outputs:
# apiVersion: v1
# kind: Config
# clusters:
# - name: "local"
# ...

# export KUBECONFIG=/tmp/consumer-kubeconfig
# Populate an api.yaml file with the CRD resource/group to export
# Example:
# cat api.yaml
# kind: APIServiceExportRequest
# apiVersion: kube-bind.io/v1alpha1
# metadata:
#   name: export-clusters
# spec:
#   resources:
#     - group: "provisioning.cattle.io"
#       resource: "clusters"

kubectl krew index add bind https://github.com/kube-bind/krew-index.git
kubectl krew install bind/bind
kubectl bind apiservice --remote-kubeconfig ./kubeconfig --remote-namespace default -f api.yaml

Apply the desired CR resource in a consumer cluster and watch the status changes!

Directories

Path Synopsis
cmd
deploy
hack
internal
pkg
apis/rancher
Package rancher contains the rancher management.cattle.io/v3 API proxy implementations.
Package rancher contains the rancher management.cattle.io/v3 API proxy implementations.
apis/rancher/management/v3
Package rancher contains the rancher management.cattle.io/v3 API proxy implementations.
Package rancher contains the rancher management.cattle.io/v3 API proxy implementations.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL