Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Introduce ClusterResourceSet experimental API and controllers #3107

Merged

Conversation

sedefsavas
Copy link

What this PR does / why we need it:
This PR implements ClusterResourceSet CAEP

Some details about resources to be applied with ClusterResources:

  • A resource can be Secret or Configmap with json or yaml format.
  • Secret type=clusterresourceset must be set to the secrets to be used.
  • A secret/configmap can have multiple key-value pairs and each pair might have multiple kubernetes objects.

An example ClusterResourceSet:

apiVersion: clusterresourceset.cluster.x-k8s.io/v1alpha3
kind: ClusterResourceSet
metadata:
  name: clusterResourceSet1
spec:
  clusterSelector:
    matchLabels:
      label: myclustergroup
  resources:
    - name: secret1
      kind: Secret
    - name: cm1
      kind: ConfigMap

An example ClusterResourceBinding:

apiVersion: clusterresourceset.cluster.x-k8s.io/v1alpha3
clusterresourcesetmap:
 clusterResourceSet1:
    resources:
      Secret/secret1:
        hash: _IcfqGpJWlhS5Az06XX4A6BXcTA=
        lastAppliedTime: "2020-05-28T08:51:06Z"
        successful: true
  clusterResourceSet1:
    resources:
      Configmap/cm1:
        hash: _IcfqGpJWlhS5Az06XX4A6BXcTA=
        lastAppliedTime: "2020-05-28T08:51:06Z"
        successful: false
metadata:
  creationTimestamp: "2020-05-28T08:51:05Z"
  generation: 2
  name: 1test
  namespace: default
  ownerReferences:
  - apiVersion: cluster.x-k8s.io/v1alpha3
    kind: Cluster
    name: 1test
    uid: 60b32443-f7d7-463e-8e71-e3ed69480296

kind: ClusterResourceSetBinding

unit and e2e test to be added after initial review.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 28, 2020
@k8s-ci-robot k8s-ci-robot requested review from detiber and justinsb May 28, 2020 16:38
@sedefsavas sedefsavas force-pushed the clusterresourceset_ branch from d7929e5 to b21ddd8 Compare May 28, 2020 16:45
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 28, 2020
@sedefsavas sedefsavas force-pushed the clusterresourceset_ branch from b21ddd8 to 5d885eb Compare May 28, 2020 16:50
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 28, 2020
@sedefsavas sedefsavas force-pushed the clusterresourceset_ branch from 5d885eb to 562bc57 Compare May 28, 2020 16:53
@vincepri
Copy link
Member

What if we had this under addons.cluster.x-k8s.io API group?

cc @detiber

@sedefsavas sedefsavas force-pushed the clusterresourceset_ branch 2 times, most recently from 5d2a17c to ae45ada Compare May 28, 2020 17:29
Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sedefsavas thanks for this PR!

exp/clusterresourceset/hack/boilerplate.go.txt Outdated Show resolved Hide resolved
util/secret/secret.go Outdated Show resolved Hide resolved
feature/feature.go Outdated Show resolved Hide resolved
exp/clusterresourceset/controllers/suite_test.go Outdated Show resolved Hide resolved
exp/clusterresourceset/controllers/suite_test.go Outdated Show resolved Hide resolved
main.go Show resolved Hide resolved
@sedefsavas sedefsavas force-pushed the clusterresourceset_ branch 2 times, most recently from 5ebbf66 to 1564d8a Compare May 29, 2020 16:44
@vincepri
Copy link
Member

/assign

Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only reviewed ~40% of it, will continue later

exp/addons/PROJECT Outdated Show resolved Hide resolved
exp/addons/api/v1alpha3/clusterresourceset_types.go Outdated Show resolved Hide resolved
exp/addons/api/v1alpha3/clusterresourceset_types.go Outdated Show resolved Hide resolved
exp/addons/api/v1alpha3/clusterresourceset_types.go Outdated Show resolved Hide resolved
exp/addons/api/v1alpha3/clusterresourceset_webhook.go Outdated Show resolved Hide resolved
exp/addons/api/v1alpha3/clusterresourceset_types.go Outdated Show resolved Hide resolved
exp/addons/api/v1alpha3/clusterresourcesetbinding_types.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 4, 2020
@sedefsavas sedefsavas force-pushed the clusterresourceset_ branch from 1190438 to 2005143 Compare June 4, 2020 03:12
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 4, 2020
@sedefsavas sedefsavas force-pushed the clusterresourceset_ branch 2 times, most recently from 5bb2bf2 to 102f62f Compare June 4, 2020 04:01
@sedefsavas sedefsavas force-pushed the clusterresourceset_ branch from 5eed0e3 to 57c4443 Compare July 1, 2020 15:45
exp/addons/controllers/clusterresourceset_controller.go Outdated Show resolved Hide resolved
exp/addons/controllers/clusterresourceset_helpers.go Outdated Show resolved Hide resolved
exp/addons/controllers/clusterresourceset_controller.go Outdated Show resolved Hide resolved
exp/addons/controllers/clusterresourceset_controller.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
main.go Show resolved Hide resolved
test/e2e/data/infrastructure-docker/cluster-template.yaml Outdated Show resolved Hide resolved
test/e2e/experimental_features.go Outdated Show resolved Hide resolved
test/framework/clusterresourceset_helpers.go Outdated Show resolved Hide resolved
@sedefsavas sedefsavas force-pushed the clusterresourceset_ branch 2 times, most recently from f4c4b26 to 68c596f Compare July 6, 2020 16:03
@sedefsavas sedefsavas force-pushed the clusterresourceset_ branch 3 times, most recently from 4f5c9f5 to 7b45d38 Compare July 6, 2020 17:58
@vincepri
Copy link
Member

vincepri commented Jul 7, 2020

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 7, 2020
@sedefsavas sedefsavas force-pushed the clusterresourceset_ branch 2 times, most recently from 46b5e01 to 2259d6e Compare July 7, 2020 17:04
@sedefsavas sedefsavas force-pushed the clusterresourceset_ branch from 2259d6e to 3487602 Compare July 7, 2020 17:54
@sedefsavas sedefsavas force-pushed the clusterresourceset_ branch from 3487602 to add44ad Compare July 7, 2020 18:36
@ncdc
Copy link
Contributor

ncdc commented Jul 7, 2020

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ncdc

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 7, 2020
Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 7, 2020
@vincepri
Copy link
Member

vincepri commented Jul 7, 2020

/retitle ✨ Introduce ClusterResourceSet experimental API and controllers

@k8s-ci-robot k8s-ci-robot changed the title ClusterResourceSet feature ✨ Introduce ClusterResourceSet experimental API and controllers Jul 7, 2020
@k8s-ci-robot k8s-ci-robot merged commit c6e7711 into kubernetes-sigs:master Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants