Giter Club home page Giter Club logo

work-api's Introduction

Work API

This repo will hold design documents and implementation of the Work API.

Community, discussion, contribution, and support

Learn how to engage with the Kubernetes community on the community page.

You can reach the maintainers of this project at:

Quick Start

This guide will cover:

  • Create a kind cluster that acts as the hub work delivery control plane.
  • Create a kind cluster that acts as the spoke cluster for the work to be delivery to.
  • Install the work CRD to the hub cluster.
  • Install the work agent components to the spoke cluster.
  • Deploy a work example on the hub cluster.
  • Verify all the contents inside the work has been delivered in the spoke cluster.

Prerequisites

Create and setup the Hub cluster

Open a new terminal window and run the following commands:

cd /tmp
git clone [email protected]:kubernetes-sigs/work-api.git
kind delete cluster --name hub 
kind create cluster --name hub
kind get kubeconfig --name hub  > /tmp/hub-io-kubeconfig
export KUBECONFIG=/tmp/hub-io-kubeconfig
cd /tmp/work-api
kubectl apply -f config/crd
cp /tmp/hub-io-kubeconfig hub-kubeconfig
kubectl config set clusters.kind-hub.server https://hub-control-plane:6443 --kubeconfig hub-kubeconfig

Create and setup the Spoke cluster

Open another new terminal window and run the following commands:

kind delete cluster --name cluster1
kind create cluster --name cluster1
kind get kubeconfig --name cluster1 > /tmp/cluster1-io-kubeconfig
export KUBECONFIG=/tmp/cluster1-io-kubeconfig
cd /tmp/work-api
make docker-build
kind load docker-image --name=cluster1 work-api-controller:latest
kubectl apply -f deploy/component_namespace.yaml 
kubectl delete secret hub-kubeconfig-secret -n work --ignore-not-found
kubectl create secret generic hub-kubeconfig-secret --from-file=kubeconfig=hub-kubeconfig -n work 
rm hub-kubeconfig
kubectl apply -k deploy

Deploy a Work on the Hub cluster

On the Hub cluster terminal, run the following command:

kubectl apply -f examples/example-work.yaml

Verify delivery on the Spoke cluster

On the Spoke cluster terminal, run the following commands:

$ kubectl -n default get deploy test-nginx
NAME         READY   UP-TO-DATE   AVAILABLE   AGE
test-nginx   2/2     2            2           32s
$ kubectl -n default get service test-nginx
NAME         TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)   AGE
test-nginx   ClusterIP   10.96.96.136   <none>        80/TCP    46s

Code of conduct

Participation in the Kubernetes community is governed by the Kubernetes Code of Conduct.

work-api's People

Contributors

k8s-ci-robot avatar mikeshng avatar nikhita avatar qiujian16 avatar rainbowmango avatar shrinandj avatar

Watchers

 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.