diff --git a/Makefile b/Makefile index 90b56ce..0dd061e 100644 --- a/Makefile +++ b/Makefile @@ -135,7 +135,7 @@ docker-push: ## Push docker image with the manager. docker push ${IMG} .PHONY: ko-build-local-cmupdate -ko-build-local-cmupdate: test +ko-build-local-cmupdate: test ko build --local --push=false -B ./cmd/cmupdate -t ${LATEST_TAG} --platform linux/${ARCH} .PHONY: kind-load-cmupdate-image @@ -144,7 +144,7 @@ kind-load-cmupdate-image: .PHONY: ko-build-push-cmupdate ko-build-push-cmupdate: test ## Build and push container image with ko - KO_DOCKER_REPO=${CONTAINER_REGISTRY} ko build -B ./cmd/cmupdate -t ${LATEST_TAG},latest --platform linux/amd64,linux/arm64 + KO_DOCKER_REPO=${CONTAINER_REGISTRY} ko build -B ./cmd/cmupdate -t ${LATEST_TAG},latest --platform linux/amd64,linux/arm64 # PLATFORMS defines the target platforms for the manager image be build to provide support to multiple # architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to: @@ -192,7 +192,8 @@ chart: manifests kustomize $(KUSTOMIZE) build config/default > chart/templates/operator.yaml @cat config/samples/postcreate-hooks/openshift-crds.yaml > /tmp/hooks.yaml @kubectl create secret generic postcreate-hooks --from-file=/tmp/hooks.yaml --dry-run=client --output=yaml > chart/templates/builtin-hooks.yaml - + @mkdir -p chart/crds + $(KUSTOMIZE) build config/crd > chart/crds/crds.yaml ##@ Build Dependencies diff --git a/chart/crds/crds.yaml b/chart/crds/crds.yaml new file mode 100644 index 0000000..debdef1 --- /dev/null +++ b/chart/crds/crds.yaml @@ -0,0 +1,266 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.3 + creationTimestamp: null + name: controlplanes.tenancy.kflex.kubestellar.org +spec: + group: tenancy.kflex.kubestellar.org + names: + kind: ControlPlane + listKind: ControlPlaneList + plural: controlplanes + shortNames: + - cp + - cps + singular: controlplane + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .spec.type + name: TYPE + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: ControlPlane is the Schema for the controlplanes API + 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: ControlPlaneSpec defines the desired state of ControlPlane + properties: + backend: + enum: + - shared + - dedicated + type: string + postCreateHook: + type: string + postCreateHookVars: + additionalProperties: + type: string + type: object + type: + enum: + - k8s + - ocm + - vcluster + - host + type: string + type: object + status: + description: ControlPlaneStatus defines the observed state of ControlPlane + properties: + conditions: + items: + description: ControlPlaneCondition describes the state of a control + plane at a certain point. + properties: + lastTransitionTime: + format: date-time + type: string + lastUpdateTime: + format: date-time + type: string + message: + type: string + reason: + type: string + status: + type: string + type: + type: string + required: + - lastTransitionTime + - lastUpdateTime + - message + - reason + - status + - type + type: object + type: array + observedGeneration: + format: int64 + type: integer + postCreateHooks: + additionalProperties: + type: boolean + type: object + secretRef: + description: SecretRef contains a referece to the secret containing + the Kubeconfig for the control plane + properties: + inClusterKey: + description: Required + type: string + key: + description: Required + type: string + name: + description: '`name` is the name of the secret. Required' + type: string + namespace: + description: '`namespace` is the namespace of the secret. Required' + type: string + required: + - inClusterKey + - key + - name + - namespace + type: object + required: + - conditions + - observedGeneration + type: object + type: object + served: true + storage: true + subresources: + status: {} +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.3 + creationTimestamp: null + name: postcreatehooks.tenancy.kflex.kubestellar.org +spec: + group: tenancy.kflex.kubestellar.org + names: + kind: PostCreateHook + listKind: PostCreateHookList + plural: postcreatehooks + shortNames: + - pch + - pchs + singular: postcreatehook + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .spec.type + name: TYPE + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: PostCreateHook is the Schema for the controlplanes API + 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: PostCreateHookSpec defines the desired state of PostCreateHook + properties: + templates: + items: + description: Manifest represents a resource to be deployed + type: object + x-kubernetes-embedded-resource: true + x-kubernetes-preserve-unknown-fields: true + type: array + type: object + status: + description: PostCreateHookStatus defines the observed state of PostCreateHook + properties: + conditions: + items: + description: ControlPlaneCondition describes the state of a control + plane at a certain point. + properties: + lastTransitionTime: + format: date-time + type: string + lastUpdateTime: + format: date-time + type: string + message: + type: string + reason: + type: string + status: + type: string + type: + type: string + required: + - lastTransitionTime + - lastUpdateTime + - message + - reason + - status + - type + type: object + type: array + observedGeneration: + format: int64 + type: integer + secretRef: + description: SecretRef contains a referece to the secret containing + the Kubeconfig for the control plane + properties: + inClusterKey: + description: Required + type: string + key: + description: Required + type: string + name: + description: '`name` is the name of the secret. Required' + type: string + namespace: + description: '`namespace` is the namespace of the secret. Required' + type: string + required: + - inClusterKey + - key + - name + - namespace + type: object + required: + - conditions + - observedGeneration + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/chart/templates/operator.yaml b/chart/templates/operator.yaml index c104299..d25f0ad 100644 --- a/chart/templates/operator.yaml +++ b/chart/templates/operator.yaml @@ -1,269 +1,3 @@ -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null - name: controlplanes.tenancy.kflex.kubestellar.org -spec: - group: tenancy.kflex.kubestellar.org - names: - kind: ControlPlane - listKind: ControlPlaneList - plural: controlplanes - shortNames: - - cp - - cps - singular: controlplane - scope: Cluster - versions: - - additionalPrinterColumns: - - jsonPath: .status.conditions[?(@.type=='Synced')].status - name: SYNCED - type: string - - jsonPath: .status.conditions[?(@.type=='Ready')].status - name: READY - type: string - - jsonPath: .spec.type - name: TYPE - type: string - - jsonPath: .metadata.creationTimestamp - name: AGE - type: date - name: v1alpha1 - schema: - openAPIV3Schema: - description: ControlPlane is the Schema for the controlplanes API - 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: ControlPlaneSpec defines the desired state of ControlPlane - properties: - backend: - enum: - - shared - - dedicated - type: string - postCreateHook: - type: string - postCreateHookVars: - additionalProperties: - type: string - type: object - type: - enum: - - k8s - - ocm - - vcluster - - host - type: string - type: object - status: - description: ControlPlaneStatus defines the observed state of ControlPlane - properties: - conditions: - items: - description: ControlPlaneCondition describes the state of a control - plane at a certain point. - properties: - lastTransitionTime: - format: date-time - type: string - lastUpdateTime: - format: date-time - type: string - message: - type: string - reason: - type: string - status: - type: string - type: - type: string - required: - - lastTransitionTime - - lastUpdateTime - - message - - reason - - status - - type - type: object - type: array - observedGeneration: - format: int64 - type: integer - postCreateHooks: - additionalProperties: - type: boolean - type: object - secretRef: - description: SecretRef contains a referece to the secret containing - the Kubeconfig for the control plane - properties: - inClusterKey: - description: Required - type: string - key: - description: Required - type: string - name: - description: '`name` is the name of the secret. Required' - type: string - namespace: - description: '`namespace` is the namespace of the secret. Required' - type: string - required: - - inClusterKey - - key - - name - - namespace - type: object - required: - - conditions - - observedGeneration - type: object - type: object - served: true - storage: true - subresources: - status: {} ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null - name: postcreatehooks.tenancy.kflex.kubestellar.org -spec: - group: tenancy.kflex.kubestellar.org - names: - kind: PostCreateHook - listKind: PostCreateHookList - plural: postcreatehooks - shortNames: - - pch - - pchs - singular: postcreatehook - scope: Cluster - versions: - - additionalPrinterColumns: - - jsonPath: .status.conditions[?(@.type=='Synced')].status - name: SYNCED - type: string - - jsonPath: .status.conditions[?(@.type=='Ready')].status - name: READY - type: string - - jsonPath: .spec.type - name: TYPE - type: string - - jsonPath: .metadata.creationTimestamp - name: AGE - type: date - name: v1alpha1 - schema: - openAPIV3Schema: - description: PostCreateHook is the Schema for the controlplanes API - 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: PostCreateHookSpec defines the desired state of PostCreateHook - properties: - templates: - items: - description: Manifest represents a resource to be deployed - type: object - x-kubernetes-embedded-resource: true - x-kubernetes-preserve-unknown-fields: true - type: array - type: object - status: - description: PostCreateHookStatus defines the observed state of PostCreateHook - properties: - conditions: - items: - description: ControlPlaneCondition describes the state of a control - plane at a certain point. - properties: - lastTransitionTime: - format: date-time - type: string - lastUpdateTime: - format: date-time - type: string - message: - type: string - reason: - type: string - status: - type: string - type: - type: string - required: - - lastTransitionTime - - lastUpdateTime - - message - - reason - - status - - type - type: object - type: array - observedGeneration: - format: int64 - type: integer - secretRef: - description: SecretRef contains a referece to the secret containing - the Kubeconfig for the control plane - properties: - inClusterKey: - description: Required - type: string - key: - description: Required - type: string - name: - description: '`name` is the name of the secret. Required' - type: string - namespace: - description: '`namespace` is the namespace of the secret. Required' - type: string - required: - - inClusterKey - - key - - name - - namespace - type: object - required: - - conditions - - observedGeneration - type: object - type: object - served: true - storage: true - subresources: - status: {} --- apiVersion: v1 kind: ServiceAccount diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml index 4b98d04..92c6c16 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -15,7 +15,6 @@ namePrefix: kubeflex- # someName: someValue resources: -- ../crd - ../rbac - ../manager # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in