provider-kubernetes icon indicating copy to clipboard operation
provider-kubernetes copied to clipboard

Support compose cloud resources with traditional K8s resources in crossplane level to deploy it in business k8s cluster

Open bretagne-peiqi opened this issue 3 years ago • 6 comments

What problem are you facing?

We are currently using crossplane as our control plane deployed in a control k8s cluster. we also deployed aws-provider, provider-kubernetes. we intend to deploy application configuration composed cloud resources created by aws-provider in bussiness k8s cluster which is piloted by provider-kubernetes.

we hope to compose our application k8s resources and aws resources. Say a redis created by aws-provider from control k8s cluster, we hope to use it directly in our "object" or "composition" resource for provider-kuberntes.

How could Crossplane help solve your problem?

Does provider-kubernetes currently support such feature ? I think it would be cool if we could manage business k8s cluster and cloud resources from the same control plane, and compose those cloud resources like mysql redis to applicatioin in business k8s cluster .

bretagne-peiqi avatar Feb 21 '22 06:02 bretagne-peiqi

@bretagne-peiqi Do you have concrete example to explain your requested enhancement? I didn't understand why it does not support by k8s provider.

morningspace avatar Feb 21 '22 06:02 morningspace

hello, thanks for your reply.

I am going to use oam to deploy and manage our application. as belows.

apiVersion: core.oam.dev/v1alpha2 kind: ApplicationConfiguration metadata: name: online-catalog spec: components: - componentName: cartservice-redis-component parameterValues: - name: secretName value: online-catalog-redis-secret - name: secretNamespace value: default - name: provider value: gcp - componentName: cartservice-component parameterValues:

  • name: secretName value: online-catalog-redis-secret traits: - trait: apiVersion: core.oam.dev/v1alpha2 kind: ManualScalerTrait metadata: name: cartservice-component spec: replicaCount: 2

--- apiVersion: core.oam.dev/v1alpha2 kind: Component metadata: name: cartservice-redis-component spec: workload: apiVersion: infrastructure.digital.com/v1alpha1 kind: RedisInstanceRequirement metadata: name: cartservice-redis-req spec: parameters: tier: STANDARD_HA storage: 1 compositionSelector: matchLabels: experiment: murillodigital parameters: - name: secretName required: true fieldPaths: - spec.writeConnectionSecretToRef.name - name: secretNamespace required: true fieldPaths: - spec.writeConnectionSecretToRef.namespace - name: provider required: true fieldPaths: - spec.compositionSelector.matchLabels.provider --- apiVersion: core.oam.dev/v1alpha2 kind: Component metadata: name: cartservice-component spec: workload: apiVersion: core.oam.dev/v1alpha2 kind: ContainerizedWorkload metadata: name: cartservice-workload spec: containers:

  • name: server image: sjodevops/cartservice:v0.1.4-33-g0d635b9 ports: - containerPort: 7070 name: cartsvcgrpc env: - name: REDIS_ENDPOINT fromSecret: key: endpoint - name: REDIS_PORT fromSecret: key: port - name: REDIS_ADDR value: "$(REDIS_ENDPOINT):$(REDIS_PORT)" - name: PORT value: "7070" - name: LISTEN_ADDR value: "0.0.0.0" readinessProbe: initialDelaySeconds: 15 exec: command: ["/bin/grpc_health_probe", "-addr=:7070", "-rpc-timeout=5s"] livenessProbe: initialDelaySeconds: 15 periodSeconds: 10 exec: command: [ "/bin/grpc_health_probe", "-addr=:7070", "-rpc-timeout=5s"] parameters: - name: secretName required: true fieldPaths: - spec.containers[0].env[0].fromSecret.name
  • spec.containers[0].env[1].fromSecret.name

I think we can create redis cloud resources using cloud providers like aws-provider. and make it component for my App. but how can I define component to manage remote k8s resources for k8s provider ? I hope using a workloads type instead of object. because object is only an encapsulation of k8s native api ?

On Mon, 21 Feb 2022 at 14:57, MorningSpace @.***> wrote:

@bretagne-peiqi https://github.com/bretagne-peiqi Do you have concrete example to explain your requested enhancement? I didn't understand why it does not support by k8s provider.

— Reply to this email directly, view it on GitHub https://github.com/crossplane-contrib/provider-kubernetes/issues/30#issuecomment-1046530655, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABK4QIU62VSXQA2CKDBKIT3U4HO5ZANCNFSM5O5VMCSQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

bretagne-peiqi avatar Feb 21 '22 09:02 bretagne-peiqi

@bretagne-peiqi Maybe you can format the YAML snippets so that can be much easier to understand :-)

morningspace avatar Feb 22 '22 09:02 morningspace

I think this is also what I'm asking for at the bottom of https://github.com/crossplane-contrib/provider-kubernetes/issues/41 where the kubernetes provider only allows you to Observe Objects in the cluster in which Crossplane is deployed. It would be nice if we could also Observe objects in other clusters

ChrisJBurns avatar May 29 '22 16:05 ChrisJBurns

@ChrisJBurns you can use a local Object to "observe" the resource in remote cluster.

morningspace avatar May 30 '22 12:05 morningspace

@morningspace Can confirm, I have got it working. Shall post proper reply on other ticket!

ChrisJBurns avatar May 30 '22 18:05 ChrisJBurns