diff --git a/operators/kube-green/0.6.0/manifests/kube-green-aggregate-manager-role_rbac.authorization.k8s.io_v1_clusterrole.yaml b/operators/kube-green/0.6.0/manifests/kube-green-aggregate-manager-role_rbac.authorization.k8s.io_v1_clusterrole.yaml new file mode 100644 index 00000000000..4172f50e394 --- /dev/null +++ b/operators/kube-green/0.6.0/manifests/kube-green-aggregate-manager-role_rbac.authorization.k8s.io_v1_clusterrole.yaml @@ -0,0 +1,68 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + creationTimestamp: null + labels: + app: kube-green + kube-green.dev/aggregate-to-manager: "true" + name: kube-green-aggregate-manager-role +rules: +- apiGroups: + - apps + resources: + - deployments + - statefulsets + verbs: + - get + - list + - patch + - update + - watch +- apiGroups: + - batch + resources: + - cronjobs + verbs: + - get + - list + - patch + - update + - watch +- apiGroups: + - "" + resources: + - secrets + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - kube-green.com + resources: + - sleepinfos + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - kube-green.com + resources: + - sleepinfos/finalizers + verbs: + - update +- apiGroups: + - kube-green.com + resources: + - sleepinfos/status + verbs: + - get + - patch + - update diff --git a/operators/kube-green/0.6.0/manifests/kube-green-controller-manager-metrics-service_v1_service.yaml b/operators/kube-green/0.6.0/manifests/kube-green-controller-manager-metrics-service_v1_service.yaml new file mode 100644 index 00000000000..59859f5692d --- /dev/null +++ b/operators/kube-green/0.6.0/manifests/kube-green-controller-manager-metrics-service_v1_service.yaml @@ -0,0 +1,25 @@ +apiVersion: v1 +kind: Service +metadata: + creationTimestamp: null + labels: + app: kube-green + app.kubernetes.io/component: kube-rbac-proxy + app.kubernetes.io/created-by: kube-green + app.kubernetes.io/instance: controller-manager-metrics-service + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/name: service + app.kubernetes.io/part-of: kube-green + control-plane: controller-manager + name: kube-green-controller-manager-metrics-service +spec: + ports: + - name: https + port: 8443 + protocol: TCP + targetPort: https + selector: + app: kube-green + control-plane: controller-manager +status: + loadBalancer: {} diff --git a/operators/kube-green/0.6.0/manifests/kube-green-manager-config_v1_configmap.yaml b/operators/kube-green/0.6.0/manifests/kube-green-manager-config_v1_configmap.yaml new file mode 100644 index 00000000000..88a87cc950f --- /dev/null +++ b/operators/kube-green/0.6.0/manifests/kube-green-manager-config_v1_configmap.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +data: + controller_manager_config.yaml: | + apiVersion: controller-runtime.sigs.k8s.io/v1alpha1 + kind: ControllerManagerConfig + health: + healthProbeBindAddress: :8081 + metrics: + bindAddress: 127.0.0.1:8080 + webhook: + port: 9443 + leaderElection: + leaderElect: true + resourceName: 2bd226ed.kube-green.com +kind: ConfigMap +metadata: + labels: + app: kube-green + name: kube-green-manager-config diff --git a/operators/kube-green/0.6.0/manifests/kube-green-manager-role_rbac.authorization.k8s.io_v1_clusterrole.yaml b/operators/kube-green/0.6.0/manifests/kube-green-manager-role_rbac.authorization.k8s.io_v1_clusterrole.yaml new file mode 100644 index 00000000000..048ad5dd8ec --- /dev/null +++ b/operators/kube-green/0.6.0/manifests/kube-green-manager-role_rbac.authorization.k8s.io_v1_clusterrole.yaml @@ -0,0 +1,9 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: kube-green-manager-role +aggregationRule: + clusterRoleSelectors: + - matchLabels: + kube-green.dev/aggregate-to-manager: "true" +rules: [] # The control plane automatically fills in the rules diff --git a/operators/kube-green/0.6.0/manifests/kube-green-manager-rolebinding_rbac.authorization.k8s.io_v1_clusterrolebinding.yaml b/operators/kube-green/0.6.0/manifests/kube-green-manager-rolebinding_rbac.authorization.k8s.io_v1_clusterrolebinding.yaml new file mode 100644 index 00000000000..48100f946e2 --- /dev/null +++ b/operators/kube-green/0.6.0/manifests/kube-green-manager-rolebinding_rbac.authorization.k8s.io_v1_clusterrolebinding.yaml @@ -0,0 +1,19 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + labels: + app.kubernetes.io/name: clusterrolebinding + app.kubernetes.io/instance: manager-rolebinding + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: kube-green + app.kubernetes.io/part-of: kube-green + app.kubernetes.io/managed-by: kustomize + name: kube-green-manager-rolebinding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: kube-green-manager-role +subjects: +- kind: ServiceAccount + name: kube-green-controller-manager + namespace: operators diff --git a/operators/kube-green/0.6.0/manifests/kube-green-metrics-reader_rbac.authorization.k8s.io_v1_clusterrole.yaml b/operators/kube-green/0.6.0/manifests/kube-green-metrics-reader_rbac.authorization.k8s.io_v1_clusterrole.yaml new file mode 100644 index 00000000000..e91a9d99f59 --- /dev/null +++ b/operators/kube-green/0.6.0/manifests/kube-green-metrics-reader_rbac.authorization.k8s.io_v1_clusterrole.yaml @@ -0,0 +1,18 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + creationTimestamp: null + labels: + app: kube-green + app.kubernetes.io/component: kube-rbac-proxy + app.kubernetes.io/created-by: kube-green + app.kubernetes.io/instance: metrics-reader + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/name: clusterrole + app.kubernetes.io/part-of: kube-green + name: kube-green-metrics-reader +rules: +- nonResourceURLs: + - /metrics + verbs: + - get diff --git a/operators/kube-green/0.6.0/manifests/kube-green-webhook-service_v1_service.yaml b/operators/kube-green/0.6.0/manifests/kube-green-webhook-service_v1_service.yaml new file mode 100644 index 00000000000..47f073f2799 --- /dev/null +++ b/operators/kube-green/0.6.0/manifests/kube-green-webhook-service_v1_service.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: Service +metadata: + creationTimestamp: null + labels: + app: kube-green + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/name: kube-green + name: kube-green-webhook-service +spec: + ports: + - port: 443 + protocol: TCP + targetPort: 9443 + selector: + app: kube-green + control-plane: controller-manager +status: + loadBalancer: {} diff --git a/operators/kube-green/0.6.0/manifests/kube-green.clusterserviceversion.yaml b/operators/kube-green/0.6.0/manifests/kube-green.clusterserviceversion.yaml new file mode 100644 index 00000000000..b4c1f0be102 --- /dev/null +++ b/operators/kube-green/0.6.0/manifests/kube-green.clusterserviceversion.yaml @@ -0,0 +1,344 @@ +apiVersion: operators.coreos.com/v1alpha1 +kind: ClusterServiceVersion +metadata: + annotations: + alm-examples: |- + [ + { + "apiVersion": "kube-green.com/v1alpha1", + "kind": "SleepInfo", + "metadata": { + "labels": { + "app": "kube-green" + }, + "name": "sleepinfo-sample" + }, + "spec": { + "excludeRef": [ + { + "apiVersion": "apps/v1", + "kind": "Deployment", + "name": "api-gateway" + } + ], + "sleepAt": "20:00", + "suspendCronJobs": true, + "timeZone": "Europe/Rome", + "wakeUpAt": "08:00", + "weekdays": "1-5" + } + } + ] + capabilities: Seamless Upgrades + categories: Developer Tools + containerImage: docker.io/kubegreen/kube-green:0.6.0 + createdAt: "2024-11-11T19:41:42Z" + description: Suspend your pods when no-one's using them to save energy and restore + when necessary + operators.operatorframework.io/builder: operator-sdk-v1.34.2 + operators.operatorframework.io/project_layout: go.kubebuilder.io/v4 + repository: https://github.com/kube-green/kube-green + support: kube-green Community + labels: + app: kube-green + name: kube-green.v0.6.0 + namespace: placeholder +spec: + apiservicedefinitions: {} + customresourcedefinitions: + owned: + - description: SleepInfo is the Schema for the sleepinfos API + displayName: SleepInfo + kind: SleepInfo + name: sleepinfos.kube-green.com + resources: + - kind: Secret + name: sleepinfo + version: v1 + specDescriptors: + - description: ExcludeRef define the resource to exclude from the sleep. Exclusion + rules are evaluated in AND condition. + displayName: Exclude Ref + path: excludeRef + - description: IncludeRef define the resource to include from the sleep. Inclusion + rules are evaluated in AND condition. + displayName: Include Ref + path: includeRef + - description: Patches is a list of json 6902 patches to apply to the target + resources. + displayName: Patches + path: patches + - description: Patch is the json6902 patch to apply to the target resource. + displayName: Patch + path: patches[0].patch + - description: Target is the target resource to patch. + displayName: Target + path: patches[0].target + - description: Group of the Kubernetes resources. + displayName: Group + path: patches[0].target.group + - description: Kind of the Kubernetes resources. + displayName: Kind + path: patches[0].target.kind + - description: "Hours:Minutes \n Accept cron schedule for both hour and minute. + For example, *:*/2 is set to configure a run every even minute." + displayName: Sleep Time + path: sleepAt + - description: If SuspendCronjobs is set to true, on sleep the cronjobs of the + namespace will be suspended. + displayName: Suspend Cronjobs + path: suspendCronJobs + - description: If SuspendDeployments is set to false, on sleep the deployment + of the namespace will not be suspended. By default Deployment will be suspended. + displayName: Suspend Deployments + path: suspendDeployments + - description: If SuspendStatefulSets is set to false, on sleep the statefulset + of the namespace will not be suspended. By default StatefulSet will be suspended. + displayName: Suspend Stateful Sets + path: suspendStatefulSets + - description: Time zone to set the schedule, in IANA time zone identifier. + It is not required, default to UTC. For example, for the Italy time zone + set Europe/Rome. + displayName: Time Zone + path: timeZone + - description: "Hours:Minutes \n Accept cron schedule for both hour and minute. + For example, *:*/2 is set to configure a run every even minute. It is not + required." + displayName: Wake Up Time + path: wakeUpAt + - description: "Weekdays are in cron notation. \n For example, to configure + a schedule from monday to friday, set it to \"1-5\"" + displayName: Weekdays + path: weekdays + statusDescriptors: + - description: Information when was the last time the run was successfully scheduled. + displayName: Last Schedule Time + path: lastScheduleTime + - description: The operation type handled in last schedule. SLEEP or WAKE_UP + are the possibilities + displayName: Operation Type + path: operation + version: v1alpha1 + description: | + ## About this Operator + + [kube-green](https://kube-green.dev) shuts down (some of) your resources when you don't need them, reducing the consumption of resources of the cluster. + + Install this operator and apply the SleepInfo CRD to stop your dev namespaces from running during weekends, nights or when it is not necessary. + See the [docs](https://kube-green.dev/docs/getting-started/) for more information. + This operator is responsible to suspend and restart pods at specific times, defined by the SleepInfo CRD. + + An example of SleepInfo: + + ```yaml + apiVersion: kube-green.com/v1alpha1 + kind: SleepInfo + metadata: + name: working-hours + spec: + weekdays: "1-5" + sleepAt: "20:00" + wakeUpAt: "08:00" + timeZone: "Europe/Rome" + ``` + + This configuration stop pods everyday from monday to friday at 20:00 and restore them at 8:00. + In this way, your cluster nodes could downscale, producing less CO2 and saving money. + displayName: kube-green + icon: + - base64data: PHN2ZyB3aWR0aD0iNDg3IiBoZWlnaHQ9IjQ4NyIgdmlld0JveD0iMCAwIDQ4NyA0ODciIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0yMzEuMDE0IDMzLjc0NzVMNzguNDcwNyAxMDYuOUM3MC44MDA2IDExMC41NjMgNjUuMjQ4NCAxMTcuNTQ2IDYzLjMwMjIgMTI1Ljg0NkwyNS42OTU5IDI5MC4wNjZDMjMuODA3IDI5OC4zNjYgMjUuODEwNCAzMDcuMTIzIDMxLjEzMzcgMzEzLjc2M0wxMzYuNjI2IDQ0NS41MjhDMTQxLjk0OSA0NTIuMTY4IDE0OS45NjMgNDU2LjAwMyAxNTguNDM0IDQ1Ni4wMDNIMzI3LjgwNkMzMzYuMjc3IDQ1Ni4wMDMgMzQ0LjI5MSA0NTIuMTY4IDM0OS42MTQgNDQ1LjUyOEw0NTUuMTA2IDMxMy43NjNDNDYwLjQzIDMwNy4xMjMgNDYyLjQzMyAyOTguMzY2IDQ2MC41NDQgMjkwLjA2Nkw0MjIuOTM4IDEyNS44NDZDNDIxLjA0OSAxMTcuNTQ2IDQxNS40MzkgMTEwLjU2MyA0MDcuNzY5IDEwNi45TDI1NS4xNjkgMzMuNzQ3NUMyNDcuNTU2IDMwLjA4NDIgMjM4LjYyNyAzMC4wODQyIDIzMS4wMTQgMzMuNzQ3NVoiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl8yMzQ3XzYxMzEyKSIvPgo8cGF0aCBkPSJNMjMxLjAxNCA3MC41NTAyTDEwNy4zNzcgMTI5Ljg1Qzk5LjcwNjggMTMzLjUxNCA5NC4xNTQ2IDE0MC40OTcgOTIuMjA4NCAxNDguNzk3TDYxLjY5OTggMjgxLjg3OEM1OS44MTA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IHN0b3AtY29sb3I9IiMwRDVBNUEiLz4KPHN0b3Agb2Zmc2V0PSIwLjk2IiBzdG9wLWNvbG9yPSIjMEQ1MTU2Ii8+CjwvbGluZWFyR3JhZGllbnQ+CjwvZGVmcz4KPC9zdmc+Cg== + mediatype: image/svg+xml + install: + spec: + clusterPermissions: + - rules: + - apiGroups: + - authentication.k8s.io + resources: + - tokenreviews + verbs: + - create + - apiGroups: + - authorization.k8s.io + resources: + - subjectaccessreviews + verbs: + - create + serviceAccountName: kube-green-controller-manager + deployments: + - label: + app: kube-green + app.kubernetes.io/component: manager + app.kubernetes.io/created-by: kube-green + app.kubernetes.io/instance: controller-manager + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/name: deployment + app.kubernetes.io/part-of: kube-green + control-plane: controller-manager + name: kube-green-controller-manager + spec: + replicas: 1 + selector: + matchLabels: + app: kube-green + control-plane: controller-manager + strategy: {} + template: + metadata: + annotations: + kubectl.kubernetes.io/default-container: manager + labels: + app: kube-green + control-plane: controller-manager + spec: + containers: + - args: + - --health-probe-bind-address=:8081 + - --metrics-bind-address=127.0.0.1:8080 + - --leader-elect + command: + - /manager + image: docker.io/kubegreen/kube-green:0.6.0 + livenessProbe: + httpGet: + path: /healthz + port: 8081 + initialDelaySeconds: 15 + periodSeconds: 20 + name: manager + ports: + - containerPort: 9443 + name: webhook-server + protocol: TCP + readinessProbe: + httpGet: + path: /readyz + port: 8081 + initialDelaySeconds: 5 + periodSeconds: 10 + resources: + limits: + cpu: 400m + memory: 400Mi + requests: + cpu: 100m + memory: 50Mi + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + - args: + - --secure-listen-address=0.0.0.0:8443 + - --upstream=http://127.0.0.1:8080/ + - --logtostderr=true + - --v=0 + image: gcr.io/kubebuilder/kube-rbac-proxy:v0.16.0 + name: kube-rbac-proxy + ports: + - containerPort: 8443 + name: https + protocol: TCP + resources: + limits: + cpu: 500m + memory: 128Mi + requests: + cpu: 5m + memory: 64Mi + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + securityContext: + runAsNonRoot: true + serviceAccountName: kube-green-controller-manager + terminationGracePeriodSeconds: 10 + permissions: + - rules: + - apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - list + - watch + - create + - update + - patch + - delete + - apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - get + - list + - watch + - create + - update + - patch + - delete + - apiGroups: + - "" + resources: + - events + verbs: + - create + - patch + serviceAccountName: kube-green-controller-manager + strategy: deployment + installModes: + - supported: false + type: OwnNamespace + - supported: false + type: SingleNamespace + - supported: false + type: MultiNamespace + - supported: true + type: AllNamespaces + keywords: + - green + - green software + - resources + - downscale + - autoscale + - climate change + links: + - name: Homepage + url: https://kube-green.dev + - name: Source Code + url: https://github.com/kube-green/kube-green + maintainers: + - email: bianchidavide12+kubegreen@gmail.com + name: Davide + maturity: alpha + minKubeVersion: 1.19.0 + provider: + name: kube-green Community + url: https://kube-green.dev + replaces: kube-green.v0.5.2 + version: 0.6.0 + webhookdefinitions: + - admissionReviewVersions: + - v1 + containerPort: 443 + deploymentName: kube-green-controller-manager + failurePolicy: Fail + generateName: vsleepinfo.kb.io + rules: + - apiGroups: + - kube-green.com + apiVersions: + - v1alpha1 + operations: + - CREATE + - UPDATE + resources: + - sleepinfos + sideEffects: None + targetPort: 9443 + type: ValidatingAdmissionWebhook + webhookPath: /validate-kube-green-com-v1alpha1-sleepinfo diff --git a/operators/kube-green/0.6.0/manifests/kube-green.com_sleepinfos.yaml b/operators/kube-green/0.6.0/manifests/kube-green.com_sleepinfos.yaml new file mode 100644 index 00000000000..9accfa3517c --- /dev/null +++ b/operators/kube-green/0.6.0/manifests/kube-green.com_sleepinfos.yaml @@ -0,0 +1,196 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + cert-manager.io/inject-ca-from: kube-green/kube-green-serving-cert + controller-gen.kubebuilder.io/version: v0.14.0 + creationTimestamp: null + labels: + app: kube-green + name: sleepinfos.kube-green.com +spec: + group: kube-green.com + names: + kind: SleepInfo + listKind: SleepInfoList + plural: sleepinfos + singular: sleepinfo + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: SleepInfo is the Schema for the sleepinfos 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: SleepInfoSpec defines the desired state of SleepInfo + properties: + excludeRef: + description: |- + ExcludeRef define the resource to exclude from the sleep. + Exclusion rules are evaluated in AND condition. + items: + description: Define a resource to filter, used to include or exclude + resources from the sleep. + properties: + apiVersion: + description: ApiVersion of the kubernetes resources. + type: string + kind: + description: Kind of the kubernetes resources of the specific + version. + type: string + matchLabels: + additionalProperties: + type: string + description: MatchLabels which identify the kubernetes resource + by labels + type: object + name: + description: Name which identify the kubernetes resource. + type: string + type: object + type: array + includeRef: + description: |- + IncludeRef define the resource to include from the sleep. + Inclusion rules are evaluated in AND condition. + items: + description: Define a resource to filter, used to include or exclude + resources from the sleep. + properties: + apiVersion: + description: ApiVersion of the kubernetes resources. + type: string + kind: + description: Kind of the kubernetes resources of the specific + version. + type: string + matchLabels: + additionalProperties: + type: string + description: MatchLabels which identify the kubernetes resource + by labels + type: object + name: + description: Name which identify the kubernetes resource. + type: string + type: object + type: array + patches: + description: Patches is a list of json 6902 patches to apply to the + target resources. + items: + properties: + patch: + description: Patch is the json6902 patch to apply to the target + resource. + type: string + target: + description: Target is the target resource to patch. + properties: + group: + description: Group of the Kubernetes resources. + type: string + kind: + description: Kind of the Kubernetes resources. + type: string + required: + - group + - kind + type: object + required: + - patch + - target + type: object + type: array + sleepAt: + description: |- + Hours:Minutes + + + Accept cron schedule for both hour and minute. + For example, *:*/2 is set to configure a run every even minute. + type: string + suspendCronJobs: + description: If SuspendCronjobs is set to true, on sleep the cronjobs + of the namespace will be suspended. + type: boolean + suspendDeployments: + description: If SuspendDeployments is set to false, on sleep the deployment + of the namespace will not be suspended. By default Deployment will + be suspended. + type: boolean + suspendStatefulSets: + description: If SuspendStatefulSets is set to false, on sleep the + statefulset of the namespace will not be suspended. By default StatefulSet + will be suspended. + type: boolean + timeZone: + description: |- + Time zone to set the schedule, in IANA time zone identifier. + It is not required, default to UTC. + For example, for the Italy time zone set Europe/Rome. + type: string + wakeUpAt: + description: |- + Hours:Minutes + + + Accept cron schedule for both hour and minute. + For example, *:*/2 is set to configure a run every even minute. + It is not required. + type: string + weekdays: + description: |- + Weekdays are in cron notation. + + + For example, to configure a schedule from monday to friday, set it to "1-5" + type: string + required: + - sleepAt + - weekdays + type: object + status: + description: SleepInfoStatus defines the observed state of SleepInfo + properties: + lastScheduleTime: + description: Information when was the last time the run was successfully + scheduled. + format: date-time + type: string + operation: + description: |- + The operation type handled in last schedule. SLEEP or WAKE_UP are the + possibilities + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: null diff --git a/operators/kube-green/0.6.0/metadata/annotations.yaml b/operators/kube-green/0.6.0/metadata/annotations.yaml new file mode 100644 index 00000000000..7935664e468 --- /dev/null +++ b/operators/kube-green/0.6.0/metadata/annotations.yaml @@ -0,0 +1,14 @@ +annotations: + # Core bundle annotations. + operators.operatorframework.io.bundle.mediatype.v1: registry+v1 + operators.operatorframework.io.bundle.manifests.v1: manifests/ + operators.operatorframework.io.bundle.metadata.v1: metadata/ + operators.operatorframework.io.bundle.package.v1: kube-green + operators.operatorframework.io.bundle.channels.v1: alpha + operators.operatorframework.io.metrics.builder: operator-sdk-v1.34.2 + operators.operatorframework.io.metrics.mediatype.v1: metrics+v1 + operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v4 + + # Annotations for testing. + operators.operatorframework.io.test.mediatype.v1: scorecard+v1 + operators.operatorframework.io.test.config.v1: tests/scorecard/ diff --git a/operators/kube-green/0.6.0/tests/scorecard/config.yaml b/operators/kube-green/0.6.0/tests/scorecard/config.yaml new file mode 100644 index 00000000000..8f68dc1b75d --- /dev/null +++ b/operators/kube-green/0.6.0/tests/scorecard/config.yaml @@ -0,0 +1,70 @@ +apiVersion: scorecard.operatorframework.io/v1alpha3 +kind: Configuration +metadata: + name: config +stages: +- parallel: true + tests: + - entrypoint: + - scorecard-test + - basic-check-spec + image: quay.io/operator-framework/scorecard-test:v1.34.0 + labels: + suite: basic + test: basic-check-spec-test + storage: + spec: + mountPath: {} + - entrypoint: + - scorecard-test + - olm-bundle-validation + image: quay.io/operator-framework/scorecard-test:v1.34.0 + labels: + suite: olm + test: olm-bundle-validation-test + storage: + spec: + mountPath: {} + - entrypoint: + - scorecard-test + - olm-crds-have-validation + image: quay.io/operator-framework/scorecard-test:v1.34.0 + labels: + suite: olm + test: olm-crds-have-validation-test + storage: + spec: + mountPath: {} + - entrypoint: + - scorecard-test + - olm-crds-have-resources + image: quay.io/operator-framework/scorecard-test:v1.34.0 + labels: + suite: olm + test: olm-crds-have-resources-test + storage: + spec: + mountPath: {} + - entrypoint: + - scorecard-test + - olm-spec-descriptors + image: quay.io/operator-framework/scorecard-test:v1.34.0 + labels: + suite: olm + test: olm-spec-descriptors-test + storage: + spec: + mountPath: {} + - entrypoint: + - scorecard-test + - olm-status-descriptors + image: quay.io/operator-framework/scorecard-test:v1.34.0 + labels: + suite: olm + test: olm-status-descriptors-test + storage: + spec: + mountPath: {} +storage: + spec: + mountPath: {}