Giter Site home page Giter Site logo

addon-framework's Introduction

Addon Framework

This is to define an addon framework library.

Still in PoC phase.

Community, discussion, contribution, and support

Check the CONTRIBUTING Doc for how to contribute to the repo.


Getting Started

Prerequisites

These instructions assume:

  • You have at least one running kubernetes cluster;
  • You have already followed instructions from registration-operator and installed OCM successfully;
  • A managed cluster with name cluster1 has been imported and accepted;

Deploy the helloworld addon

Set environment variables.

export KUBECONFIG=</path/to/hub_cluster/kubeconfig>

Build the docker image to run the sample addon.

make images
export EXAMPLE_IMAGE_NAME=<helloworld_addon_image_name> # export EXAMPLE_IMAGE_NAME=quay.io/open-cluster-management/helloworld-addon:latest

If your are using kind, load image into kind cluster.

kind load docker-image <helloworld_addon_image_name> # kind load docker-image quay.io/open-cluster-management/helloworld-addon:latest

And then deploy helloworld addon contoller on hub cluster

make deploy-example

Create a addon-cr.yaml as shown in this example:

apiVersion: addon.open-cluster-management.io/v1alpha1
kind: ManagedClusterAddOn
metadata:
  name: helloworld
  namespace: cluster1
spec:
  installNamespace: default

Apply the yaml file to the hub cluster.

kubectl apply -f addon-cr.yaml

What is next

After a successful deployment, check on the managed cluster cluster1 and see the helloworld addon agent has been deployed from the hub cluster.

kubectl --kubeconfig </path/to/managed_cluster/kubeconfig> -n default get pods
NAME                               READY   STATUS    RESTARTS   AGE
helloworld-agent-b99d47f76-v2j6h   1/1     Running   0          53s

Clean up

Remove the addon CR from hub cluster. It will undeploy the helloworld addon agent from the managed cluster cluster1 as well.

kubectl delete --ignore-not-found -f addon-cr.yaml

Undeploy helloworld addon contoller from hub cluster.

make undeploy-example

Follow instructions from registration-operator to uninstall OCM if necessary;

addon-framework's People

Contributors

elgnay avatar hanqiuzh avatar leena-jawale avatar openshift-ci[bot] avatar openshift-merge-robot avatar porridge avatar qiujian16 avatar skeeey avatar xuezhaojun avatar zhujian7 avatar

Stargazers

 avatar

Watchers

 avatar  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.