Giter Site home page Giter Site logo

hzliangbin / multicloud-operators-subscription Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stolostron/multicloud-operators-subscription

0.0 1.0 0.0 3.26 MB

CRD and controller for Subscription (Channel Subscription model) for Multicloud Application.

License: Apache License 2.0

Makefile 5.84% Dockerfile 0.23% Shell 6.03% Go 86.06% Ruby 0.03% Python 1.24% Awk 0.19% Mustache 0.38%

multicloud-operators-subscription's Introduction

multicloud-operators-subscription

Build GoDoc Go Report Card Sonarcloud Status License


Table of Contents generated with DocToc

Overview


Subscribes resources from channels and applies them to Kubernetes

Quick start


Subscribe a Helm chart

mkdir -p "$GOPATH"/src/github.com/open-cluster-management
cd "$GOPATH"/src/github.com/open-cluster-management
git clone https://github.com/open-cluster-management/multicloud-operators-subscription.git
cd "$GOPATH"/src/github.com/open-cluster-management/multicloud-operators-subscription
  • Set up the environment, and deploy the subscription operator.
kubectl apply -f ./deploy/standalone
  • Create a Channel and a Subscription.
kubectl apply -f ./examples/helmrepo-channel
  • Subscribe!
kubectl patch subscriptions.apps.open-cluster-management.io simple --type='json' -p='[{"op": "replace", "path": "/spec/placement/local", "value": true}]'

Find the nginx pods that are deployed to the current namespace. You should have 3 backend pods with the controller.

% kubectl get pods -l app=nginx-ingress
NAME                                             READY   STATUS    RESTARTS   AGE
nginx-ingress-controller-857f44797-7fx7c         1/1     Running   0          96s
nginx-ingress-default-backend-6b8dc9d88f-97pxz   1/1     Running   0          96s
nginx-ingress-default-backend-6b8dc9d88f-drt7c   1/1     Running   0          96s
nginx-ingress-default-backend-6b8dc9d88f-n26ls   1/1     Running   0          96s

Check the Getting started doc for more details.

Troubleshooting

  • Check operator availability
% kubectl get deploy,pods
NAME                                                READY     UP-TO-DATE   AVAILABLE   AGE
deployment.apps/multicloud-operators-subscription   1/1       1            1           99m

NAME                                                     READY     STATUS    RESTARTS   AGE
pod/multicloud-operators-subscription-557c676479-dh2fg   1/1       Running   0          24s
  • Check the Subscription and its status.
% kubectl describe appsub simple
Name:         simple
Namespace:    default
Labels:       <none>
Annotations:  kubectl.kubernetes.io/last-applied-configuration:
                {"apiVersion":"apps.open-cluster-management.io/v1","kind":"Subscription","metadata":{"annotations":{},"name":"simple","namespace":"default"},"spec":{"ch...
API Version:  apps.open-cluster-management.io/v1
Kind:         Subscription
Metadata:
  Creation Timestamp:  2019-11-21T04:01:47Z
  Generation:          2
  Resource Version:    24045
  Self Link:           /apis/apps/v1/namespaces/default/subscriptions/simple
  UID:                 a35b6ef5-0c13-11ea-b4e7-00000a100ef8
Spec:
  Channel:  dev/dev-helmrepo
  Name:     nginx-ingress
  Package Overrides:
    Package Alias:  nginx-ingress-alias
    Package Name:  nginx-ingress
    Package Overrides:
      Path:   spec
      Value:  defaultBackend:
  replicaCount: 3

  Placement:
    Local:  true
Status:
  Last Update Time:  2019-11-21T04:02:38Z
  Phase:             Subscribed
  Statuses:
    /:
      Packages:
        dev-helmrepo-nginx-ingress-1.25.0:
          Last Update Time:  2019-11-21T04:02:38Z
          Phase:             Subscribed
          Resource Status:
            Last Update:  2019-11-21T04:02:24Z
            Phase:        Success
Events:                   <none>

Multicluster application subscription deployment

kubectl config use-context _hub_cluster_context_ # replace _hub_cluster_context_ with the hub cluster context name
git clone https://github.com/open-cluster-management/multicloud-operators-subscription
cd multicloud-operators-subscription
TRAVIS_BUILD=0
make deploy-community-hub # make deploy-community-hub GO_REQUIRED_MIN_VERSION:= # if you see warning about min version
  • Deploy the subscription agent on the managed cluster.
kubectl config use-context _managed_cluster_context_ # replace _managed_cluster_context_ with the managed cluster context name
export HUB_KUBECONFIG=_path_to_hub_kubeconfig_ # replace _path_to_hub_kubeconfig_ with the full path to the hub cluster kubeconfig
export MANAGED_CLUSTER_NAME=cluster1
make deploy-community-managed # make deploy-community-managed GO_REQUIRED_MIN_VERSION:= # if you see warning about min version
  • Deploy an application subscription on the hub cluster and it will propagate down to the managed cluster
$ kubectl config use-context _hub_cluster_context_ # replace _hub_cluster_context_ with the hub cluster context name
$ kubectl apply -f examples/helmrepo-hub-channel
$ kubectl config use-context _managed_cluster_context_ # replace _managed_cluster_context_ with the managed cluster context name
$ sleep 60
$ kubectl get subscriptions.apps 
NAME        STATUS       AGE   LOCAL PLACEMENT   TIME WINDOW
nginx-sub   Subscribed   77s   true       
$ kubectl get pod
NAME                                                   READY   STATUS    RESTARTS   AGE
nginx-ingress-65f8e-controller-76fdf7f8bb-srfjp        1/1     Running   0          84s
nginx-ingress-65f8e-default-backend-865d66965c-ckq66   1/1     Running   0          84s

Community, discussion, contribution, and support

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


Getting started

Prerequisites

Check the Development Doc for information about how to contribute to the repository.

Security response

Check the Security Doc if you find a security issue.

References

Multicloud-operators repositories

multicloud-operators-subscription's People

Contributors

rokej avatar mikeshng avatar xiangjingli avatar kuanf avatar ianzhang366 avatar philipwu08 avatar openshift-merge-robot avatar mprahl avatar gyliu513 avatar jnpacker avatar cadawson avatar dhaiducek avatar kant avatar rwellon avatar stevemar avatar dberg1 avatar hassenius avatar

Watchers

James Cloos 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.