Add status.port.lastUpdated field to Entity and ClusterEntity object
Andrew
Today the provided Custom Resource Definition (CRD) does not include a status field (ref: https://docs.port.io/build-your-software-catalog/sync-data-to-catalog/kubernetes/port-crd#deploying-ports-crds). Additionally, the k8s-exporter does not update the status field of each instance of that CRD, henceforth known as Custom Resources (CR).
It is impossible to tell from within the Kubernetes cluster if the ClusterEntity or Entity object is healthy according to the k8s-exporter. As a suggestion, please update the CR Definition with the following fields and enable the k8s-exporter the ability to update status fields.
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: entities.getport.io
spec:
...
...
subresources:
status: {}
versions:
- name: v1
schema:
openAPIV3Schema:
properties:
...
...
status:
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
The ability to update status fields should be off by default so other controller's in the cluster do not fight over the same status fields. And if the status update feature is turned on, it should be a status field that is not generally conflicting with other common controllers. A potentially good status field location for the k8s-exporter could be:
.status.port.lastUpdated
and .status.port.ready
.Couple options for turning the status update feature:
- An annotation like port.io/status-update: trueon that object (preferred)
- An option in the mapping configurationwithin Port.
To summarize, we are looking for the following items:
- Updated official Custom Resource Definition for ClusterEntityandEntityto allow arbitrary status fields.
- Updated k8s-exporterfunction to optionally have the ability to update targeted objects'statusfield under.status.port.lastUpdatedand.status.port.ready. This allows other operators to own.status.somethingElse.ready.