diff --git a/README.md b/README.md index 7c437f5f2..d87f442bd 100644 --- a/README.md +++ b/README.md @@ -49,10 +49,6 @@ kubectl get secret ${CRYOSTAT_NAME}-jmx-auth -o jsonpath='{$.data.CRYOSTAT_RJMX_ kubectl get secret ${CRYOSTAT_NAME}-jmx-auth -o jsonpath='{$.data.CRYOSTAT_RJMX_PASS}' | base64 -d ``` -## Kubernetes API -The operator provides a Kubernetes API to directly create and manage Flight Recordings. -See [Kubernetes API Overview](docs/api.md) for more details. - # Building ## Requirements - `go` v1.15 diff --git a/bundle/manifests/cryostat-operator.clusterserviceversion.yaml b/bundle/manifests/cryostat-operator.clusterserviceversion.yaml index a3d7de265..6429decbc 100644 --- a/bundle/manifests/cryostat-operator.clusterserviceversion.yaml +++ b/bundle/manifests/cryostat-operator.clusterserviceversion.yaml @@ -81,6 +81,7 @@ metadata: } } operators.operatorframework.io/builder: operator-sdk-v1.4.0+git + operators.operatorframework.io/internal-objects: '["flightrecorders.operator.cryostat.io","recordings.operator.cryostat.io"]' operators.operatorframework.io/project_layout: go.kubebuilder.io/v3 repository: github.com/cryostatio/cryostat-operator support: Cryostat Community diff --git a/bundle/manifests/operator.cryostat.io_flightrecorders.yaml b/bundle/manifests/operator.cryostat.io_flightrecorders.yaml index fa1355317..ab0c6f025 100644 --- a/bundle/manifests/operator.cryostat.io_flightrecorders.yaml +++ b/bundle/manifests/operator.cryostat.io_flightrecorders.yaml @@ -14,7 +14,9 @@ spec: singular: flightrecorder scope: Namespaced versions: - - name: v1beta1 + - deprecated: true + deprecationWarning: operator.cryostat.io/v1beta1 FlightRecorder is deprecated; please use the Cryostat web application or the Cryostat HTTP API to manage recordings + name: v1beta1 schema: openAPIV3Schema: description: FlightRecorder represents a target Pod that is capable of creating JDK Flight Recordings using Cryostat. The Cryostat operator creates FlightRecorder objects when it finds compatible Pods. diff --git a/bundle/manifests/operator.cryostat.io_recordings.yaml b/bundle/manifests/operator.cryostat.io_recordings.yaml index a6680a578..55f2734e5 100644 --- a/bundle/manifests/operator.cryostat.io_recordings.yaml +++ b/bundle/manifests/operator.cryostat.io_recordings.yaml @@ -14,7 +14,9 @@ spec: singular: recording scope: Namespaced versions: - - name: v1beta1 + - deprecated: true + deprecationWarning: operator.cryostat.io/v1beta1 Recording is deprecated; please use the Cryostat web application or the Cryostat HTTP API to manage recordings + name: v1beta1 schema: openAPIV3Schema: description: Recording represents a JDK Flight Recording. Create a Recording object to instruct Cryostat to start a new recording for a Pod. An alternative to managing recordings with the Cryostat web application. diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index 7f6d4f123..3d61ec490 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -22,6 +22,21 @@ patchesStrategicMerge: #- patches/cainjection_in_flightrecorders.yaml # +kubebuilder:scaffold:crdkustomizecainjectionpatch +# FIXME Remove once migrated to kubebuilder markers +patches: +- path: patches/deprecate_flightrecorders.yaml + target: + group: apiextensions.k8s.io + version: v1 + kind: CustomResourceDefinition + name: flightrecorders.operator.cryostat.io +- path: patches/deprecate_recordings.yaml + target: + group: apiextensions.k8s.io + version: v1 + kind: CustomResourceDefinition + name: recordings.operator.cryostat.io + # the following config is for teaching kustomize how to do kustomization for CRDs. configurations: - kustomizeconfig.yaml diff --git a/config/crd/patches/deprecate_flightrecorders.yaml b/config/crd/patches/deprecate_flightrecorders.yaml new file mode 100644 index 000000000..9457f44c1 --- /dev/null +++ b/config/crd/patches/deprecate_flightrecorders.yaml @@ -0,0 +1,8 @@ +# FIXME this can be done using kubebuilder markers +# after upgrading Operator SDK to 1.10+ +- op: add + path: /spec/versions/0/deprecated + value: true +- op: add + path: /spec/versions/0/deprecationWarning + value: "operator.cryostat.io/v1beta1 FlightRecorder is deprecated; please use the Cryostat web application or the Cryostat HTTP API to manage recordings" diff --git a/config/crd/patches/deprecate_recordings.yaml b/config/crd/patches/deprecate_recordings.yaml new file mode 100644 index 000000000..35e4761b2 --- /dev/null +++ b/config/crd/patches/deprecate_recordings.yaml @@ -0,0 +1,8 @@ +# FIXME this can be done using kubebuilder markers +# after upgrading Operator SDK to 1.10+ +- op: add + path: /spec/versions/0/deprecated + value: true +- op: add + path: /spec/versions/0/deprecationWarning + value: "operator.cryostat.io/v1beta1 Recording is deprecated; please use the Cryostat web application or the Cryostat HTTP API to manage recordings" diff --git a/config/manifests/bases/cryostat-operator.clusterserviceversion.yaml b/config/manifests/bases/cryostat-operator.clusterserviceversion.yaml index e64a998c8..44dfee467 100644 --- a/config/manifests/bases/cryostat-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/cryostat-operator.clusterserviceversion.yaml @@ -69,6 +69,7 @@ metadata: } } operators.operatorframework.io/builder: operator-sdk-v1.5.0 + operators.operatorframework.io/internal-objects: '["flightrecorders.operator.cryostat.io","recordings.operator.cryostat.io"]' operators.operatorframework.io/project_layout: go.kubebuilder.io/v3 repository: github.com/cryostatio/cryostat-operator support: Cryostat Community diff --git a/docs/api.md b/docs/api.md index f5fb112c8..35d7e1821 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1,4 +1,4 @@ -# Kubernetes API Overview +# (Deprecated) Kubernetes API Overview This operator provides a Kubernetes API to interact with [Cryostat](https://github.com/cryostatio/cryostat). This API comes in the form of the `FlightRecorders` and `Recordings` Custom Resource Definitions, and allows you to create, list, delete, and download recordings from a Kubernetes cluster.