Coder Social home page Coder Social logo

lonelycz / karmada-multicluster-cloud-provider Goto Github PK

View Code? Open in Web Editor NEW

This project forked from karmada-io/multicluster-cloud-provider

0.0 1.0 0.0 73 KB

Defines the shared interfaces which Karmada cloud providers implement. These interfaces allow various controllers to integrate with any cloud provider in a pluggable fashion.

License: Apache License 2.0

Shell 12.23% Go 86.14% Makefile 1.34% Dockerfile 0.29%

karmada-multicluster-cloud-provider's Introduction

multicluster-cloud-provider

This repository defines the shared interfaces which Karmada cloud providers implement. These interfaces allow various controllers to integrate with any cloud provider in a pluggable fashion.

Background

To enable Karmada to run on the public cloud platform and flexibly use and manage other basic resources and services on the cloud, cloud providers need to implement their own adapters. However, in the implementation process, some works are the same for each cloud provider.

Learn from the experience of Kubernetes Cloud Controller Manager (CCM): https://github.com/kubernetes/cloud-provider. Karmada can also provide a public repository that provides interfaces for using and managing basic resources and services on the public cloud. Cloud providers only need to implement these interfaces to provide users with their own adapters.

Purpose

This library is shared dependency for processes which need to be able to integrate with cloud provider specific functionality.

Fake testing

Command:

Make multicluster-provider-fake binary:

make multicluster-provider-fake

Make multicluster-provider-fake image:

make image-multicluster-provider-fake

Deploy multicluster-provider-fake deployment:

hack/deploy-provider.sh

Delete multicluster-provider-fake deployment :

kubectl --context karmada-host -n karmada-system delete deployments.apps multicluster-provider-fake

Verify

mci.yaml
apiVersion: networking.karmada.io/v1alpha1
kind: MultiClusterIngress
metadata:
  name: minimal-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - http:
      paths:
      - path: /testpath
        pathType: Prefix
        backend:
          service:
            name: serve
            port:
              number: 80
application.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: serve
spec:
  replicas: 1
  selector:
    matchLabels:
      app: serve
  template:
    metadata:
      labels:
        app: serve
    spec:
      containers:
      - name: serve
        image: jeremyot/serve:0a40de8
        args:
        - "--message='hello from cluster member1 (Node: {{env \"NODE_NAME\"}} Pod: {{env \"POD_NAME\"}} Address: {{addr}})'"
        env:
          - name: NODE_NAME
            valueFrom:
              fieldRef:
                fieldPath: spec.nodeName
          - name: POD_NAME
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
---
apiVersion: v1
kind: Service
metadata:
  name: serve
spec:
  ports:
  - port: 80
    targetPort: 8080
  selector:
    app: serve
---
apiVersion: policy.karmada.io/v1alpha1
kind: PropagationPolicy
metadata:
  name: mcs-workload
spec:
  resourceSelectors:
    - apiVersion: apps/v1
      kind: Deployment
      name: serve
    - apiVersion: v1
      kind: Service
      name: serve
  placement:
    clusterAffinity:
      clusterNames:
        - member1
        - member2
    replicaScheduling:
      replicaDivisionPreference: Weighted
      replicaSchedulingType: Divided
      weightPreference:
        staticWeightList:
          - targetCluster:
              clusterNames:
                - member1
            weight: 1
          - targetCluster:
              clusterNames:
                - member2
            weight: 1
kubectl apply -f mci.yaml
kubectl apply -f application.yaml

karmada-multicluster-cloud-provider's People

Contributors

karmada-bot avatar kevin-wangzefeng avatar xishanyongye-chang 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.