Giter VIP home page Giter VIP logo

provider-kubernetes's Introduction

provider-kubernetes

provider-kubernetes is a Crossplane Provider that enables deployment and management of arbitrary Kubernetes objects on clusters typically provisioned by Crossplane:

  • A Provider resource type that only points to a credentials Secret.
  • An Object resource type that is to manage Kubernetes Objects.
  • A managed resource controller that reconciles Object typed resources and manages arbitrary Kubernetes Objects.

Install

If you would like to install provider-kubernetes without modifications, you may do so using the Crossplane CLI in a Kubernetes cluster where Crossplane is installed:

kubectl crossplane install provider crossplanecontrib/provider-kubernetes:main

You may also manually install provider-kubernetes by creating a Provider directly:

apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
  name: provider-kubernetes
spec:
  package: "crossplanecontrib/provider-kubernetes:main"

Developing locally

See the header of go.mod for the minimum supported version of Go.

Start a local development environment with Kind where crossplane is installed:

make
make local-dev

Now you can either run the controller locally or in-cluster.

Running locally

Run controller locally against the cluster:

make run

Since the controller is running outside the Kind cluster, you need to make the API server accessible to the controller. You can do this by running a proxy:

# on a separate terminal
sudo kubectl proxy --port=8081

See below for how to properly setup the RBAC for the locally running controller.

Running in-cluster

Run controller in-cluster:

make local-deploy

See below for how to properly setup the RBAC for the locally running controller.

Required configuration

  1. Prepare provider config for the local cluster:

  2. If provider kubernetes running in the cluster (e.g. provider installed with crossplane or using make local-deploy):

    SA=$(kubectl -n crossplane-system get sa -o name | grep provider-kubernetes | sed -e 's|serviceaccount\/|crossplane-system:|g')
    kubectl create clusterrolebinding provider-kubernetes-admin-binding --clusterrole cluster-admin --serviceaccount="${SA}"
    kubectl apply -f examples/provider/config-in-cluster.yaml
    
  3. If provider kubernetes running outside the cluster (e.g. running locally with make run)

    KUBECONFIG=$(kind get kubeconfig --name local-dev | sed -e 's|server:\s*.*$|server: http://localhost:8081|g')
    kubectl -n crossplane-system create secret generic cluster-config --from-literal=kubeconfig="${KUBECONFIG}"
    kubectl apply -f examples/provider/config.yaml
    
  4. Now you can create Object resources with provider reference, see sample object.yaml.

    kubectl create -f examples/object/object.yaml
    

Cleanup

To delete the local kind cluster:

make controlplane.down

provider-kubernetes's People

Contributors

turkenh avatar lsviben avatar morningspace avatar bobh66 avatar phisco avatar haarchri avatar dorroddorrod avatar dependabot[bot] avatar ravilr avatar hasheddan avatar negz avatar st3v avatar pedjak avatar jastang avatar gmrodgers avatar branden avatar eplightning avatar chlunde avatar fahedouch avatar gyliu513 avatar j2l4e avatar recht avatar jonathano avatar maximilianbraun avatar tnthornton avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.