diff --git a/CHANGELOG.md b/CHANGELOG.md index c316b232e9..7b73e1eb85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ # Unreleased +- fix: Transition from apiextensions.k8s.io/v1beta1 to + apiextensions.k8s.io/v1. # v0.4.1 - [#1289](https://github.com/kubernetes-sigs/kubefed/pull/1289) chore: use cert-mananager.io/v1 group/version diff --git a/Makefile b/Makefile index 56ac1d11a9..95d74ec4c5 100644 --- a/Makefile +++ b/Makefile @@ -165,5 +165,5 @@ clean: controller-gen: command -v controller-gen &> /dev/null || (cd tools && go install sigs.k8s.io/controller-tools/cmd/controller-gen) -deploy.kind: +deploy.kind: generate KIND_LOAD_IMAGE=y FORCE_REDEPLOY=y ./scripts/deploy-kubefed.sh $(IMAGE_NAME) diff --git a/charts/kubefed/crds/crds.yaml b/charts/kubefed/crds/crds.yaml index 8794b335d6..1ceff9bf19 100644 --- a/charts/kubefed/crds/crds.yaml +++ b/charts/kubefed/crds/crds.yaml @@ -1,5 +1,5 @@ --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: federatedclusterroles.types.kubefed.io @@ -9,125 +9,125 @@ spec: kind: FederatedClusterRole plural: federatedclusterroles scope: Cluster - subresources: - status: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - overrides: - items: - properties: - clusterName: - type: string - clusterOverrides: - items: - properties: - op: - pattern: ^(add|remove|replace)?$ - type: string - path: - type: string - value: - anyOf: - - type: string - - type: integer - - type: boolean - - type: object - - type: array - required: - - path - type: object - type: array - type: object - type: array - placement: - properties: - clusterSelector: + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + overrides: + items: properties: - matchExpressions: + clusterName: + type: string + clusterOverrides: items: properties: - key: + op: + pattern: ^(add|remove|replace)?$ type: string - operator: + path: type: string - values: - items: - type: string - type: array + value: + x-kubernetes-preserve-unknown-fields: true required: - - key - - operator + - path type: object type: array - matchLabels: - additionalProperties: - type: string - type: object type: object - clusters: - items: + type: array + placement: + properties: + clusterSelector: properties: - name: - type: string - required: - - name + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object type: object - type: array - type: object - template: - type: object - type: object - status: - properties: - clusters: - items: - properties: - name: - type: string - status: - type: string - required: - - name + clusters: + items: + properties: + name: + type: string + required: + - name + type: object + type: array type: object - type: array - conditions: - items: - properties: - lastTransitionTime: - format: date-time - type: string - lastUpdateTime: - format: date-time - type: string - reason: - type: string - status: - type: string - type: - type: string - required: - - type - - status + template: type: object - type: array - observedGeneration: - format: int64 - type: integer - type: object - required: - - spec - version: v1beta1 + x-kubernetes-preserve-unknown-fields: true + type: object + status: + properties: + clusters: + items: + properties: + name: + type: string + status: + type: string + required: + - name + type: object + type: array + conditions: + items: + properties: + lastTransitionTime: + format: date-time + type: string + lastUpdateTime: + format: date-time + type: string + reason: + type: string + status: + type: string + type: + type: string + required: + - type + - status + type: object + type: array + observedGeneration: + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: federatedconfigmaps.types.kubefed.io @@ -139,125 +139,125 @@ spec: shortNames: - fcm scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - overrides: - items: - properties: - clusterName: - type: string - clusterOverrides: - items: - properties: - op: - pattern: ^(add|remove|replace)?$ - type: string - path: - type: string - value: - anyOf: - - type: string - - type: integer - - type: boolean - - type: object - - type: array - required: - - path - type: object - type: array - type: object - type: array - placement: - properties: - clusterSelector: + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + overrides: + items: properties: - matchExpressions: + clusterName: + type: string + clusterOverrides: items: properties: - key: + op: + pattern: ^(add|remove|replace)?$ type: string - operator: + path: type: string - values: - items: - type: string - type: array + value: + x-kubernetes-preserve-unknown-fields: true required: - - key - - operator + - path type: object type: array - matchLabels: - additionalProperties: - type: string - type: object type: object - clusters: - items: + type: array + placement: + properties: + clusterSelector: properties: - name: - type: string - required: - - name + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object type: object - type: array - type: object - template: - type: object - type: object - status: - properties: - clusters: - items: - properties: - name: - type: string - status: - type: string - required: - - name + clusters: + items: + properties: + name: + type: string + required: + - name + type: object + type: array type: object - type: array - conditions: - items: - properties: - lastTransitionTime: - format: date-time - type: string - lastUpdateTime: - format: date-time - type: string - reason: - type: string - status: - type: string - type: - type: string - required: - - type - - status + template: type: object - type: array - observedGeneration: - format: int64 - type: integer - type: object - required: - - spec - version: v1beta1 + x-kubernetes-preserve-unknown-fields: true + type: object + status: + properties: + clusters: + items: + properties: + name: + type: string + status: + type: string + required: + - name + type: object + type: array + conditions: + items: + properties: + lastTransitionTime: + format: date-time + type: string + lastUpdateTime: + format: date-time + type: string + reason: + type: string + status: + type: string + type: + type: string + required: + - type + - status + type: object + type: array + observedGeneration: + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: federateddeployments.types.kubefed.io @@ -269,127 +269,127 @@ spec: shortNames: - fdeploy scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - overrides: - items: - properties: - clusterName: - type: string - clusterOverrides: - items: - properties: - op: - pattern: ^(add|remove|replace)?$ - type: string - path: - type: string - value: - anyOf: - - type: string - - type: integer - - type: boolean - - type: object - - type: array - required: - - path - type: object - type: array - type: object - type: array - placement: - properties: - clusterSelector: + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + overrides: + items: properties: - matchExpressions: + clusterName: + type: string + clusterOverrides: items: properties: - key: + op: + pattern: ^(add|remove|replace)?$ type: string - operator: + path: type: string - values: - items: - type: string - type: array + value: + x-kubernetes-preserve-unknown-fields: true required: - - key - - operator + - path type: object type: array - matchLabels: - additionalProperties: - type: string - type: object type: object - clusters: - items: + type: array + placement: + properties: + clusterSelector: properties: - name: - type: string - required: - - name + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object type: object - type: array - type: object - retainReplicas: - type: boolean - template: - type: object - type: object - status: - properties: - clusters: - items: - properties: - name: - type: string - status: - type: string - required: - - name + clusters: + items: + properties: + name: + type: string + required: + - name + type: object + type: array type: object - type: array - conditions: - items: - properties: - lastTransitionTime: - format: date-time - type: string - lastUpdateTime: - format: date-time - type: string - reason: - type: string - status: - type: string - type: - type: string - required: - - type - - status + retainReplicas: + type: boolean + template: type: object - type: array - observedGeneration: - format: int64 - type: integer - type: object - required: - - spec - version: v1beta1 + x-kubernetes-preserve-unknown-fields: true + type: object + status: + properties: + clusters: + items: + properties: + name: + type: string + status: + type: string + required: + - name + type: object + type: array + conditions: + items: + properties: + lastTransitionTime: + format: date-time + type: string + lastUpdateTime: + format: date-time + type: string + reason: + type: string + status: + type: string + type: + type: string + required: + - type + - status + type: object + type: array + observedGeneration: + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: federatedingresses.types.kubefed.io @@ -401,125 +401,125 @@ spec: shortNames: - fing scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - overrides: - items: - properties: - clusterName: - type: string - clusterOverrides: - items: - properties: - op: - pattern: ^(add|remove|replace)?$ - type: string - path: - type: string - value: - anyOf: - - type: string - - type: integer - - type: boolean - - type: object - - type: array - required: - - path - type: object - type: array - type: object - type: array - placement: - properties: - clusterSelector: + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + overrides: + items: properties: - matchExpressions: + clusterName: + type: string + clusterOverrides: items: properties: - key: + op: + pattern: ^(add|remove|replace)?$ type: string - operator: + path: type: string - values: - items: - type: string - type: array + value: + x-kubernetes-preserve-unknown-fields: true required: - - key - - operator + - path type: object type: array - matchLabels: - additionalProperties: - type: string - type: object type: object - clusters: - items: + type: array + placement: + properties: + clusterSelector: properties: - name: - type: string - required: - - name + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object type: object - type: array - type: object - template: - type: object - type: object - status: - properties: - clusters: - items: - properties: - name: - type: string - status: - type: string - required: - - name + clusters: + items: + properties: + name: + type: string + required: + - name + type: object + type: array type: object - type: array - conditions: - items: - properties: - lastTransitionTime: - format: date-time - type: string - lastUpdateTime: - format: date-time - type: string - reason: - type: string - status: - type: string - type: - type: string - required: - - type - - status + template: type: object - type: array - observedGeneration: - format: int64 - type: integer - type: object - required: - - spec - version: v1beta1 + x-kubernetes-preserve-unknown-fields: true + type: object + status: + properties: + clusters: + items: + properties: + name: + type: string + status: + type: string + required: + - name + type: object + type: array + conditions: + items: + properties: + lastTransitionTime: + format: date-time + type: string + lastUpdateTime: + format: date-time + type: string + reason: + type: string + status: + type: string + type: + type: string + required: + - type + - status + type: object + type: array + observedGeneration: + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: federatedjobs.types.kubefed.io @@ -529,125 +529,125 @@ spec: kind: FederatedJob plural: federatedjobs scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - overrides: - items: - properties: - clusterName: - type: string - clusterOverrides: - items: - properties: - op: - pattern: ^(add|remove|replace)?$ - type: string - path: - type: string - value: - anyOf: - - type: string - - type: integer - - type: boolean - - type: object - - type: array - required: - - path - type: object - type: array - type: object - type: array - placement: - properties: - clusterSelector: + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + overrides: + items: properties: - matchExpressions: + clusterName: + type: string + clusterOverrides: items: properties: - key: + op: + pattern: ^(add|remove|replace)?$ type: string - operator: + path: type: string - values: - items: - type: string - type: array + value: + x-kubernetes-preserve-unknown-fields: true required: - - key - - operator + - path type: object type: array - matchLabels: - additionalProperties: - type: string - type: object type: object - clusters: - items: + type: array + placement: + properties: + clusterSelector: properties: - name: - type: string - required: - - name + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object type: object - type: array - type: object - template: - type: object - type: object - status: - properties: - clusters: - items: - properties: - name: - type: string - status: - type: string - required: - - name + clusters: + items: + properties: + name: + type: string + required: + - name + type: object + type: array type: object - type: array - conditions: - items: - properties: - lastTransitionTime: - format: date-time - type: string - lastUpdateTime: - format: date-time - type: string - reason: - type: string - status: - type: string - type: - type: string - required: - - type - - status + template: type: object - type: array - observedGeneration: - format: int64 - type: integer - type: object - required: - - spec - version: v1beta1 + x-kubernetes-preserve-unknown-fields: true + type: object + status: + properties: + clusters: + items: + properties: + name: + type: string + status: + type: string + required: + - name + type: object + type: array + conditions: + items: + properties: + lastTransitionTime: + format: date-time + type: string + lastUpdateTime: + format: date-time + type: string + reason: + type: string + status: + type: string + type: + type: string + required: + - type + - status + type: object + type: array + observedGeneration: + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: federatednamespaces.types.kubefed.io @@ -659,125 +659,125 @@ spec: shortNames: - fns scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - overrides: - items: - properties: - clusterName: - type: string - clusterOverrides: - items: - properties: - op: - pattern: ^(add|remove|replace)?$ - type: string - path: - type: string - value: - anyOf: - - type: string - - type: integer - - type: boolean - - type: object - - type: array - required: - - path - type: object - type: array - type: object - type: array - placement: - properties: - clusterSelector: + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + overrides: + items: properties: - matchExpressions: + clusterName: + type: string + clusterOverrides: items: properties: - key: + op: + pattern: ^(add|remove|replace)?$ type: string - operator: + path: type: string - values: - items: - type: string - type: array + value: + x-kubernetes-preserve-unknown-fields: true required: - - key - - operator + - path type: object type: array - matchLabels: - additionalProperties: - type: string - type: object type: object - clusters: - items: + type: array + placement: + properties: + clusterSelector: properties: - name: - type: string - required: - - name + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object type: object - type: array - type: object - template: - type: object - type: object - status: - properties: - clusters: - items: - properties: - name: - type: string - status: - type: string - required: - - name + clusters: + items: + properties: + name: + type: string + required: + - name + type: object + type: array type: object - type: array - conditions: - items: - properties: - lastTransitionTime: - format: date-time - type: string - lastUpdateTime: - format: date-time - type: string - reason: - type: string - status: - type: string - type: - type: string - required: - - type - - status + template: type: object - type: array - observedGeneration: - format: int64 - type: integer - type: object - required: - - spec - version: v1beta1 + x-kubernetes-preserve-unknown-fields: true + type: object + status: + properties: + clusters: + items: + properties: + name: + type: string + status: + type: string + required: + - name + type: object + type: array + conditions: + items: + properties: + lastTransitionTime: + format: date-time + type: string + lastUpdateTime: + format: date-time + type: string + reason: + type: string + status: + type: string + type: + type: string + required: + - type + - status + type: object + type: array + observedGeneration: + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: federatedreplicasets.types.kubefed.io @@ -789,127 +789,127 @@ spec: shortNames: - frs scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - overrides: - items: - properties: - clusterName: - type: string - clusterOverrides: - items: - properties: - op: - pattern: ^(add|remove|replace)?$ - type: string - path: - type: string - value: - anyOf: - - type: string - - type: integer - - type: boolean - - type: object - - type: array - required: - - path - type: object - type: array - type: object - type: array - placement: - properties: - clusterSelector: + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + overrides: + items: properties: - matchExpressions: + clusterName: + type: string + clusterOverrides: items: properties: - key: + op: + pattern: ^(add|remove|replace)?$ type: string - operator: + path: type: string - values: - items: - type: string - type: array + value: + x-kubernetes-preserve-unknown-fields: true required: - - key - - operator + - path type: object type: array - matchLabels: - additionalProperties: - type: string - type: object type: object - clusters: - items: + type: array + placement: + properties: + clusterSelector: properties: - name: - type: string - required: - - name + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object type: object - type: array - type: object - retainReplicas: - type: boolean - template: - type: object - type: object - status: - properties: - clusters: - items: - properties: - name: - type: string - status: - type: string - required: - - name + clusters: + items: + properties: + name: + type: string + required: + - name + type: object + type: array type: object - type: array - conditions: - items: - properties: - lastTransitionTime: - format: date-time - type: string - lastUpdateTime: - format: date-time - type: string - reason: - type: string - status: - type: string - type: - type: string - required: - - type - - status + retainReplicas: + type: boolean + template: type: object - type: array - observedGeneration: - format: int64 - type: integer - type: object - required: - - spec - version: v1beta1 + x-kubernetes-preserve-unknown-fields: true + type: object + status: + properties: + clusters: + items: + properties: + name: + type: string + status: + type: string + required: + - name + type: object + type: array + conditions: + items: + properties: + lastTransitionTime: + format: date-time + type: string + lastUpdateTime: + format: date-time + type: string + reason: + type: string + status: + type: string + type: + type: string + required: + - type + - status + type: object + type: array + observedGeneration: + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: federatedsecrets.types.kubefed.io @@ -919,125 +919,125 @@ spec: kind: FederatedSecret plural: federatedsecrets scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - overrides: - items: - properties: - clusterName: - type: string - clusterOverrides: - items: - properties: - op: - pattern: ^(add|remove|replace)?$ - type: string - path: - type: string - value: - anyOf: - - type: string - - type: integer - - type: boolean - - type: object - - type: array - required: - - path - type: object - type: array - type: object - type: array - placement: - properties: - clusterSelector: + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + overrides: + items: properties: - matchExpressions: + clusterName: + type: string + clusterOverrides: items: properties: - key: + op: + pattern: ^(add|remove|replace)?$ type: string - operator: + path: type: string - values: - items: - type: string - type: array + value: + x-kubernetes-preserve-unknown-fields: true required: - - key - - operator + - path type: object type: array - matchLabels: - additionalProperties: - type: string - type: object type: object - clusters: - items: + type: array + placement: + properties: + clusterSelector: properties: - name: - type: string - required: - - name + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object type: object - type: array - type: object - template: - type: object - type: object - status: - properties: - clusters: - items: - properties: - name: - type: string - status: - type: string - required: - - name + clusters: + items: + properties: + name: + type: string + required: + - name + type: object + type: array type: object - type: array - conditions: - items: - properties: - lastTransitionTime: - format: date-time - type: string - lastUpdateTime: - format: date-time - type: string - reason: - type: string - status: - type: string - type: - type: string - required: - - type - - status + template: type: object - type: array - observedGeneration: - format: int64 - type: integer - type: object - required: - - spec - version: v1beta1 + x-kubernetes-preserve-unknown-fields: true + type: object + status: + properties: + clusters: + items: + properties: + name: + type: string + status: + type: string + required: + - name + type: object + type: array + conditions: + items: + properties: + lastTransitionTime: + format: date-time + type: string + lastUpdateTime: + format: date-time + type: string + reason: + type: string + status: + type: string + type: + type: string + required: + - type + - status + type: object + type: array + observedGeneration: + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: federatedserviceaccounts.types.kubefed.io @@ -1049,125 +1049,125 @@ spec: shortNames: - fsa scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - overrides: - items: - properties: - clusterName: - type: string - clusterOverrides: - items: - properties: - op: - pattern: ^(add|remove|replace)?$ - type: string - path: - type: string - value: - anyOf: - - type: string - - type: integer - - type: boolean - - type: object - - type: array - required: - - path - type: object - type: array - type: object - type: array - placement: - properties: - clusterSelector: + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + overrides: + items: properties: - matchExpressions: + clusterName: + type: string + clusterOverrides: items: properties: - key: + op: + pattern: ^(add|remove|replace)?$ type: string - operator: + path: type: string - values: - items: - type: string - type: array + value: + x-kubernetes-preserve-unknown-fields: true required: - - key - - operator + - path type: object type: array - matchLabels: - additionalProperties: - type: string - type: object type: object - clusters: - items: + type: array + placement: + properties: + clusterSelector: properties: - name: - type: string - required: - - name + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object type: object - type: array - type: object - template: - type: object - type: object - status: - properties: - clusters: - items: - properties: - name: - type: string - status: - type: string - required: - - name + clusters: + items: + properties: + name: + type: string + required: + - name + type: object + type: array type: object - type: array - conditions: - items: - properties: - lastTransitionTime: - format: date-time - type: string - lastUpdateTime: - format: date-time - type: string - reason: - type: string - status: - type: string - type: - type: string - required: - - type - - status + template: type: object - type: array - observedGeneration: - format: int64 - type: integer - type: object - required: - - spec - version: v1beta1 + x-kubernetes-preserve-unknown-fields: true + type: object + status: + properties: + clusters: + items: + properties: + name: + type: string + status: + type: string + required: + - name + type: object + type: array + conditions: + items: + properties: + lastTransitionTime: + format: date-time + type: string + lastUpdateTime: + format: date-time + type: string + reason: + type: string + status: + type: string + type: + type: string + required: + - type + - status + type: object + type: array + observedGeneration: + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: federatedservices.types.kubefed.io @@ -1179,120 +1179,120 @@ spec: shortNames: - fsvc scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - overrides: - items: - properties: - clusterName: - type: string - clusterOverrides: - items: - properties: - op: - pattern: ^(add|remove|replace)?$ - type: string - path: - type: string - value: - anyOf: - - type: string - - type: integer - - type: boolean - - type: object - - type: array - required: - - path - type: object - type: array - type: object - type: array - placement: - properties: - clusterSelector: + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + overrides: + items: properties: - matchExpressions: + clusterName: + type: string + clusterOverrides: items: properties: - key: + op: + pattern: ^(add|remove|replace)?$ type: string - operator: + path: type: string - values: - items: - type: string - type: array + value: + x-kubernetes-preserve-unknown-fields: true required: - - key - - operator + - path type: object type: array - matchLabels: - additionalProperties: - type: string - type: object type: object - clusters: - items: + type: array + placement: + properties: + clusterSelector: properties: - name: - type: string - required: - - name + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object type: object - type: array - type: object - template: - type: object - type: object - status: - properties: - clusters: - items: - properties: - name: - type: string - status: - type: string - required: - - name + clusters: + items: + properties: + name: + type: string + required: + - name + type: object + type: array type: object - type: array - conditions: - items: - properties: - lastTransitionTime: - format: date-time - type: string - lastUpdateTime: - format: date-time - type: string - reason: - type: string - status: - type: string - type: - type: string - required: - - type - - status + template: type: object - type: array - observedGeneration: - format: int64 - type: integer - type: object - required: - - spec - version: v1beta1 + x-kubernetes-preserve-unknown-fields: true + type: object + status: + properties: + clusters: + items: + properties: + name: + type: string + status: + type: string + required: + - name + type: object + type: array + conditions: + items: + properties: + lastTransitionTime: + format: date-time + type: string + lastUpdateTime: + format: date-time + type: string + reason: + type: string + status: + type: string + type: + type: string + required: + - type + - status + type: object + type: array + observedGeneration: + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/cmd/controller-manager/app/controller-manager.go b/cmd/controller-manager/app/controller-manager.go index 99bc1380ce..c5ab7c6d1c 100644 --- a/cmd/controller-manager/app/controller-manager.go +++ b/cmd/controller-manager/app/controller-manager.go @@ -32,7 +32,7 @@ import ( "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/spf13/cobra" "github.com/spf13/pflag" - apiextv1b1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/yaml" @@ -145,7 +145,7 @@ func Run(opts *options.Options, stopChan <-chan struct{}) error { klog.Fatalf("Invalid Feature Gate: %v", err) } - if opts.Scope == apiextv1b1.NamespaceScoped { + if opts.Scope == apiextv1.NamespaceScoped { opts.Config.TargetNamespace = opts.Config.KubeFedNamespace klog.Infof("KubeFed will be limited to the %q namespace", opts.Config.KubeFedNamespace) } else { @@ -268,20 +268,20 @@ func setDefaultKubeFedConfigScope(fedConfig *corev1b1.KubeFedConfig) bool { const defaultScopeEnv = "DEFAULT_KUBEFED_SCOPE" defaultScope := os.Getenv(defaultScopeEnv) if len(defaultScope) != 0 { - if defaultScope != string(apiextv1b1.ClusterScoped) && defaultScope != string(apiextv1b1.NamespaceScoped) { + if defaultScope != string(apiextv1.ClusterScoped) && defaultScope != string(apiextv1.NamespaceScoped) { klog.Fatalf("%s must be one of %s or %s; got %q", defaultScopeEnv, - string(apiextv1b1.ClusterScoped), string(apiextv1b1.NamespaceScoped), defaultScope) + string(apiextv1.ClusterScoped), string(apiextv1.NamespaceScoped), defaultScope) return false } if len(fedConfig.Spec.Scope) == 0 { - fedConfig.Spec.Scope = apiextv1b1.ResourceScope(defaultScope) + fedConfig.Spec.Scope = apiextv1.ResourceScope(defaultScope) klog.Infof("Setting the scope of KubeFedConfig spec to %s", defaultScope) return true - } else if fedConfig.Spec.Scope != apiextv1b1.ResourceScope(defaultScope) { + } else if fedConfig.Spec.Scope != apiextv1.ResourceScope(defaultScope) { klog.Infof("Setting the scope of KubeFedConfig spec from %s to %s", string(fedConfig.Spec.Scope), defaultScope) - fedConfig.Spec.Scope = apiextv1b1.ResourceScope(defaultScope) + fedConfig.Spec.Scope = apiextv1.ResourceScope(defaultScope) return true } } diff --git a/cmd/controller-manager/app/options/options.go b/cmd/controller-manager/app/options/options.go index 3c2f189479..4de7506ed6 100644 --- a/cmd/controller-manager/app/options/options.go +++ b/cmd/controller-manager/app/options/options.go @@ -20,7 +20,7 @@ package options import ( "github.com/spf13/pflag" - apiextv1b1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "sigs.k8s.io/kubefed/pkg/controller/util" ) @@ -29,7 +29,7 @@ import ( type Options struct { Config *util.ControllerConfig FeatureGates map[string]bool - Scope apiextv1b1.ResourceScope + Scope apiextv1.ResourceScope LeaderElection *util.LeaderElectionConfiguration ClusterHealthCheckConfig *util.ClusterHealthCheckConfig } diff --git a/go.mod b/go.mod index 09806c992e..c16d658dd8 100644 --- a/go.mod +++ b/go.mod @@ -25,6 +25,7 @@ require ( k8s.io/klog v1.0.0 k8s.io/kube-openapi v0.0.0-20200923155610-8b5066479488 k8s.io/kubectl v0.19.3 + k8s.io/utils v0.0.0-20201005171033-6301aaf42dc7 sigs.k8s.io/controller-runtime v0.6.3 sigs.k8s.io/yaml v1.2.0 ) diff --git a/go.sum b/go.sum index f9a70afa00..8d786f2488 100644 --- a/go.sum +++ b/go.sum @@ -942,8 +942,9 @@ k8s.io/metrics v0.19.3/go.mod h1:Eap/Lk1FiAIjkaArFuv41v+ph6dbDpVGwAg7jMI+4vg= k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200603063816-c1c6865ac451 h1:v8ud2Up6QK1lNOKFgiIVrZdMg7MpmSnvtrOieolJKoE= k8s.io/utils v0.0.0-20200603063816-c1c6865ac451/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20200729134348-d5654de09c73 h1:uJmqzgNWG7XyClnU/mLPBWwfKKF1K8Hf8whTseBgJcg= k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20201005171033-6301aaf42dc7 h1:XQ0OMFdRDkDIu0b1zqEKSZdWUD7I4bZ4d4nqr8CLKbQ= +k8s.io/utils v0.0.0-20201005171033-6301aaf42dc7/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7 h1:uuHDyjllyzRyCIvvn0OBjiRB0SgBZGqHNYAmjR7fO50= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0= diff --git a/pkg/apis/core/v1beta1/defaults/defaults_test.go b/pkg/apis/core/v1beta1/defaults/defaults_test.go index a2495a0933..8456395da8 100644 --- a/pkg/apis/core/v1beta1/defaults/defaults_test.go +++ b/pkg/apis/core/v1beta1/defaults/defaults_test.go @@ -22,7 +22,7 @@ import ( "testing" "time" - apiextv1b1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/kubefed/pkg/apis/core/v1beta1" @@ -140,7 +140,7 @@ func defaultKubeFedConfig() *v1beta1.KubeFedConfig { Name: util.KubeFedConfigName, }, Spec: v1beta1.KubeFedConfigSpec{ - Scope: apiextv1b1.ClusterScoped, + Scope: apiextv1.ClusterScoped, }, } diff --git a/pkg/apis/core/v1beta1/federatedtypeconfig_types.go b/pkg/apis/core/v1beta1/federatedtypeconfig_types.go index f7c7d62ec8..cab2644926 100644 --- a/pkg/apis/core/v1beta1/federatedtypeconfig_types.go +++ b/pkg/apis/core/v1beta1/federatedtypeconfig_types.go @@ -20,7 +20,7 @@ import ( "fmt" "strings" - apiextv1b1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/kubefed/pkg/apis/core/common" @@ -66,7 +66,7 @@ type APIResource struct { // suffixing an 's'. PluralName string `json:"pluralName"` // Scope of the resource. - Scope apiextv1b1.ResourceScope `json:"scope"` + Scope apiextv1.ResourceScope `json:"scope"` } // PropagationMode defines the state of propagation to member clusters. @@ -243,7 +243,7 @@ func (f *FederatedTypeConfig) IsNamespace() bool { } func (a *APIResource) Namespaced() bool { - return a.Scope == apiextv1b1.NamespaceScoped + return a.Scope == apiextv1.NamespaceScoped } func apiResourceToMeta(apiResource APIResource, namespaced bool) metav1.APIResource { diff --git a/pkg/apis/core/v1beta1/kubefedconfig_types.go b/pkg/apis/core/v1beta1/kubefedconfig_types.go index a05af4befe..b86930b91e 100644 --- a/pkg/apis/core/v1beta1/kubefedconfig_types.go +++ b/pkg/apis/core/v1beta1/kubefedconfig_types.go @@ -17,7 +17,7 @@ limitations under the License. package v1beta1 import ( - apiextv1b1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -26,7 +26,7 @@ type KubeFedConfigSpec struct { // The scope of the KubeFed control plane should be either // `Namespaced` or `Cluster`. `Namespaced` indicates that the // KubeFed namespace will be the only target of the control plane. - Scope apiextv1b1.ResourceScope `json:"scope"` + Scope apiextv1.ResourceScope `json:"scope"` // +optional ControllerDuration *DurationConfig `json:"controllerDuration,omitempty"` // +optional diff --git a/pkg/apis/core/v1beta1/validation/validation.go b/pkg/apis/core/v1beta1/validation/validation.go index edf1563157..270177df56 100644 --- a/pkg/apis/core/v1beta1/validation/validation.go +++ b/pkg/apis/core/v1beta1/validation/validation.go @@ -23,7 +23,7 @@ import ( "time" corev1 "k8s.io/api/core/v1" - apiextv1b1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" apimachineryval "k8s.io/apimachinery/pkg/api/validation" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" @@ -120,7 +120,7 @@ func ValidateAPIResource(obj *v1beta1.APIResource, fldPath *field.Path) field.Er allErrs = append(allErrs, field.Invalid(fldPath.Child("pluralName"), obj.PluralName, strings.Join(errs, ","))) } - allErrs = append(allErrs, validateEnumStrings(fldPath.Child("scope"), string(obj.Scope), []string{string(apiextv1b1.ClusterScoped), string(apiextv1b1.NamespaceScoped)})...) + allErrs = append(allErrs, validateEnumStrings(fldPath.Child("scope"), string(obj.Scope), []string{string(apiextv1.ClusterScoped), string(apiextv1.NamespaceScoped)})...) return allErrs } @@ -252,7 +252,7 @@ func ValidateKubeFedConfig(kubeFedConfig, oldKubeFedConfig *v1beta1.KubeFedConfi spec := kubeFedConfig.Spec specPath := field.NewPath("spec") allErrs = append(allErrs, validateEnumStrings(specPath.Child("scope"), string(spec.Scope), - []string{string(apiextv1b1.ClusterScoped), string(apiextv1b1.NamespaceScoped)})...) + []string{string(apiextv1.ClusterScoped), string(apiextv1.NamespaceScoped)})...) if oldKubeFedConfig != nil { // We are validating a KubeFedConfig update. diff --git a/pkg/apis/core/v1beta1/validation/validation_test.go b/pkg/apis/core/v1beta1/validation/validation_test.go index 46d5eb3a8f..3ddf72de36 100644 --- a/pkg/apis/core/v1beta1/validation/validation_test.go +++ b/pkg/apis/core/v1beta1/validation/validation_test.go @@ -23,7 +23,7 @@ import ( "time" corev1 "k8s.io/api/core/v1" - apiextv1b1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/validation/field" @@ -659,7 +659,7 @@ func TestValidateKubeFedConfig(t *testing.T) { errorCases["spec.scope: Unsupported value"] = invalidScope immutableScope := testcommon.ValidKubeFedConfig() - immutableScope.Spec.Scope = apiextv1b1.NamespaceScoped + immutableScope.Spec.Scope = apiextv1.NamespaceScoped errorCases[`spec.scope: Invalid value: "Namespaced": field is immutable`] = immutableScope invalidControllerDurationNil := testcommon.ValidKubeFedConfig() diff --git a/pkg/controller/testdata/fixtures/crds.yaml b/pkg/controller/testdata/fixtures/crds.yaml index a8a297d4bb..99321a4de9 100644 --- a/pkg/controller/testdata/fixtures/crds.yaml +++ b/pkg/controller/testdata/fixtures/crds.yaml @@ -1,13 +1,10 @@ - ---- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - annotations: - "helm.sh/hook": crd-install - creationTimestamp: null name: clusterpropagatedversions.core.kubefed.io spec: + conversion: + strategy: None group: core.kubefed.io names: kind: ClusterPropagatedVersion @@ -15,83 +12,201 @@ spec: plural: clusterpropagatedversions singular: clusterpropagatedversion scope: Cluster - #subresources: - # status: {} - validation: - openAPIV3Schema: - description: ClusterPropagatedVersion holds version information about the state - propagated from KubeFed APIs (configured by FederatedTypeConfig resources) - to member clusters. The name of a ClusterPropagatedVersion encodes the kind - and name of the resource it stores information for (i.e. -). If a target resource has a populated metadata.Generation field, the - generation will be stored with a prefix of `gen:` as the version for the cluster. If - metadata.Generation is not available, metadata.ResourceVersion will be stored - with a prefix of `rv:` as the version for the cluster. - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - status: - description: PropagatedVersionStatus defines the observed state of PropagatedVersion - properties: - clusterVersions: - description: The last versions produced in each cluster for this resource. - items: - properties: - clusterName: - description: The name of the cluster the version is for. - type: string - version: - description: The last version produced for the resource by a KubeFed - operation. - type: string - required: - - clusterName - - version - type: object - type: array - overridesVersion: - description: The observed version of the overrides for this resource. - type: string - templateVersion: - description: The observed version of the template for this resource. - type: string - required: - - overridesVersion - - templateVersion - type: object - type: object - version: v1alpha1 versions: - name: v1alpha1 + schema: + openAPIV3Schema: + x-kubernetes-preserve-unknown-fields: true + description: ClusterPropagatedVersion holds version information about the + state propagated from KubeFed APIs (configured by FederatedTypeConfig resources) + to member clusters. The name of a ClusterPropagatedVersion encodes the kind + and name of the resource it stores information for (i.e. -). If a target resource has a populated metadata.Generation field, + the generation will be stored with a prefix of `gen:` as the version for + the cluster. If metadata.Generation is not available, metadata.ResourceVersion + will be stored with a prefix of `rv:` as the version for the cluster. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + status: + description: PropagatedVersionStatus defines the observed state of PropagatedVersion + properties: + clusterVersions: + description: The last versions produced in each cluster for this resource. + items: + properties: + clusterName: + description: The name of the cluster the version is for. + type: string + version: + description: The last version produced for the resource by a + KubeFed operation. + type: string + required: + - clusterName + - version + type: object + type: array + overridesVersion: + description: The observed version of the overrides for this resource. + type: string + templateVersion: + description: The observed version of the template for this resource. + type: string + required: + - overridesVersion + - templateVersion + type: object + type: object served: true storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] + subresources: + status: {} --- - +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: dnsendpoints.multiclusterdns.kubefed.io +spec: + conversion: + strategy: None + group: multiclusterdns.kubefed.io + names: + kind: DNSEndpoint + listKind: DNSEndpointList + plural: dnsendpoints + singular: dnsendpoint + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + x-kubernetes-preserve-unknown-fields: true + description: DNSEndpoint is the CRD wrapper for Endpoint which is designed + to act as a source of truth for external-dns. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: DNSEndpointSpec defines the desired state of DNSEndpoint + properties: + endpoints: + items: + description: Endpoint is a high-level association between a service + and an IP. + properties: + dnsName: + description: The FQDN of the DNS record. + type: string + labels: + additionalProperties: + type: string + description: Labels stores labels defined for the Endpoint. + type: object + recordTTL: + description: TTL for the record in seconds. + format: int64 + type: integer + recordType: + description: RecordType type of record, e.g. CNAME, A, SRV, + TXT etc. + type: string + targets: + description: The targets that the DNS record points to. + items: + type: string + type: array + type: object + type: array + type: object + status: + description: DNSEndpointStatus defines the observed state of DNSEndpoint + properties: + observedGeneration: + description: ObservedGeneration is the generation as observed by the + controller consuming the DNSEndpoint. + format: int64 + type: integer + type: object + type: object + served: true + storage: true + subresources: + status: {} --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: domains.multiclusterdns.kubefed.io +spec: + conversion: + strategy: None + group: multiclusterdns.kubefed.io + names: + kind: Domain + listKind: DomainList + plural: domains + singular: domain + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + x-kubernetes-preserve-unknown-fields: true + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + domain: + description: Domain is the DNS zone associated with the KubeFed control + plane + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + nameServer: + description: NameServer is the authoritative DNS name server for the KubeFed + domain + type: string + required: + - domain + type: object + served: true + storage: true +--- +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - annotations: - "helm.sh/hook": crd-install - creationTimestamp: null name: federatedservicestatuses.core.kubefed.io spec: + conversion: + strategy: None group: core.kubefed.io names: kind: FederatedServiceStatus @@ -99,84 +214,75 @@ spec: plural: federatedservicestatuses singular: federatedservicestatus scope: Namespaced - validation: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - clusterStatus: - items: - description: FederatedServiceClusterStatus is the observed status of the - resource for a named cluster - properties: - clusterName: - type: string - status: - description: ServiceStatus represents the current status of a service. - properties: - loadBalancer: - description: LoadBalancer contains the current status of the load-balancer, - if one is present. - properties: - ingress: - description: Ingress is a list containing ingress points for - the load-balancer. Traffic intended for the service should - be sent to these ingress points. - items: - description: 'LoadBalancerIngress represents the status - of a load-balancer ingress point: traffic intended for - the service should be sent to an ingress point.' - properties: - hostname: - description: Hostname is set for load-balancer ingress - points that are DNS based (typically AWS load-balancers) - type: string - ip: - description: IP is set for load-balancer ingress points - that are IP based (typically GCE or OpenStack load-balancers) - type: string - type: object - type: array - type: object - type: object - required: - - clusterName - - status - type: object - type: array - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - type: object - version: v1alpha1 versions: - name: v1alpha1 + schema: + openAPIV3Schema: + x-kubernetes-preserve-unknown-fields: true + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + clusterStatus: + items: + description: FederatedServiceClusterStatus is the observed status of + the resource for a named cluster + properties: + clusterName: + type: string + status: + description: ServiceStatus represents the current status of a service. + properties: + loadBalancer: + description: LoadBalancer contains the current status of the + load-balancer, if one is present. + properties: + ingress: + description: Ingress is a list containing ingress points + for the load-balancer. Traffic intended for the service + should be sent to these ingress points. + items: + description: 'LoadBalancerIngress represents the status + of a load-balancer ingress point: traffic intended for + the service should be sent to an ingress point.' + properties: + hostname: + description: Hostname is set for load-balancer ingress + points that are DNS based (typically AWS load-balancers) + type: string + ip: + description: IP is set for load-balancer ingress points + that are IP based (typically GCE or OpenStack load-balancers) + type: string + type: object + type: array + type: object + type: object + required: + - clusterName + - status + type: object + type: array + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + type: object served: true storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] ---- - --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - annotations: - "helm.sh/hook": crd-install - creationTimestamp: null name: federatedtypeconfigs.core.kubefed.io spec: + conversion: + strategy: None group: core.kubefed.io names: kind: FederatedTypeConfig @@ -186,180 +292,254 @@ spec: - ftc singular: federatedtypeconfig scope: Namespaced - #subresources: - # status: {} - validation: - openAPIV3Schema: - description: "FederatedTypeConfig programs KubeFed to know about a single API - type - the \"target type\" - that a user wants to federate. For each target - type, there is a corresponding FederatedType that has the following fields: - \n - The \"template\" field specifies the basic definition of a federated - resource - The \"placement\" field specifies the placement information for - the federated resource - The \"overrides\" field specifies how the target - resource should vary across clusters." - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: FederatedTypeConfigSpec defines the desired state of FederatedTypeConfig. - properties: - federatedType: - description: Configuration for the federated type that defines (via - template, placement and overrides fields) how the target type should - appear in multiple cluster. - properties: - group: - description: Group of the resource. - type: string - kind: - description: Camel-cased singular name of the resource (e.g. ConfigMap) - type: string - pluralName: - description: Lower-cased plural name of the resource (e.g. configmaps). If - not provided, it will be computed by lower-casing the kind and - suffixing an 's'. - type: string - scope: - description: Scope of the resource. - type: string - version: - description: Version of the resource. - type: string - required: - - kind - - pluralName - - scope - - version - type: object - propagation: - description: Whether or not propagation to member clusters should be - enabled. - type: string - statusCollection: - description: Whether or not Status object should be populated. - type: string - statusType: - description: Configuration for the status type that holds information - about which type holds the status of the federated resource. If not - provided, the group and version will default to those provided for - the federated type api resource. - properties: - group: - description: Group of the resource. - type: string - kind: - description: Camel-cased singular name of the resource (e.g. ConfigMap) - type: string - pluralName: - description: Lower-cased plural name of the resource (e.g. configmaps). If - not provided, it will be computed by lower-casing the kind and - suffixing an 's'. - type: string - scope: - description: Scope of the resource. - type: string - version: - description: Version of the resource. - type: string - required: - - kind - - pluralName - - scope - - version - type: object - targetType: - description: The configuration of the target type. If not set, the pluralName - and groupName fields will be set from the metadata.name of this resource. - The kind field must be set. - properties: - group: - description: Group of the resource. - type: string - kind: - description: Camel-cased singular name of the resource (e.g. ConfigMap) - type: string - pluralName: - description: Lower-cased plural name of the resource (e.g. configmaps). If - not provided, it will be computed by lower-casing the kind and - suffixing an 's'. - type: string - scope: - description: Scope of the resource. - type: string - version: - description: Version of the resource. - type: string - required: - - kind - - pluralName - - scope - - version - type: object - required: - - federatedType - - propagation - - targetType - type: object - status: - description: FederatedTypeConfigStatus defines the observed state of FederatedTypeConfig - properties: - observedGeneration: - description: ObservedGeneration is the generation as observed by the - controller consuming the FederatedTypeConfig. - format: int64 - type: integer - propagationController: - description: PropagationController tracks the status of the sync controller. - type: string - statusController: - description: StatusController tracks the status of the status controller. - type: string - required: - - observedGeneration - - propagationController - type: object - required: - - spec - type: object - version: v1beta1 versions: - name: v1beta1 + schema: + openAPIV3Schema: + x-kubernetes-preserve-unknown-fields: true + description: "FederatedTypeConfig programs KubeFed to know about a single + API type - the \"target type\" - that a user wants to federate. For each + target type, there is a corresponding FederatedType that has the following + fields: \n - The \"template\" field specifies the basic definition of a + federated resource - The \"placement\" field specifies the placement information + for the federated resource - The \"overrides\" field specifies how the + target resource should vary across clusters." + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: FederatedTypeConfigSpec defines the desired state of FederatedTypeConfig. + properties: + federatedType: + description: Configuration for the federated type that defines (via + template, placement and overrides fields) how the target type should + appear in multiple cluster. + properties: + group: + description: Group of the resource. + type: string + kind: + description: Camel-cased singular name of the resource (e.g. ConfigMap) + type: string + pluralName: + description: Lower-cased plural name of the resource (e.g. configmaps). If + not provided, it will be computed by lower-casing the kind and + suffixing an 's'. + type: string + scope: + description: Scope of the resource. + type: string + version: + description: Version of the resource. + type: string + required: + - kind + - pluralName + - scope + - version + type: object + propagation: + description: Whether or not propagation to member clusters should + be enabled. + type: string + statusCollection: + description: Whether or not Status object should be populated. + type: string + statusType: + description: Configuration for the status type that holds information + about which type holds the status of the federated resource. If + not provided, the group and version will default to those provided + for the federated type api resource. + properties: + group: + description: Group of the resource. + type: string + kind: + description: Camel-cased singular name of the resource (e.g. ConfigMap) + type: string + pluralName: + description: Lower-cased plural name of the resource (e.g. configmaps). If + not provided, it will be computed by lower-casing the kind and + suffixing an 's'. + type: string + scope: + description: Scope of the resource. + type: string + version: + description: Version of the resource. + type: string + required: + - kind + - pluralName + - scope + - version + type: object + targetType: + description: The configuration of the target type. If not set, the + pluralName and groupName fields will be set from the metadata.name + of this resource. The kind field must be set. + properties: + group: + description: Group of the resource. + type: string + kind: + description: Camel-cased singular name of the resource (e.g. ConfigMap) + type: string + pluralName: + description: Lower-cased plural name of the resource (e.g. configmaps). If + not provided, it will be computed by lower-casing the kind and + suffixing an 's'. + type: string + scope: + description: Scope of the resource. + type: string + version: + description: Version of the resource. + type: string + required: + - kind + - pluralName + - scope + - version + type: object + required: + - federatedType + - propagation + - targetType + type: object + status: + description: FederatedTypeConfigStatus defines the observed state of FederatedTypeConfig + properties: + observedGeneration: + description: ObservedGeneration is the generation as observed by the + controller consuming the FederatedTypeConfig. + format: int64 + type: integer + propagationController: + description: PropagationController tracks the status of the sync controller. + type: string + statusController: + description: StatusController tracks the status of the status controller. + type: string + required: + - observedGeneration + - propagationController + type: object + required: + - spec + type: object served: true storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] + subresources: + status: {} --- - +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: ingressdnsrecords.multiclusterdns.kubefed.io +spec: + conversion: + strategy: None + group: multiclusterdns.kubefed.io + names: + kind: IngressDNSRecord + listKind: IngressDNSRecordList + plural: ingressdnsrecords + singular: ingressdnsrecord + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + x-kubernetes-preserve-unknown-fields: true + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: IngressDNSRecordSpec defines the desired state of IngressDNSRecord + properties: + hosts: + description: Host from the IngressRule in Cluster Ingress Spec + items: + type: string + type: array + recordTTL: + description: RecordTTL is the TTL in seconds for DNS records created + for the Ingress, if omitted a default would be used + format: int64 + type: integer + type: object + status: + description: IngressDNSRecordStatus defines the observed state of IngressDNSRecord + properties: + dns: + description: Array of Ingress Controller LoadBalancers + items: + description: ClusterIngressDNS defines the observed status of Ingress + within a cluster. + properties: + cluster: + description: Cluster name + type: string + loadBalancer: + description: LoadBalancer for the corresponding ingress controller + properties: + ingress: + description: Ingress is a list containing ingress points + for the load-balancer. Traffic intended for the service + should be sent to these ingress points. + items: + description: 'LoadBalancerIngress represents the status + of a load-balancer ingress point: traffic intended for + the service should be sent to an ingress point.' + properties: + hostname: + description: Hostname is set for load-balancer ingress + points that are DNS based (typically AWS load-balancers) + type: string + ip: + description: IP is set for load-balancer ingress points + that are IP based (typically GCE or OpenStack load-balancers) + type: string + type: object + type: array + type: object + type: object + type: array + type: object + type: object + served: true + storage: true + subresources: + status: {} --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - annotations: - "helm.sh/hook": crd-install - creationTimestamp: null name: kubefedclusters.core.kubefed.io spec: - additionalPrinterColumns: - - JSONPath: .metadata.creationTimestamp - name: age - type: date - - JSONPath: .status.conditions[?(@.type=='Ready')].status - name: ready - type: string + conversion: + strategy: None group: core.kubefed.io names: kind: KubeFedCluster @@ -367,134 +547,132 @@ spec: plural: kubefedclusters singular: kubefedcluster scope: Namespaced - #subresources: - # status: {} - validation: - openAPIV3Schema: - description: KubeFedCluster configures KubeFed to be aware of a Kubernetes cluster - and encapsulates the details necessary to communicate with the cluster. - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: KubeFedClusterSpec defines the desired state of KubeFedCluster - properties: - apiEndpoint: - description: The API endpoint of the member cluster. This can be a hostname, - hostname:port, IP or IP:port. - type: string - caBundle: - description: CABundle contains the certificate authority information. - format: byte - type: string - disabledTLSValidations: - description: DisabledTLSValidations defines a list of checks to ignore - when validating the TLS connection to the member cluster. This can - be any of *, SubjectName, or ValidityPeriod. If * is specified, it - is expected to be the only option in list. - items: + versions: + - additionalPrinterColumns: + - jsonPath: .metadata.creationTimestamp + name: age + type: date + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: ready + type: string + name: v1beta1 + schema: + openAPIV3Schema: + x-kubernetes-preserve-unknown-fields: true + description: KubeFedCluster configures KubeFed to be aware of a Kubernetes + cluster and encapsulates the details necessary to communicate with the cluster. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: KubeFedClusterSpec defines the desired state of KubeFedCluster + properties: + apiEndpoint: + description: The API endpoint of the member cluster. This can be a + hostname, hostname:port, IP or IP:port. type: string - type: array - secretRef: - description: Name of the secret containing the token required to access - the member cluster. The secret needs to exist in the same namespace - as the control plane and should have a "token" key. - properties: - name: - description: Name of a secret within the enclosing namespace + caBundle: + description: CABundle contains the certificate authority information. + format: byte + type: string + disabledTLSValidations: + description: DisabledTLSValidations defines a list of checks to ignore + when validating the TLS connection to the member cluster. This + can be any of *, SubjectName, or ValidityPeriod. If * is specified, + it is expected to be the only option in list. + items: type: string - required: - - name - type: object - required: - - apiEndpoint - - secretRef - type: object - status: - description: KubeFedClusterStatus contains information about the current - status of a cluster updated periodically by cluster controller. - properties: - conditions: - description: Conditions is an array of current cluster conditions. - items: - description: ClusterCondition describes current state of a cluster. + type: array + secretRef: + description: Name of the secret containing the token required to access + the member cluster. The secret needs to exist in the same namespace + as the control plane and should have a "token" key. properties: - lastProbeTime: - description: Last time the condition was checked. - format: date-time - type: string - lastTransitionTime: - description: Last time the condition transit from one status to - another. - format: date-time - type: string - message: - description: Human readable message indicating details about last - transition. - type: string - reason: - description: (brief) reason for the condition's last transition. - type: string - status: - description: Status of the condition, one of True, False, Unknown. - type: string - type: - description: Type of cluster condition, Ready or Offline. + name: + description: Name of a secret within the enclosing namespace type: string required: - - lastProbeTime - - status - - type + - name type: object - type: array - region: - description: Region is the name of the region in which all of the nodes - in the cluster exist. e.g. 'us-east1'. - type: string - zones: - description: Zones are the names of availability zones in which the - nodes of the cluster exist, e.g. 'us-east1-a'. - items: + required: + - apiEndpoint + - secretRef + type: object + status: + description: KubeFedClusterStatus contains information about the current + status of a cluster updated periodically by cluster controller. + properties: + conditions: + description: Conditions is an array of current cluster conditions. + items: + description: ClusterCondition describes current state of a cluster. + properties: + lastProbeTime: + description: Last time the condition was checked. + format: date-time + type: string + lastTransitionTime: + description: Last time the condition transit from one status + to another. + format: date-time + type: string + message: + description: Human readable message indicating details about + last transition. + type: string + reason: + description: (brief) reason for the condition's last transition. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: Type of cluster condition, Ready or Offline. + type: string + required: + - lastProbeTime + - status + - type + type: object + type: array + region: + description: Region is the name of the region in which all of the + nodes in the cluster exist. e.g. 'us-east1'. type: string - type: array - required: - - conditions - type: object - required: - - spec - type: object - version: v1beta1 - versions: - - name: v1beta1 + zones: + description: Zones are the names of availability zones in which the + nodes of the cluster exist, e.g. 'us-east1-a'. + items: + type: string + type: array + required: + - conditions + type: object + required: + - spec + type: object served: true storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] ---- - + subresources: + status: {} --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - annotations: - "helm.sh/hook": crd-install - creationTimestamp: null name: kubefedconfigs.core.kubefed.io spec: + conversion: + strategy: None group: core.kubefed.io names: kind: KubeFedConfig @@ -502,132 +680,123 @@ spec: plural: kubefedconfigs singular: kubefedconfig scope: Namespaced - validation: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: KubeFedConfigSpec defines the desired state of KubeFedConfig - properties: - clusterHealthCheck: - properties: - failureThreshold: - description: Minimum consecutive failures for the cluster health - to be considered failed after having succeeded. - format: int64 - type: integer - period: - description: How often to monitor the cluster health. - type: string - successThreshold: - description: Minimum consecutive successes for the cluster health - to be considered successful after having failed. - format: int64 - type: integer - timeout: - description: Duration after which the cluster health check times - out. - type: string - type: object - controllerDuration: - properties: - availableDelay: - description: Time to wait before reconciling on a healthy cluster. - type: string - unavailableDelay: - description: Time to wait before giving up on an unhealthy cluster. - type: string - type: object - featureGates: - items: + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + x-kubernetes-preserve-unknown-fields: true + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: KubeFedConfigSpec defines the desired state of KubeFedConfig + properties: + clusterHealthCheck: properties: - configuration: + failureThreshold: + description: Minimum consecutive failures for the cluster health + to be considered failed after having succeeded. + format: int64 + type: integer + period: + description: How often to monitor the cluster health. type: string - name: + successThreshold: + description: Minimum consecutive successes for the cluster health + to be considered successful after having failed. + format: int64 + type: integer + timeout: + description: Duration after which the cluster health check times + out. type: string - required: - - configuration - - name type: object - type: array - leaderElect: - properties: - leaseDuration: - description: The duration that non-leader candidates will wait after - observing a leadership renewal until attempting to acquire leadership - of a led but unrenewed leader slot. This is effectively the maximum - duration that a leader can be stopped before it is replaced by - another candidate. This is only applicable if leader election - is enabled. - type: string - renewDeadline: - description: The interval between attempts by the acting master - to renew a leadership slot before it stops leading. This must - be less than or equal to the lease duration. This is only applicable - if leader election is enabled. - type: string - resourceLock: - description: The type of resource object that is used for locking - during leader election. Supported options are `configmaps` (default) - and `endpoints`. - type: string - retryPeriod: - description: The duration the clients should wait between attempting - acquisition and renewal of a leadership. This is only applicable - if leader election is enabled. - type: string - type: object - scope: - description: The scope of the KubeFed control plane should be either - `Namespaced` or `Cluster`. `Namespaced` indicates that the KubeFed - namespace will be the only target of the control plane. - type: string - syncController: - properties: - adoptResources: - description: Whether to adopt pre-existing resources in member clusters. - Defaults to "Enabled". - type: string - type: object - required: - - scope - type: object - required: - - spec - type: object - version: v1beta1 - versions: - - name: v1beta1 + controllerDuration: + properties: + availableDelay: + description: Time to wait before reconciling on a healthy cluster. + type: string + unavailableDelay: + description: Time to wait before giving up on an unhealthy cluster. + type: string + type: object + featureGates: + items: + properties: + configuration: + type: string + name: + type: string + required: + - configuration + - name + type: object + type: array + leaderElect: + properties: + leaseDuration: + description: The duration that non-leader candidates will wait + after observing a leadership renewal until attempting to acquire + leadership of a led but unrenewed leader slot. This is effectively + the maximum duration that a leader can be stopped before it + is replaced by another candidate. This is only applicable if + leader election is enabled. + type: string + renewDeadline: + description: The interval between attempts by the acting master + to renew a leadership slot before it stops leading. This must + be less than or equal to the lease duration. This is only applicable + if leader election is enabled. + type: string + resourceLock: + description: The type of resource object that is used for locking + during leader election. Supported options are `configmaps` (default) + and `endpoints`. + type: string + retryPeriod: + description: The duration the clients should wait between attempting + acquisition and renewal of a leadership. This is only applicable + if leader election is enabled. + type: string + type: object + scope: + description: The scope of the KubeFed control plane should be either + `Namespaced` or `Cluster`. `Namespaced` indicates that the KubeFed + namespace will be the only target of the control plane. + type: string + syncController: + properties: + adoptResources: + description: Whether to adopt pre-existing resources in member + clusters. Defaults to "Enabled". + type: string + type: object + required: + - scope + type: object + required: + - spec + type: object served: true storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] ---- - --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - annotations: - "helm.sh/hook": crd-install - creationTimestamp: null name: propagatedversions.core.kubefed.io spec: + conversion: + strategy: None group: core.kubefed.io names: kind: PropagatedVersion @@ -635,327 +804,177 @@ spec: plural: propagatedversions singular: propagatedversion scope: Namespaced - #subresources: - # status: {} - validation: - openAPIV3Schema: - description: PropagatedVersion holds version information about the state propagated - from KubeFed APIs (configured by FederatedTypeConfig resources) to member - clusters. The name of a PropagatedVersion encodes the kind and name of the - resource it stores information for (i.e. -). - If a target resource has a populated metadata.Generation field, the generation - will be stored with a prefix of `gen:` as the version for the cluster. If - metadata.Generation is not available, metadata.ResourceVersion will be stored - with a prefix of `rv:` as the version for the cluster. - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - status: - description: PropagatedVersionStatus defines the observed state of PropagatedVersion - properties: - clusterVersions: - description: The last versions produced in each cluster for this resource. - items: - properties: - clusterName: - description: The name of the cluster the version is for. - type: string - version: - description: The last version produced for the resource by a KubeFed - operation. - type: string - required: - - clusterName - - version - type: object - type: array - overridesVersion: - description: The observed version of the overrides for this resource. - type: string - templateVersion: - description: The observed version of the template for this resource. - type: string - required: - - overridesVersion - - templateVersion - type: object - type: object - version: v1alpha1 versions: - name: v1alpha1 - served: true - storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] ---- - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - "helm.sh/hook": crd-install - creationTimestamp: null - name: dnsendpoints.multiclusterdns.kubefed.io -spec: - group: multiclusterdns.kubefed.io - names: - kind: DNSEndpoint - listKind: DNSEndpointList - plural: dnsendpoints - singular: dnsendpoint - scope: Namespaced - #subresources: - # status: {} - validation: - openAPIV3Schema: - description: DNSEndpoint is the CRD wrapper for Endpoint which is designed to - act as a source of truth for external-dns. - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: DNSEndpointSpec defines the desired state of DNSEndpoint - properties: - endpoints: - items: - description: Endpoint is a high-level association between a service - and an IP. - properties: - dnsName: - description: The FQDN of the DNS record. - type: string - labels: - additionalProperties: + schema: + openAPIV3Schema: + x-kubernetes-preserve-unknown-fields: true + description: PropagatedVersion holds version information about the state propagated + from KubeFed APIs (configured by FederatedTypeConfig resources) to member + clusters. The name of a PropagatedVersion encodes the kind and name of the + resource it stores information for (i.e. -). + If a target resource has a populated metadata.Generation field, the generation + will be stored with a prefix of `gen:` as the version for the cluster. If + metadata.Generation is not available, metadata.ResourceVersion will be stored + with a prefix of `rv:` as the version for the cluster. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + status: + description: PropagatedVersionStatus defines the observed state of PropagatedVersion + properties: + clusterVersions: + description: The last versions produced in each cluster for this resource. + items: + properties: + clusterName: + description: The name of the cluster the version is for. type: string - description: Labels stores labels defined for the Endpoint. - type: object - recordTTL: - description: TTL for the record in seconds. - format: int64 - type: integer - recordType: - description: RecordType type of record, e.g. CNAME, A, SRV, TXT - etc. - type: string - targets: - description: The targets that the DNS record points to. - items: + version: + description: The last version produced for the resource by a + KubeFed operation. type: string - type: array - type: object - type: array - type: object - status: - description: DNSEndpointStatus defines the observed state of DNSEndpoint - properties: - observedGeneration: - description: ObservedGeneration is the generation as observed by the - controller consuming the DNSEndpoint. - format: int64 - type: integer - type: object - type: object - version: v1alpha1 - versions: - - name: v1alpha1 + required: + - clusterName + - version + type: object + type: array + overridesVersion: + description: The observed version of the overrides for this resource. + type: string + templateVersion: + description: The observed version of the template for this resource. + type: string + required: + - overridesVersion + - templateVersion + type: object + type: object served: true storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] + subresources: + status: {} --- - ---- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - annotations: - "helm.sh/hook": crd-install - creationTimestamp: null - name: domains.multiclusterdns.kubefed.io + name: replicaschedulingpreferences.scheduling.kubefed.io spec: - group: multiclusterdns.kubefed.io + conversion: + strategy: None + group: scheduling.kubefed.io names: - kind: Domain - listKind: DomainList - plural: domains - singular: domain + kind: ReplicaSchedulingPreference + listKind: ReplicaSchedulingPreferenceList + plural: replicaschedulingpreferences + shortNames: + - rsp + singular: replicaschedulingpreference scope: Namespaced - validation: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - domain: - description: Domain is the DNS zone associated with the KubeFed control - plane - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - nameServer: - description: NameServer is the authoritative DNS name server for the KubeFed - domain - type: string - required: - - domain - type: object - version: v1alpha1 versions: - name: v1alpha1 - served: true - storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] ---- - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - "helm.sh/hook": crd-install - creationTimestamp: null - name: ingressdnsrecords.multiclusterdns.kubefed.io -spec: - group: multiclusterdns.kubefed.io - names: - kind: IngressDNSRecord - listKind: IngressDNSRecordList - plural: ingressdnsrecords - singular: ingressdnsrecord - scope: Namespaced - #subresources: - # status: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: IngressDNSRecordSpec defines the desired state of IngressDNSRecord - properties: - hosts: - description: Host from the IngressRule in Cluster Ingress Spec - items: - type: string - type: array - recordTTL: - description: RecordTTL is the TTL in seconds for DNS records created - for the Ingress, if omitted a default would be used - format: int64 - type: integer - type: object - status: - description: IngressDNSRecordStatus defines the observed state of IngressDNSRecord - properties: - dns: - description: Array of Ingress Controller LoadBalancers - items: - description: ClusterIngressDNS defines the observed status of Ingress - within a cluster. - properties: - cluster: - description: Cluster name - type: string - loadBalancer: - description: LoadBalancer for the corresponding ingress controller - properties: - ingress: - description: Ingress is a list containing ingress points for - the load-balancer. Traffic intended for the service should - be sent to these ingress points. - items: - description: 'LoadBalancerIngress represents the status - of a load-balancer ingress point: traffic intended for - the service should be sent to an ingress point.' - properties: - hostname: - description: Hostname is set for load-balancer ingress - points that are DNS based (typically AWS load-balancers) - type: string - ip: - description: IP is set for load-balancer ingress points - that are IP based (typically GCE or OpenStack load-balancers) - type: string - type: object - type: array - type: object + schema: + openAPIV3Schema: + x-kubernetes-preserve-unknown-fields: true + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: ReplicaSchedulingPreferenceSpec defines the desired state + of ReplicaSchedulingPreference + properties: + clusters: + additionalProperties: + description: Preferences regarding number of replicas assigned to + a cluster workload object (dep, rs, ..) within a federated workload + object. + properties: + maxReplicas: + description: Maximum number of replicas that should be assigned + to this cluster workload object. Unbounded if no value provided + (default). + format: int64 + type: integer + minReplicas: + description: Minimum number of replicas that should be assigned + to this cluster workload object. 0 by default. + format: int64 + type: integer + weight: + description: A number expressing the preference to put an additional + replica to this cluster workload object. 0 by default. + format: int64 + type: integer + type: object + description: A mapping between cluster names and preferences regarding + a local workload object (dep, rs, .. ) in these clusters. "*" (if + provided) applies to all clusters if an explicit mapping is not + provided. If omitted, clusters without explicit preferences should + not have any replicas scheduled. type: object - type: array - type: object - type: object - version: v1alpha1 - versions: - - name: v1alpha1 + rebalance: + description: If set to true then already scheduled and running replicas + may be moved to other clusters in order to match current state to + the specified preferences. Otherwise, if set to false, up and running + replicas will not be moved. + type: boolean + targetKind: + description: TODO (@irfanurrehman); upgrade this to label selector + only if need be. The idea of this API is to have a a set of preferences + which can be used for a target FederatedDeployment or FederatedReplicaset. + Although the set of preferences in question can be applied to multiple + target objects using label selectors, but there are no clear advantages + of doing that as of now. To keep the implementation and usage simple, + matching ns/name of RSP resource to the target resource is sufficient + and only additional information needed in RSP resource is a target + kind (FederatedDeployment or FederatedReplicaset). + type: string + totalReplicas: + description: Total number of pods desired across federated clusters. + Replicas specified in the spec for target deployment template or + replicaset template will be discarded/overridden when scheduling + preferences are specified. + format: int32 + type: integer + required: + - targetKind + - totalReplicas + type: object + status: + description: ReplicaSchedulingPreferenceStatus defines the observed state + of ReplicaSchedulingPreference + type: object + type: object served: true storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] ---- - --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - annotations: - "helm.sh/hook": crd-install - creationTimestamp: null name: servicednsrecords.multiclusterdns.kubefed.io spec: + conversion: + strategy: None group: multiclusterdns.kubefed.io names: kind: ServiceDNSRecord @@ -963,233 +982,116 @@ spec: plural: servicednsrecords singular: servicednsrecord scope: Namespaced - #subresources: - # status: {} - validation: - openAPIV3Schema: - description: "ServiceDNSRecord defines a scheme of DNS name and subdomains that - should be programmed with endpoint information about a Service deployed in - multiple Kubernetes clusters. ServiceDNSRecord is name-associated with the - Services it programs endpoint information for, meaning that a ServiceDNSRecord - expresses the intent to program DNS with information about endpoints for the - Kubernetes Service resources with the same name and namespace in different - clusters. \n For the example, given the following values: \n metadata.name: - test-service metadata.namespace: test-namespace spec.federationName: test-federation - \n the following set of DNS names will be programmed: \n Global Level: test-service.test-namespace.test-federation.svc. - Region Level: test-service.test-namespace.test-federation.svc.(status.DNS[*].region). - Zone Level : test-service.test-namespace.test-federation.svc.(status.DNS[*].zone).(status.DNS[*].region). - \n Optionally, when DNSPrefix is specified, another DNS name will be programmed - which would be a CNAME record pointing to DNS name at global level as below: - . --> test-service.test-namespace.test-federation.svc." - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: ServiceDNSRecordSpec defines the desired state of ServiceDNSRecord. - properties: - allowServiceWithoutEndpoints: - description: AllowServiceWithoutEndpoints allows DNS records to be written - for Service shards without endpoints - type: boolean - dnsPrefix: - description: DNSPrefix when specified, an additional DNS record would - be created with . - type: string - domainRef: - description: DomainRef is the name of the domain object to which the - corresponding federated service belongs - type: string - externalName: - description: ExternalName when specified, replaces the service name - portion of a resource record with the value of ExternalName. - type: string - recordTTL: - description: RecordTTL is the TTL in seconds for DNS records created - for this Service, if omitted a default would be used - format: int64 - type: integer - required: - - domainRef - type: object - status: - description: ServiceDNSRecordStatus defines the observed state of ServiceDNSRecord. - properties: - dns: - items: - description: ClusterDNS defines the observed status of LoadBalancer - within a cluster. - properties: - cluster: - description: Cluster name - type: string - loadBalancer: - description: LoadBalancer for the corresponding service - properties: - ingress: - description: Ingress is a list containing ingress points for - the load-balancer. Traffic intended for the service should - be sent to these ingress points. - items: - description: 'LoadBalancerIngress represents the status - of a load-balancer ingress point: traffic intended for - the service should be sent to an ingress point.' - properties: - hostname: - description: Hostname is set for load-balancer ingress - points that are DNS based (typically AWS load-balancers) - type: string - ip: - description: IP is set for load-balancer ingress points - that are IP based (typically GCE or OpenStack load-balancers) - type: string - type: object - type: array - type: object - region: - description: Region to which the cluster belongs - type: string - zones: - description: Zones to which the cluster belongs - items: - type: string - type: array - type: object - type: array - domain: - description: Domain is the DNS domain of the KubeFed control plane as - in Domain API - type: string - type: object - type: object - version: v1alpha1 - versions: - - name: v1alpha1 - served: true - storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] ---- - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - "helm.sh/hook": crd-install - creationTimestamp: null - name: replicaschedulingpreferences.scheduling.kubefed.io -spec: - group: scheduling.kubefed.io - names: - kind: ReplicaSchedulingPreference - listKind: ReplicaSchedulingPreferenceList - plural: replicaschedulingpreferences - singular: replicaschedulingpreference - scope: Namespaced - validation: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: ReplicaSchedulingPreferenceSpec defines the desired state of - ReplicaSchedulingPreference - properties: - clusters: - additionalProperties: - description: Preferences regarding number of replicas assigned to - a cluster workload object (dep, rs, ..) within a federated workload - object. - properties: - maxReplicas: - description: Maximum number of replicas that should be assigned - to this cluster workload object. Unbounded if no value provided - (default). - format: int64 - type: integer - minReplicas: - description: Minimum number of replicas that should be assigned - to this cluster workload object. 0 by default. - format: int64 - type: integer - weight: - description: A number expressing the preference to put an additional - replica to this cluster workload object. 0 by default. - format: int64 - type: integer - type: object - description: A mapping between cluster names and preferences regarding - a local workload object (dep, rs, .. ) in these clusters. "*" (if - provided) applies to all clusters if an explicit mapping is not provided. - If omitted, clusters without explicit preferences should not have - any replicas scheduled. - type: object - rebalance: - description: If set to true then already scheduled and running replicas - may be moved to other clusters in order to match current state to - the specified preferences. Otherwise, if set to false, up and running - replicas will not be moved. - type: boolean - targetKind: - description: TODO (@irfanurrehman); upgrade this to label selector only - if need be. The idea of this API is to have a a set of preferences - which can be used for a target FederatedDeployment or FederatedReplicaset. - Although the set of preferences in question can be applied to multiple - target objects using label selectors, but there are no clear advantages - of doing that as of now. To keep the implementation and usage simple, - matching ns/name of RSP resource to the target resource is sufficient - and only additional information needed in RSP resource is a target - kind (FederatedDeployment or FederatedReplicaset). - type: string - totalReplicas: - description: Total number of pods desired across federated clusters. - Replicas specified in the spec for target deployment template or replicaset - template will be discarded/overridden when scheduling preferences - are specified. - format: int32 - type: integer - required: - - targetKind - - totalReplicas - type: object - status: - description: ReplicaSchedulingPreferenceStatus defines the observed state - of ReplicaSchedulingPreference - type: object - type: object - version: v1alpha1 versions: - name: v1alpha1 + schema: + openAPIV3Schema: + x-kubernetes-preserve-unknown-fields: true + description: "ServiceDNSRecord defines a scheme of DNS name and subdomains + that should be programmed with endpoint information about a Service deployed + in multiple Kubernetes clusters. ServiceDNSRecord is name-associated with + the Services it programs endpoint information for, meaning that a ServiceDNSRecord + expresses the intent to program DNS with information about endpoints for + the Kubernetes Service resources with the same name and namespace in different + clusters. \n For the example, given the following values: \n metadata.name: + test-service metadata.namespace: test-namespace spec.federationName: test-federation + \n the following set of DNS names will be programmed: \n Global Level: test-service.test-namespace.test-federation.svc. + Region Level: test-service.test-namespace.test-federation.svc.(status.DNS[*].region). + Zone Level : test-service.test-namespace.test-federation.svc.(status.DNS[*].zone).(status.DNS[*].region). + \n Optionally, when DNSPrefix is specified, another DNS name will be programmed + which would be a CNAME record pointing to DNS name at global level as below: + . --> test-service.test-namespace.test-federation.svc." + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: ServiceDNSRecordSpec defines the desired state of ServiceDNSRecord. + properties: + allowServiceWithoutEndpoints: + description: AllowServiceWithoutEndpoints allows DNS records to be + written for Service shards without endpoints + type: boolean + dnsPrefix: + description: DNSPrefix when specified, an additional DNS record would + be created with . + type: string + domainRef: + description: DomainRef is the name of the domain object to which the + corresponding federated service belongs + type: string + externalName: + description: ExternalName when specified, replaces the service name + portion of a resource record with the value of ExternalName. + type: string + recordTTL: + description: RecordTTL is the TTL in seconds for DNS records created + for this Service, if omitted a default would be used + format: int64 + type: integer + required: + - domainRef + type: object + status: + description: ServiceDNSRecordStatus defines the observed state of ServiceDNSRecord. + properties: + dns: + items: + description: ClusterDNS defines the observed status of LoadBalancer + within a cluster. + properties: + cluster: + description: Cluster name + type: string + loadBalancer: + description: LoadBalancer for the corresponding service + properties: + ingress: + description: Ingress is a list containing ingress points + for the load-balancer. Traffic intended for the service + should be sent to these ingress points. + items: + description: 'LoadBalancerIngress represents the status + of a load-balancer ingress point: traffic intended for + the service should be sent to an ingress point.' + properties: + hostname: + description: Hostname is set for load-balancer ingress + points that are DNS based (typically AWS load-balancers) + type: string + ip: + description: IP is set for load-balancer ingress points + that are IP based (typically GCE or OpenStack load-balancers) + type: string + type: object + type: array + type: object + region: + description: Region to which the cluster belongs + type: string + zones: + description: Zones to which the cluster belongs + items: + type: string + type: array + type: object + type: array + domain: + description: Domain is the DNS domain of the KubeFed control plane + as in Domain API + type: string + type: object + type: object served: true storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] ---- + subresources: + status: {} diff --git a/pkg/kubefedctl/enable/enable.go b/pkg/kubefedctl/enable/enable.go index eed2ad2834..e318d16b5e 100644 --- a/pkg/kubefedctl/enable/enable.go +++ b/pkg/kubefedctl/enable/enable.go @@ -26,8 +26,8 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" - apiextv1b1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - apiextv1b1client "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1" + apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + apiextv1client "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -187,7 +187,7 @@ func (j *enableType) Run(cmdOut io.Writer, config util.FedConfig) error { type typeResources struct { TypeConfig typeconfig.Interface - CRD *apiextv1b1.CustomResourceDefinition + CRD *apiextv1.CustomResourceDefinition } func GetResources(config *rest.Config, enableTypeDirective *EnableTypeDirective) (*typeResources, error) { @@ -263,7 +263,7 @@ func CreateResources(cmdOut io.Writer, config *rest.Config, resources *typeResou } } - crdClient, err := apiextv1b1client.NewForConfig(config) + crdClient, err := apiextv1client.NewForConfig(config) if err != nil { return errors.Wrap(err, "Failed to create crd clientset") } @@ -395,7 +395,7 @@ func qualifiedAPIResourceName(resource metav1.APIResource) string { return fmt.Sprintf("%s.%s/%s", resource.Name, resource.Group, resource.Version) } -func federatedTypeCRD(typeConfig typeconfig.Interface, accessor schemaAccessor, shortNames []string) *apiextv1b1.CustomResourceDefinition { +func federatedTypeCRD(typeConfig typeconfig.Interface, accessor schemaAccessor, shortNames []string) *apiextv1.CustomResourceDefinition { templateSchema := accessor.templateSchema() schema := federatedTypeValidationSchema(templateSchema) return CrdForAPIResource(typeConfig.GetFederatedType(), schema, shortNames) diff --git a/pkg/kubefedctl/enable/schema.go b/pkg/kubefedctl/enable/schema.go index 172b3ff90e..ff9a3c95db 100644 --- a/pkg/kubefedctl/enable/schema.go +++ b/pkg/kubefedctl/enable/schema.go @@ -22,8 +22,8 @@ import ( "github.com/pkg/errors" - apiextv1b1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - apiextv1b1client "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1" + apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + apiextv1client "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" @@ -34,7 +34,7 @@ import ( ) type schemaAccessor interface { - templateSchema() map[string]apiextv1b1.JSONSchemaProps + templateSchema() map[string]apiextv1.JSONSchemaProps } func newSchemaAccessor(config *rest.Config, apiResource metav1.APIResource) (schemaAccessor, error) { @@ -50,7 +50,7 @@ func newSchemaAccessor(config *rest.Config, apiResource metav1.APIResource) (sch } type crdSchemaAccessor struct { - validation *apiextv1b1.CustomResourceValidation + validation *apiextv1.CustomResourceValidation } func newCRDSchemaAccessor(config *rest.Config, apiResource metav1.APIResource) (schemaAccessor, error) { @@ -59,7 +59,7 @@ func newCRDSchemaAccessor(config *rest.Config, apiResource metav1.APIResource) ( return nil, nil } // Check whether the target resource is a crd - crdClient, err := apiextv1b1client.NewForConfig(config) + crdClient, err := apiextv1client.NewForConfig(config) if err != nil { return nil, errors.Wrap(err, "Failed to create crd clientset") } @@ -71,10 +71,10 @@ func newCRDSchemaAccessor(config *rest.Config, apiResource metav1.APIResource) ( if err != nil { return nil, errors.Wrapf(err, "Error attempting retrieval of crd %q", crdName) } - return &crdSchemaAccessor{validation: crd.Spec.Validation}, nil + return &crdSchemaAccessor{validation: crd.Spec.Versions[0].Schema}, nil } -func (a *crdSchemaAccessor) templateSchema() map[string]apiextv1b1.JSONSchemaProps { +func (a *crdSchemaAccessor) templateSchema() map[string]apiextv1.JSONSchemaProps { if a.validation != nil && a.validation.OpenAPIV3Schema != nil { return a.validation.OpenAPIV3Schema.Properties } @@ -108,10 +108,10 @@ func newOpenAPISchemaAccessor(config *rest.Config, apiResource metav1.APIResourc }, nil } -func (a *openAPISchemaAccessor) templateSchema() map[string]apiextv1b1.JSONSchemaProps { - var templateSchema *apiextv1b1.JSONSchemaProps +func (a *openAPISchemaAccessor) templateSchema() map[string]apiextv1.JSONSchemaProps { + var templateSchema *apiextv1.JSONSchemaProps visitor := &jsonSchemaVistor{ - collect: func(schema apiextv1b1.JSONSchemaProps) { + collect: func(schema apiextv1.JSONSchemaProps) { templateSchema = &schema }, } @@ -127,16 +127,16 @@ func (a *openAPISchemaAccessor) templateSchema() map[string]apiextv1b1.JSONSchem // TODO(marun) Generate more extensive schema if/when openapi schema // provides more detail as per https://github.com/ant31/crd-validation type jsonSchemaVistor struct { - collect func(schema apiextv1b1.JSONSchemaProps) + collect func(schema apiextv1.JSONSchemaProps) } func (v *jsonSchemaVistor) VisitArray(a *proto.Array) { - arraySchema := apiextv1b1.JSONSchemaProps{ + arraySchema := apiextv1.JSONSchemaProps{ Type: "array", - Items: &apiextv1b1.JSONSchemaPropsOrArray{}, + Items: &apiextv1.JSONSchemaPropsOrArray{}, } localVisitor := &jsonSchemaVistor{ - collect: func(schema apiextv1b1.JSONSchemaProps) { + collect: func(schema apiextv1.JSONSchemaProps) { arraySchema.Items.Schema = &schema }, } @@ -145,14 +145,14 @@ func (v *jsonSchemaVistor) VisitArray(a *proto.Array) { } func (v *jsonSchemaVistor) VisitMap(m *proto.Map) { - mapSchema := apiextv1b1.JSONSchemaProps{ + mapSchema := apiextv1.JSONSchemaProps{ Type: "object", - AdditionalProperties: &apiextv1b1.JSONSchemaPropsOrBool{ + AdditionalProperties: &apiextv1.JSONSchemaPropsOrBool{ Allows: true, }, } localVisitor := &jsonSchemaVistor{ - collect: func(schema apiextv1b1.JSONSchemaProps) { + collect: func(schema apiextv1.JSONSchemaProps) { mapSchema.AdditionalProperties.Schema = &schema }, } @@ -166,9 +166,9 @@ func (v *jsonSchemaVistor) VisitPrimitive(p *proto.Primitive) { } func (v *jsonSchemaVistor) VisitKind(k *proto.Kind) { - kindSchema := apiextv1b1.JSONSchemaProps{ + kindSchema := apiextv1.JSONSchemaProps{ Type: "object", - Properties: make(map[string]apiextv1b1.JSONSchemaProps), + Properties: make(map[string]apiextv1.JSONSchemaProps), Required: k.RequiredFields, } for key, fieldSchema := range k.Fields { @@ -177,7 +177,7 @@ func (v *jsonSchemaVistor) VisitKind(k *proto.Kind) { continue } localVisitor := &jsonSchemaVistor{ - collect: func(schema apiextv1b1.JSONSchemaProps) { + collect: func(schema apiextv1.JSONSchemaProps) { kindSchema.Properties[key] = schema }, } @@ -192,18 +192,18 @@ func (v *jsonSchemaVistor) VisitReference(r proto.Reference) { // TODO(marun) Implement proper support for recursive schema if r.Reference() == "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaProps" || r.Reference() == "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps" { - v.collect(apiextv1b1.JSONSchemaProps{Type: "object"}) + v.collect(apiextv1.JSONSchemaProps{Type: "object"}) return } r.SubSchema().Accept(v) } -func schemaForPrimitive(p *proto.Primitive) apiextv1b1.JSONSchemaProps { - schema := apiextv1b1.JSONSchemaProps{} +func schemaForPrimitive(p *proto.Primitive) apiextv1.JSONSchemaProps { + schema := apiextv1.JSONSchemaProps{} if p.Format == "int-or-string" { - schema.AnyOf = []apiextv1b1.JSONSchemaProps{ + schema.AnyOf = []apiextv1.JSONSchemaProps{ { Type: "integer", Format: "int32", diff --git a/pkg/kubefedctl/enable/util.go b/pkg/kubefedctl/enable/util.go index 66307acc9f..3ce0a71f32 100644 --- a/pkg/kubefedctl/enable/util.go +++ b/pkg/kubefedctl/enable/util.go @@ -24,7 +24,7 @@ import ( "github.com/pkg/errors" - apiextv1b1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/yaml" @@ -50,34 +50,40 @@ func DecodeYAML(r io.Reader, obj interface{}) error { return decoder.Decode(obj) } -func CrdForAPIResource(apiResource metav1.APIResource, validation *apiextv1b1.CustomResourceValidation, shortNames []string) *apiextv1b1.CustomResourceDefinition { - scope := apiextv1b1.ClusterScoped +func CrdForAPIResource(apiResource metav1.APIResource, validation *apiextv1.CustomResourceValidation, shortNames []string) *apiextv1.CustomResourceDefinition { + scope := apiextv1.ClusterScoped if apiResource.Namespaced { - scope = apiextv1b1.NamespaceScoped + scope = apiextv1.NamespaceScoped } - return &apiextv1b1.CustomResourceDefinition{ + return &apiextv1.CustomResourceDefinition{ // Explicitly including TypeMeta will ensure it will be // serialized properly to yaml. TypeMeta: metav1.TypeMeta{ Kind: "CustomResourceDefinition", - APIVersion: "apiextensions.k8s.io/v1beta1", + APIVersion: "apiextensions.k8s.io/v1", }, ObjectMeta: metav1.ObjectMeta{ Name: typeconfig.GroupQualifiedName(apiResource), }, - Spec: apiextv1b1.CustomResourceDefinitionSpec{ - Group: apiResource.Group, - Version: apiResource.Version, - Scope: scope, - Names: apiextv1b1.CustomResourceDefinitionNames{ + Spec: apiextv1.CustomResourceDefinitionSpec{ + Group: apiResource.Group, + Versions: []apiextv1.CustomResourceDefinitionVersion{ + { + Name: apiResource.Version, + Schema: validation, + Subresources: &apiextv1.CustomResourceSubresources{ + Status: &apiextv1.CustomResourceSubresourceStatus{}, + }, + Served: true, + Storage: true, + }, + }, + Scope: scope, + Names: apiextv1.CustomResourceDefinitionNames{ Plural: apiResource.Name, Kind: apiResource.Kind, ShortNames: shortNames, }, - Validation: validation, - Subresources: &apiextv1b1.CustomResourceSubresources{ - Status: &apiextv1b1.CustomResourceSubresourceStatus{}, - }, }, } } @@ -160,21 +166,21 @@ func GetServerPreferredResources(config *rest.Config) ([]*metav1.APIResourceList return resourceLists, nil } -func NamespacedToScope(apiResource metav1.APIResource) apiextv1b1.ResourceScope { +func NamespacedToScope(apiResource metav1.APIResource) apiextv1.ResourceScope { if apiResource.Namespaced { - return apiextv1b1.NamespaceScoped + return apiextv1.NamespaceScoped } - return apiextv1b1.ClusterScoped + return apiextv1.ClusterScoped } -func FederatedNamespacedToScope(apiResource metav1.APIResource) apiextv1b1.ResourceScope { +func FederatedNamespacedToScope(apiResource metav1.APIResource) apiextv1.ResourceScope { // Special-case the scope of federated namespace since it will // hopefully be the only instance of the scope of a federated // type differing from the scope of its target. if typeconfig.GroupQualifiedName(apiResource) == common.NamespaceName { // FederatedNamespace is namespaced to allow the control plane to run // with only namespace-scoped permissions e.g. to determine placement. - return apiextv1b1.NamespaceScoped + return apiextv1.NamespaceScoped } return NamespacedToScope(apiResource) } diff --git a/pkg/kubefedctl/enable/validation.go b/pkg/kubefedctl/enable/validation.go index 2d0743f957..7c97b11aca 100644 --- a/pkg/kubefedctl/enable/validation.go +++ b/pkg/kubefedctl/enable/validation.go @@ -17,28 +17,29 @@ limitations under the License. package enable import ( - v1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + "k8s.io/utils/pointer" "sigs.k8s.io/kubefed/pkg/controller/util" ) -func federatedTypeValidationSchema(templateSchema map[string]v1beta1.JSONSchemaProps) *v1beta1.CustomResourceValidation { - schema := ValidationSchema(v1beta1.JSONSchemaProps{ +func federatedTypeValidationSchema(templateSchema map[string]v1.JSONSchemaProps) *v1.CustomResourceValidation { + schema := ValidationSchema(v1.JSONSchemaProps{ Type: "object", - Properties: map[string]v1beta1.JSONSchemaProps{ + Properties: map[string]v1.JSONSchemaProps{ "placement": { Type: "object", - Properties: map[string]v1beta1.JSONSchemaProps{ + Properties: map[string]v1.JSONSchemaProps{ // References to one or more clusters allow a // scheduling mechanism to explicitly indicate // placement. If one or more clusters is provided, // the clusterSelector field will be ignored. "clusters": { Type: "array", - Items: &v1beta1.JSONSchemaPropsOrArray{ - Schema: &v1beta1.JSONSchemaProps{ + Items: &v1.JSONSchemaPropsOrArray{ + Schema: &v1.JSONSchemaProps{ Type: "object", - Properties: map[string]v1beta1.JSONSchemaProps{ + Properties: map[string]v1.JSONSchemaProps{ "name": { Type: "string", }, @@ -51,13 +52,13 @@ func federatedTypeValidationSchema(templateSchema map[string]v1beta1.JSONSchemaP }, "clusterSelector": { Type: "object", - Properties: map[string]v1beta1.JSONSchemaProps{ + Properties: map[string]v1.JSONSchemaProps{ "matchExpressions": { Type: "array", - Items: &v1beta1.JSONSchemaPropsOrArray{ - Schema: &v1beta1.JSONSchemaProps{ + Items: &v1.JSONSchemaPropsOrArray{ + Schema: &v1.JSONSchemaProps{ Type: "object", - Properties: map[string]v1beta1.JSONSchemaProps{ + Properties: map[string]v1.JSONSchemaProps{ "key": { Type: "string", }, @@ -66,8 +67,8 @@ func federatedTypeValidationSchema(templateSchema map[string]v1beta1.JSONSchemaP }, "values": { Type: "array", - Items: &v1beta1.JSONSchemaPropsOrArray{ - Schema: &v1beta1.JSONSchemaProps{ + Items: &v1.JSONSchemaPropsOrArray{ + Schema: &v1.JSONSchemaProps{ Type: "string", }, }, @@ -82,8 +83,8 @@ func federatedTypeValidationSchema(templateSchema map[string]v1beta1.JSONSchemaP }, "matchLabels": { Type: "object", - AdditionalProperties: &v1beta1.JSONSchemaPropsOrBool{ - Schema: &v1beta1.JSONSchemaProps{ + AdditionalProperties: &v1.JSONSchemaPropsOrBool{ + Schema: &v1.JSONSchemaProps{ Type: "string", }, }, @@ -94,19 +95,19 @@ func federatedTypeValidationSchema(templateSchema map[string]v1beta1.JSONSchemaP }, "overrides": { Type: "array", - Items: &v1beta1.JSONSchemaPropsOrArray{ - Schema: &v1beta1.JSONSchemaProps{ + Items: &v1.JSONSchemaPropsOrArray{ + Schema: &v1.JSONSchemaProps{ Type: "object", - Properties: map[string]v1beta1.JSONSchemaProps{ + Properties: map[string]v1.JSONSchemaProps{ "clusterName": { Type: "string", }, "clusterOverrides": { Type: "array", - Items: &v1beta1.JSONSchemaPropsOrArray{ - Schema: &v1beta1.JSONSchemaProps{ + Items: &v1.JSONSchemaPropsOrArray{ + Schema: &v1.JSONSchemaProps{ Type: "object", - Properties: map[string]v1beta1.JSONSchemaProps{ + Properties: map[string]v1.JSONSchemaProps{ "op": { Type: "string", Pattern: "^(add|remove|replace)?$", @@ -115,27 +116,7 @@ func federatedTypeValidationSchema(templateSchema map[string]v1beta1.JSONSchemaP Type: "string", }, "value": { - // Supporting the override of an arbitrary field - // precludes up-front validation. Errors in - // the definition of override values will need to - // be caught during propagation. - AnyOf: []v1beta1.JSONSchemaProps{ - { - Type: "string", - }, - { - Type: "integer", - }, - { - Type: "boolean", - }, - { - Type: "object", - }, - { - Type: "array", - }, - }, + XPreserveUnknownFields: pointer.BoolPtr(true), }, }, Required: []string{ @@ -152,8 +133,9 @@ func federatedTypeValidationSchema(templateSchema map[string]v1beta1.JSONSchemaP }) if templateSchema != nil { specProperties := schema.OpenAPIV3Schema.Properties["spec"].Properties - specProperties["template"] = v1beta1.JSONSchemaProps{ - Type: "object", + specProperties["template"] = v1.JSONSchemaProps{ + XPreserveUnknownFields: pointer.BoolPtr(true), + Type: "object", } // Add retainReplicas field to types that exposes a replicas // field that could be targeted by HPA. @@ -161,7 +143,7 @@ func federatedTypeValidationSchema(templateSchema map[string]v1beta1.JSONSchemaP // TODO: find a simpler way to detect that a resource is scalable than having to compute the entire schema. if replicasField, ok := templateSpec.Properties["replicas"]; ok { if replicasField.Type == "integer" && replicasField.Format == "int32" { - specProperties[util.RetainReplicasField] = v1beta1.JSONSchemaProps{ + specProperties[util.RetainReplicasField] = v1.JSONSchemaProps{ Type: "boolean", } } @@ -171,10 +153,11 @@ func federatedTypeValidationSchema(templateSchema map[string]v1beta1.JSONSchemaP return schema } -func ValidationSchema(specProps v1beta1.JSONSchemaProps) *v1beta1.CustomResourceValidation { - return &v1beta1.CustomResourceValidation{ - OpenAPIV3Schema: &v1beta1.JSONSchemaProps{ - Properties: map[string]v1beta1.JSONSchemaProps{ +func ValidationSchema(specProps v1.JSONSchemaProps) *v1.CustomResourceValidation { + return &v1.CustomResourceValidation{ + OpenAPIV3Schema: &v1.JSONSchemaProps{ + Type: "object", + Properties: map[string]v1.JSONSchemaProps{ "apiVersion": { Type: "string", }, @@ -188,13 +171,13 @@ func ValidationSchema(specProps v1beta1.JSONSchemaProps) *v1beta1.CustomResource "spec": specProps, "status": { Type: "object", - Properties: map[string]v1beta1.JSONSchemaProps{ + Properties: map[string]v1.JSONSchemaProps{ "conditions": { Type: "array", - Items: &v1beta1.JSONSchemaPropsOrArray{ - Schema: &v1beta1.JSONSchemaProps{ + Items: &v1.JSONSchemaPropsOrArray{ + Schema: &v1.JSONSchemaProps{ Type: "object", - Properties: map[string]v1beta1.JSONSchemaProps{ + Properties: map[string]v1.JSONSchemaProps{ "type": { Type: "string", }, @@ -222,10 +205,10 @@ func ValidationSchema(specProps v1beta1.JSONSchemaProps) *v1beta1.CustomResource }, "clusters": { Type: "array", - Items: &v1beta1.JSONSchemaPropsOrArray{ - Schema: &v1beta1.JSONSchemaProps{ + Items: &v1.JSONSchemaPropsOrArray{ + Schema: &v1.JSONSchemaProps{ Type: "object", - Properties: map[string]v1beta1.JSONSchemaProps{ + Properties: map[string]v1.JSONSchemaProps{ "name": { Type: "string", }, diff --git a/pkg/kubefedctl/join.go b/pkg/kubefedctl/join.go index c11c72c3c9..b839b909f6 100644 --- a/pkg/kubefedctl/join.go +++ b/pkg/kubefedctl/join.go @@ -30,7 +30,7 @@ import ( "github.com/spf13/pflag" corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" - apiextv1b1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" @@ -93,7 +93,7 @@ type joinFederation struct { type joinFederationOptions struct { secretName string - scope apiextv1b1.ResourceScope + scope apiextv1.ResourceScope errorOnExisting bool } @@ -206,7 +206,7 @@ func (j *joinFederation) Run(cmdOut io.Writer, config util.FedConfig) error { // host cluster. func JoinCluster(hostConfig, clusterConfig *rest.Config, kubefedNamespace, hostClusterName, joiningClusterName, secretName string, - scope apiextv1b1.ResourceScope, dryRun, errorOnExisting bool) (*fedv1b1.KubeFedCluster, error) { + scope apiextv1.ResourceScope, dryRun, errorOnExisting bool) (*fedv1b1.KubeFedCluster, error) { return joinClusterForNamespace(hostConfig, clusterConfig, kubefedNamespace, kubefedNamespace, hostClusterName, joiningClusterName, secretName, scope, dryRun, errorOnExisting) @@ -217,7 +217,7 @@ func JoinCluster(hostConfig, clusterConfig *rest.Config, kubefedNamespace, // the joiningNamespace parameter. func joinClusterForNamespace(hostConfig, clusterConfig *rest.Config, kubefedNamespace, joiningNamespace, hostClusterName, joiningClusterName, secretName string, - scope apiextv1b1.ResourceScope, dryRun, errorOnExisting bool) (*fedv1b1.KubeFedCluster, error) { + scope apiextv1.ResourceScope, dryRun, errorOnExisting bool) (*fedv1b1.KubeFedCluster, error) { start := time.Now() hostClientset, err := util.HostClientset(hostConfig) @@ -404,7 +404,7 @@ func createKubeFedNamespace(clusterClientset kubeclient.Interface, kubefedNamesp // account is returned on success. func createAuthorizedServiceAccount(joiningClusterClientset kubeclient.Interface, namespace, joiningClusterName, hostClusterName string, - scope apiextv1b1.ResourceScope, dryRun, errorOnExisting bool) (string, error) { + scope apiextv1.ResourceScope, dryRun, errorOnExisting bool) (string, error) { klog.V(2).Infof("Creating service account in joining cluster: %s", joiningClusterName) saName, err := createServiceAccount(joiningClusterClientset, namespace, @@ -417,7 +417,7 @@ func createAuthorizedServiceAccount(joiningClusterClientset kubeclient.Interface klog.V(2).Infof("Created service account: %s in joining cluster: %s", saName, joiningClusterName) - if scope == apiextv1b1.NamespaceScoped { + if scope == apiextv1.NamespaceScoped { klog.V(2).Infof("Creating role and binding for service account: %s in joining cluster: %s", saName, joiningClusterName) err = createRoleAndBinding(joiningClusterClientset, saName, namespace, joiningClusterName, dryRun, errorOnExisting) diff --git a/pkg/kubefedctl/options/options.go b/pkg/kubefedctl/options/options.go index 41306bfbb1..509708e3e6 100644 --- a/pkg/kubefedctl/options/options.go +++ b/pkg/kubefedctl/options/options.go @@ -22,7 +22,7 @@ import ( "github.com/pkg/errors" "github.com/spf13/pflag" - apiextv1b1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" @@ -101,7 +101,7 @@ func (o *CommonJoinOptions) SetName(args []string) error { return nil } -func GetScopeFromKubeFedConfig(hostConfig *rest.Config, namespace string) (apiextv1b1.ResourceScope, error) { +func GetScopeFromKubeFedConfig(hostConfig *rest.Config, namespace string) (apiextv1.ResourceScope, error) { client, err := genericclient.New(hostConfig) if err != nil { err = errors.Wrap(err, "Failed to get kubefed clientset") diff --git a/scripts/sync-up-helm-chart.sh b/scripts/sync-up-helm-chart.sh index 5e93b59164..490c44a952 100755 --- a/scripts/sync-up-helm-chart.sh +++ b/scripts/sync-up-helm-chart.sh @@ -95,7 +95,7 @@ for filename in ./config/enabletypedirectives/*.yaml; do $SED -i '$d' ${CHART_FEDERATED_PROPAGATION_DIR}/templates/federatedtypeconfig.yaml echo "---" >> ${CHART_FEDERATED_PROPAGATION_DIR}/crds/crds.yaml - $SED -n '/^apiVersion: apiextensions.k8s.io\/v1beta1/,$p' ${full_name} >> ${CHART_FEDERATED_PROPAGATION_DIR}/crds/crds.yaml + $SED -n '/^apiVersion: apiextensions.k8s.io\/v1/,$p' ${full_name} >> ${CHART_FEDERATED_PROPAGATION_DIR}/crds/crds.yaml rm ${full_name} done diff --git a/test/common/validation.go b/test/common/validation.go index 834c4d687d..41dcf66f42 100644 --- a/test/common/validation.go +++ b/test/common/validation.go @@ -20,7 +20,7 @@ import ( "time" corev1 "k8s.io/api/core/v1" - apiextv1b1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/kubefed/pkg/apis/core/common" @@ -115,7 +115,7 @@ func ValidKubeFedConfig() *v1beta1.KubeFedConfig { Name: util.KubeFedConfigName, }, Spec: v1beta1.KubeFedConfigSpec{ - Scope: apiextv1b1.ClusterScoped, + Scope: apiextv1.ClusterScoped, }, } diff --git a/test/e2e/crd.go b/test/e2e/crd.go index 3ee0856ca5..38d7c8c8d0 100644 --- a/test/e2e/crd.go +++ b/test/e2e/crd.go @@ -24,8 +24,8 @@ import ( "github.com/pborman/uuid" "github.com/pkg/errors" - apiextv1b1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - apiextv1b1client "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1" + apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + apiextv1client "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -93,11 +93,16 @@ func validateCrdCrud(f framework.KubeFedFramework, targetCrdKind string, namespa Namespaced: namespaced, } - validationSchema := kfenable.ValidationSchema(apiextv1b1.JSONSchemaProps{ + validationSchema := kfenable.ValidationSchema(apiextv1.JSONSchemaProps{ Type: "object", - Properties: map[string]apiextv1b1.JSONSchemaProps{ + Properties: map[string]apiextv1.JSONSchemaProps{ "bar": { Type: "array", + Items: &apiextv1.JSONSchemaPropsOrArray{ + Schema: &apiextv1.JSONSchemaProps{ + Type: "string", + }, + }, }, }, }) @@ -112,7 +117,7 @@ func validateCrdCrud(f framework.KubeFedFramework, targetCrdKind string, namespa var hostConfig *rest.Config for clusterName, clusterConfig := range clusterConfigs { configs = append(configs, clusterConfig.Config) - crdClient := apiextv1b1client.NewForConfigOrDie(clusterConfig.Config) + crdClient := apiextv1client.NewForConfigOrDie(clusterConfig.Config) if clusterConfig.IsPrimary { hostConfig = clusterConfig.Config createCrdForHost(tl, crdClient, targetCrd) @@ -246,11 +251,11 @@ func waitForCrd(config *rest.Config, tl common.TestLogger, apiResource metav1.AP } } -func createCrdForHost(tl common.TestLogger, client *apiextv1b1client.ApiextensionsV1beta1Client, crd *apiextv1b1.CustomResourceDefinition) { +func createCrdForHost(tl common.TestLogger, client *apiextv1client.ApiextensionsV1Client, crd *apiextv1.CustomResourceDefinition) { createCrd(tl, client, crd, "") } -func createCrd(tl common.TestLogger, client *apiextv1b1client.ApiextensionsV1beta1Client, crd *apiextv1b1.CustomResourceDefinition, clusterName string) { +func createCrd(tl common.TestLogger, client *apiextv1client.ApiextensionsV1Client, crd *apiextv1.CustomResourceDefinition, clusterName string) { createdCrd, err := client.CustomResourceDefinitions().Create(context.Background(), crd, metav1.CreateOptions{}) if err != nil { tl.Fatalf("Error creating crd %s in %s: %v", crd.Name, clusterMsg(clusterName), err) @@ -258,7 +263,7 @@ func createCrd(tl common.TestLogger, client *apiextv1b1client.ApiextensionsV1bet ensureCRDRemoval(tl, client, createdCrd.Name, clusterName) } -func ensureCRDRemoval(tl common.TestLogger, client *apiextv1b1client.ApiextensionsV1beta1Client, crdName, clusterName string) { +func ensureCRDRemoval(tl common.TestLogger, client *apiextv1client.ApiextensionsV1Client, crdName, clusterName string) { framework.AddCleanupAction(func() { err := client.CustomResourceDefinitions().Delete(context.Background(), crdName, metav1.DeleteOptions{}) if err != nil { diff --git a/test/e2e/defaulting.go b/test/e2e/defaulting.go index 7937ea2a1b..dff779cc57 100644 --- a/test/e2e/defaulting.go +++ b/test/e2e/defaulting.go @@ -21,7 +21,7 @@ import ( "fmt" "time" - apiextv1b1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" pkgruntime "k8s.io/apimachinery/pkg/runtime" @@ -95,7 +95,7 @@ var _ = Describe("Default", func() { Duration: defaults.DefaultClusterHealthCheckPeriod + 11*time.Second, }, }, - Scope: apiextv1b1.ClusterScoped, // Required + Scope: apiextv1.ClusterScoped, // Required }, } } diff --git a/test/e2e/ftccontroller.go b/test/e2e/ftccontroller.go index b9b019cea0..84a1959c57 100644 --- a/test/e2e/ftccontroller.go +++ b/test/e2e/ftccontroller.go @@ -22,8 +22,8 @@ import ( . "github.com/onsi/ginkgo" //nolint:stylecheck "github.com/pborman/uuid" - apiextv1b1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - apiextv1b1client "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1" + apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + apiextv1client "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/rest" @@ -69,9 +69,9 @@ var _ = Describe("FTC controller", func() { Namespaced: true, } targetCrd := kfenable.CrdForAPIResource(targetAPIResource, nil, nil) - crdClient := apiextv1b1client.NewForConfigOrDie(f.KubeConfig()) + crdClient := apiextv1client.NewForConfigOrDie(f.KubeConfig()) - targetCrd.Spec.Version = "v1" + targetCrd.Spec.Versions[0].Name = "v1" createCrdForHost(f.Logger(), crdClient, targetCrd) waitForTargetCrd(f.Logger(), f.KubeConfig(), targetAPIResource.Name, "v1") @@ -88,8 +88,8 @@ var _ = Describe("FTC controller", func() { if err != nil { tl.Fatalf("Error retrieving target CRD %q: %v", objectMeta.Name, err) } - existingCrd.Spec.Version = "v2" - existingCrd.Spec.Versions = []apiextv1b1.CustomResourceDefinitionVersion{ + existingCrd.Spec.Versions[0].Name = "v2" + existingCrd.Spec.Versions = []apiextv1.CustomResourceDefinitionVersion{ { Name: "v2", Served: true, @@ -103,7 +103,7 @@ var _ = Describe("FTC controller", func() { } _, err = crdClient.CustomResourceDefinitions().Update(context.Background(), existingCrd, metav1.UpdateOptions{}) if err != nil { - tl.Fatalf("Error updating target CRD version %q: %v", existingCrd.Spec.Version, err) + tl.Fatalf("Error updating target CRD version %q: %v", existingCrd.Spec.Versions[0].Name, err) } waitForTargetCrd(f.Logger(), f.KubeConfig(), targetAPIResource.Name, "v2") diff --git a/test/e2e/scale.go b/test/e2e/scale.go index 6025b1ef5c..53dc892553 100644 --- a/test/e2e/scale.go +++ b/test/e2e/scale.go @@ -21,7 +21,7 @@ import ( "fmt" "strings" - apiextv1b1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/client-go/rest" @@ -101,7 +101,7 @@ var _ = Describe("Simulated Scale", func() { _, err := kubefedctl.TestOnlyJoinClusterForNamespace( hostConfig, hostConfig, hostNamespace, joiningNamespace, hostCluster, memberCluster, - "", apiextv1b1.NamespaceScoped, false, false) + "", apiextv1.NamespaceScoped, false, false) defer func() { framework.DeleteNamespace(client, joiningNamespace)