Defines the shared interfaces which Karmada cloud providers implement. These interfaces allow various controllers to integrate with any cloud provider in a pluggable fashion.
Go to file
karmada-bot 69ba4b7029
Merge pull request #24 from XiShanYongYe-Chang/upgrade-karmada-dependency
upgrade the log level for resource creation
2025-03-11 14:38:31 +08:00
.github update karmada dependency to v1.10 2024-08-06 11:51:32 +08:00
app update ubuntu and go version to make the ci pass 2024-02-28 14:55:49 +08:00
artifacts/deploy upgrade karmada dependency to v1.12.0 2024-12-07 19:40:28 +08:00
cluster/images add mutlcuster cloud provider 2023-05-22 20:39:39 +08:00
cmd/controller-manager upgrade go version and karmada version in go.mod 2024-03-07 19:20:22 +08:00
fake upgrade ubuntu and go version to make the ci pass 2024-02-28 00:27:26 +08:00
hack upgrade karmada dependency to v1.12.0 2024-12-07 19:40:28 +08:00
options add mutlcuster cloud provider 2023-05-22 20:39:39 +08:00
pkg upgrade the log level for resource creation 2025-03-11 14:14:57 +08:00
.gitignore add mutlcuster cloud provider 2023-05-22 20:39:39 +08:00
.golangci.yml add mutlcuster cloud provider 2023-05-22 20:39:39 +08:00
CODE_OF_CONDUCT.md Add Karmada code of conduct 2025-03-10 15:49:09 +08:00
LICENSE Initial commit 2023-05-19 00:32:15 +08:00
Makefile add mutlcuster cloud provider 2023-05-22 20:39:39 +08:00
OWNERS Add owner files 2023-07-15 11:59:55 +08:00
README.md update readme with introduction 2023-05-27 09:38:34 +08:00
cloud.go add mcs shared interface and controller 2023-07-04 09:18:25 +08:00
go.mod upgrade karmada dependency to v1.13 2025-03-11 11:04:26 +08:00
go.sum upgrade karmada dependency to v1.13 2025-03-11 11:04:26 +08:00
plugins.go add mutlcuster cloud provider 2023-05-22 20:39:39 +08:00

README.md

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