From b7258b3cc9ae0a95748195686483ff7bb8a5a46b Mon Sep 17 00:00:00 2001 From: Danny Date: Mon, 9 Dec 2024 19:44:02 +0100 Subject: [PATCH] feat(*): Added Grafana and AWS CRDs (#435) --- crd.k8s.amazonaws.com/eniconfig_v1alpha1.json | 41 +++ .../grafanaalertrulegroup_v1beta1.json | 291 ++++++++++++++++++ .../grafanacontactpoint_v1beta1.json | 173 +++++++++++ .../policyendpoint_v1alpha1.json | 238 ++++++++++++++ 4 files changed, 743 insertions(+) create mode 100644 crd.k8s.amazonaws.com/eniconfig_v1alpha1.json create mode 100644 grafana.integreatly.org/grafanaalertrulegroup_v1beta1.json create mode 100644 grafana.integreatly.org/grafanacontactpoint_v1beta1.json create mode 100644 networking.k8s.aws/policyendpoint_v1alpha1.json diff --git a/crd.k8s.amazonaws.com/eniconfig_v1alpha1.json b/crd.k8s.amazonaws.com/eniconfig_v1alpha1.json new file mode 100644 index 00000000..c62ae10c --- /dev/null +++ b/crd.k8s.amazonaws.com/eniconfig_v1alpha1.json @@ -0,0 +1,41 @@ +{ + "description": "ENIConfig is the Schema for the eniconfigs API", + "properties": { + "apiVersion": { + "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore 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.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + "type": "string" + }, + "metadata": { + "type": "object" + }, + "spec": { + "description": "ENIConfigSpec defines the desired state of ENIConfig", + "properties": { + "securityGroups": { + "items": { + "type": "string" + }, + "type": "array" + }, + "subnet": { + "type": "string" + } + }, + "required": [ + "subnet" + ], + "type": "object", + "additionalProperties": false + }, + "status": { + "description": "ENIConfigStatus defines the observed state of ENIConfig", + "type": "object" + } + }, + "type": "object", + "x-kubernetes-preserve-unknown-fields": true +} diff --git a/grafana.integreatly.org/grafanaalertrulegroup_v1beta1.json b/grafana.integreatly.org/grafanaalertrulegroup_v1beta1.json new file mode 100644 index 00000000..912e518e --- /dev/null +++ b/grafana.integreatly.org/grafanaalertrulegroup_v1beta1.json @@ -0,0 +1,291 @@ +{ + "properties": { + "apiVersion": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "metadata": { + "type": "object" + }, + "spec": { + "properties": { + "allowCrossNamespaceImport": { + "type": "boolean" + }, + "folderRef": { + "type": "string" + }, + "folderUID": { + "type": "string" + }, + "instanceSelector": { + "properties": { + "matchExpressions": { + "items": { + "properties": { + "key": { + "type": "string" + }, + "operator": { + "type": "string" + }, + "values": { + "items": { + "type": "string" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + } + }, + "required": [ + "key", + "operator" + ], + "type": "object", + "additionalProperties": false + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + }, + "matchLabels": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + }, + "type": "object", + "x-kubernetes-map-type": "atomic", + "x-kubernetes-validations": [ + { + "message": "Value is immutable", + "rule": "self == oldSelf" + } + ], + "additionalProperties": false + }, + "interval": { + "format": "duration", + "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|\u00b5s|ms|s|m|h))+$", + "type": "string" + }, + "resyncPeriod": { + "default": "10m", + "format": "duration", + "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|\u00b5s|ms|s|m|h))+$", + "type": "string" + }, + "rules": { + "items": { + "properties": { + "annotations": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "condition": { + "type": "string" + }, + "data": { + "items": { + "properties": { + "datasourceUid": { + "type": "string" + }, + "model": { + "x-kubernetes-preserve-unknown-fields": true + }, + "queryType": { + "type": "string" + }, + "refId": { + "type": "string" + }, + "relativeTimeRange": { + "properties": { + "from": { + "format": "int64", + "type": "integer" + }, + "to": { + "format": "int64", + "type": "integer" + } + }, + "type": "object", + "additionalProperties": false + } + }, + "type": "object", + "additionalProperties": false + }, + "type": "array" + }, + "execErrState": { + "enum": [ + "OK", + "Alerting", + "Error", + "KeepLast" + ], + "type": "string" + }, + "for": { + "format": "duration", + "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|\u00b5s|ms|s|m|h))+$", + "type": "string" + }, + "isPaused": { + "type": "boolean" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "noDataState": { + "enum": [ + "Alerting", + "NoData", + "OK", + "KeepLast" + ], + "type": "string" + }, + "notificationSettings": { + "properties": { + "group_by": { + "items": { + "type": "string" + }, + "type": "array" + }, + "group_interval": { + "type": "string" + }, + "group_wait": { + "type": "string" + }, + "mute_time_intervals": { + "items": { + "type": "string" + }, + "type": "array" + }, + "receiver": { + "type": "string" + }, + "repeat_interval": { + "type": "string" + } + }, + "required": [ + "receiver" + ], + "type": "object", + "additionalProperties": false + }, + "title": { + "example": "Always firing", + "maxLength": 190, + "minLength": 1, + "type": "string" + }, + "uid": { + "pattern": "^[a-zA-Z0-9-_]+$", + "type": "string" + } + }, + "required": [ + "condition", + "data", + "execErrState", + "for", + "noDataState", + "title", + "uid" + ], + "type": "object", + "additionalProperties": false + }, + "type": "array" + } + }, + "required": [ + "instanceSelector", + "interval", + "rules" + ], + "type": "object", + "x-kubernetes-validations": [ + { + "message": "Only one of FolderUID or FolderRef can be set", + "rule": "(has(self.folderUID) && !(has(self.folderRef))) || (has(self.folderRef) && !(has(self.folderUID)))" + } + ], + "additionalProperties": false + }, + "status": { + "properties": { + "conditions": { + "items": { + "properties": { + "lastTransitionTime": { + "format": "date-time", + "type": "string" + }, + "message": { + "maxLength": 32768, + "type": "string" + }, + "observedGeneration": { + "format": "int64", + "minimum": 0, + "type": "integer" + }, + "reason": { + "maxLength": 1024, + "minLength": 1, + "pattern": "^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$", + "type": "string" + }, + "status": { + "enum": [ + "True", + "False", + "Unknown" + ], + "type": "string" + }, + "type": { + "maxLength": 316, + "pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$", + "type": "string" + } + }, + "required": [ + "lastTransitionTime", + "message", + "reason", + "status", + "type" + ], + "type": "object", + "additionalProperties": false + }, + "type": "array" + } + }, + "required": [ + "conditions" + ], + "type": "object", + "additionalProperties": false + } + }, + "type": "object" +} diff --git a/grafana.integreatly.org/grafanacontactpoint_v1beta1.json b/grafana.integreatly.org/grafanacontactpoint_v1beta1.json new file mode 100644 index 00000000..0156ff9b --- /dev/null +++ b/grafana.integreatly.org/grafanacontactpoint_v1beta1.json @@ -0,0 +1,173 @@ +{ + "properties": { + "apiVersion": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "metadata": { + "type": "object" + }, + "spec": { + "properties": { + "allowCrossNamespaceImport": { + "type": "boolean" + }, + "disableResolveMessage": { + "type": "boolean" + }, + "instanceSelector": { + "properties": { + "matchExpressions": { + "items": { + "properties": { + "key": { + "type": "string" + }, + "operator": { + "type": "string" + }, + "values": { + "items": { + "type": "string" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + } + }, + "required": [ + "key", + "operator" + ], + "type": "object", + "additionalProperties": false + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + }, + "matchLabels": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + }, + "type": "object", + "x-kubernetes-map-type": "atomic", + "x-kubernetes-validations": [ + { + "message": "Value is immutable", + "rule": "self == oldSelf" + } + ], + "additionalProperties": false + }, + "name": { + "type": "string" + }, + "resyncPeriod": { + "default": "10m", + "format": "duration", + "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|\u00b5s|ms|s|m|h))+$", + "type": "string" + }, + "settings": { + "x-kubernetes-preserve-unknown-fields": true + }, + "type": { + "enum": [ + "alertmanager", + "prometheus-alertmanager", + "dingding", + "discord", + "email", + "googlechat", + "kafka", + "line", + "opsgenie", + "pagerduty", + "pushover", + "sensugo", + "sensu", + "slack", + "teams", + "telegram", + "threema", + "victorops", + "webhook", + "wecom", + "hipchat", + "oncall" + ], + "type": "string" + } + }, + "required": [ + "instanceSelector", + "name", + "settings" + ], + "type": "object", + "additionalProperties": false + }, + "status": { + "properties": { + "conditions": { + "items": { + "properties": { + "lastTransitionTime": { + "format": "date-time", + "type": "string" + }, + "message": { + "maxLength": 32768, + "type": "string" + }, + "observedGeneration": { + "format": "int64", + "minimum": 0, + "type": "integer" + }, + "reason": { + "maxLength": 1024, + "minLength": 1, + "pattern": "^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$", + "type": "string" + }, + "status": { + "enum": [ + "True", + "False", + "Unknown" + ], + "type": "string" + }, + "type": { + "maxLength": 316, + "pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$", + "type": "string" + } + }, + "required": [ + "lastTransitionTime", + "message", + "reason", + "status", + "type" + ], + "type": "object", + "additionalProperties": false + }, + "type": "array" + } + }, + "required": [ + "conditions" + ], + "type": "object", + "additionalProperties": false + } + }, + "type": "object" +} diff --git a/networking.k8s.aws/policyendpoint_v1alpha1.json b/networking.k8s.aws/policyendpoint_v1alpha1.json new file mode 100644 index 00000000..866cab8e --- /dev/null +++ b/networking.k8s.aws/policyendpoint_v1alpha1.json @@ -0,0 +1,238 @@ +{ + "description": "PolicyEndpoint is the Schema for the policyendpoints 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": "PolicyEndpointSpec defines the desired state of PolicyEndpoint", + "properties": { + "egress": { + "description": "Egress is the list of egress rules containing resolved network addresses", + "items": { + "description": "EndpointInfo defines the network endpoint information for the policy ingress/egress", + "properties": { + "cidr": { + "description": "CIDR is the network address(s) of the endpoint", + "type": "string" + }, + "except": { + "description": "Except is the exceptions to the CIDR ranges mentioned above.", + "items": { + "type": "string" + }, + "type": "array" + }, + "ports": { + "description": "Ports is the list of ports", + "items": { + "description": "Port contains information about the transport port/protocol", + "properties": { + "endPort": { + "description": "Endport specifies the port range port to endPort port must be defined and an integer, endPort > port", + "format": "int32", + "type": "integer" + }, + "port": { + "description": "Port specifies the numerical port for the protocol. If empty applies to all ports", + "format": "int32", + "type": "integer" + }, + "protocol": { + "default": "TCP", + "description": "Protocol specifies the transport protocol, default TCP", + "type": "string" + } + }, + "type": "object", + "additionalProperties": false + }, + "type": "array" + } + }, + "required": [ + "cidr" + ], + "type": "object", + "additionalProperties": false + }, + "type": "array" + }, + "ingress": { + "description": "Ingress is the list of ingress rules containing resolved network addresses", + "items": { + "description": "EndpointInfo defines the network endpoint information for the policy ingress/egress", + "properties": { + "cidr": { + "description": "CIDR is the network address(s) of the endpoint", + "type": "string" + }, + "except": { + "description": "Except is the exceptions to the CIDR ranges mentioned above.", + "items": { + "type": "string" + }, + "type": "array" + }, + "ports": { + "description": "Ports is the list of ports", + "items": { + "description": "Port contains information about the transport port/protocol", + "properties": { + "endPort": { + "description": "Endport specifies the port range port to endPort port must be defined and an integer, endPort > port", + "format": "int32", + "type": "integer" + }, + "port": { + "description": "Port specifies the numerical port for the protocol. If empty applies to all ports", + "format": "int32", + "type": "integer" + }, + "protocol": { + "default": "TCP", + "description": "Protocol specifies the transport protocol, default TCP", + "type": "string" + } + }, + "type": "object", + "additionalProperties": false + }, + "type": "array" + } + }, + "required": [ + "cidr" + ], + "type": "object", + "additionalProperties": false + }, + "type": "array" + }, + "podIsolation": { + "description": "PodIsolation specifies whether the pod needs to be isolated for a particular traffic direction Ingress or Egress, or both. If default isolation is not specified, and there are no ingress/egress rules, then the pod is not isolated from the point of view of this policy. This follows the NetworkPolicy spec.PolicyTypes.", + "items": { + "description": "PolicyType string describes the NetworkPolicy type This type is beta-level in 1.8", + "type": "string" + }, + "type": "array" + }, + "podSelector": { + "description": "PodSelector is the podSelector from the policy resource", + "properties": { + "matchExpressions": { + "description": "matchExpressions is a list of label selector requirements. The requirements are ANDed.", + "items": { + "description": "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.", + "properties": { + "key": { + "description": "key is the label key that the selector applies to.", + "type": "string" + }, + "operator": { + "description": "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.", + "type": "string" + }, + "values": { + "description": "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "key", + "operator" + ], + "type": "object", + "additionalProperties": false + }, + "type": "array" + }, + "matchLabels": { + "additionalProperties": { + "type": "string" + }, + "description": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.", + "type": "object" + } + }, + "type": "object", + "x-kubernetes-map-type": "atomic", + "additionalProperties": false + }, + "podSelectorEndpoints": { + "description": "PodSelectorEndpoints contains information about the pods matching the podSelector", + "items": { + "description": "PodEndpoint defines the summary information for the pods", + "properties": { + "hostIP": { + "description": "HostIP is the IP address of the host the pod is currently running on", + "type": "string" + }, + "name": { + "description": "Name is the pod name", + "type": "string" + }, + "namespace": { + "description": "Namespace is the pod namespace", + "type": "string" + }, + "podIP": { + "description": "PodIP is the IP address of the pod", + "type": "string" + } + }, + "required": [ + "hostIP", + "name", + "namespace", + "podIP" + ], + "type": "object", + "additionalProperties": false + }, + "type": "array" + }, + "policyRef": { + "description": "PolicyRef is a reference to the Kubernetes NetworkPolicy resource.", + "properties": { + "name": { + "description": "Name is the name of the Policy", + "type": "string" + }, + "namespace": { + "description": "Namespace is the namespace of the Policy", + "type": "string" + } + }, + "required": [ + "name", + "namespace" + ], + "type": "object", + "additionalProperties": false + } + }, + "required": [ + "policyRef" + ], + "type": "object", + "additionalProperties": false + }, + "status": { + "description": "PolicyEndpointStatus defines the observed state of PolicyEndpoint", + "type": "object" + } + }, + "type": "object" +}