Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

✨ Separate CRDs #231

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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

Expand Down
266 changes: 266 additions & 0 deletions chart/crds/crds.yaml
Original file line number Diff line number Diff line change
@@ -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: {}
Loading