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

chore(CRDs): publish full CRDs #1579

Merged
merged 3 commits into from
Jun 17, 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
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@ endif

.PHONY: manifests
manifests: yq controller-gen kustomize ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=manager-role webhook paths="./..." crd:maxDescLen=0,generateEmbeddedObjectMeta=false output:crd:artifacts:config=config/crd/bases
$(CONTROLLER_GEN) rbac:roleName=manager-role webhook paths="./..." crd:maxDescLen=0,generateEmbeddedObjectMeta=false output:crd:artifacts:config=deploy/helm/grafana-operator/crds
$(CONTROLLER_GEN) rbac:roleName=manager-role webhook paths="./..." crd output:crd:artifacts:config=config/crd-for-docs-generation
$(CONTROLLER_GEN) rbac:roleName=manager-role webhook paths="./..." crd output:crd:artifacts:config=config/crd/bases
$(CONTROLLER_GEN) rbac:roleName=manager-role webhook paths="./..." crd output:crd:artifacts:config=deploy/helm/grafana-operator/crds
yq -i '(select(.kind == "Deployment") | .spec.template.spec.containers[0].env[] | select (.name == "RELATED_IMAGE_GRAFANA")).value="$(GRAFANA_IMAGE):$(GRAFANA_VERSION)"' config/manager/manager.yaml

# NOTE: As we publish the whole kustomize folder structure (deploy/kustomize) as an OCI arfifact via flux, in kustomization.yaml, we cannot reference files that reside outside of deploy/kustomize. Thus, we need to maintain an additional copy of CRDs and the ClusterRole
Expand All @@ -111,7 +110,7 @@ manifests: yq controller-gen kustomize ## Generate WebhookConfiguration, Cluster

# Generate API reference documentation
api-docs: manifests gen-crd-api-reference-docs
$(API_REF_GEN) crdoc --resources config/crd-for-docs-generation --output docs/docs/api.md --template hugo/templates/frontmatter-grafana-operator.tmpl
$(API_REF_GEN) crdoc --resources config/crd/bases --output docs/docs/api.md --template hugo/templates/frontmatter-grafana-operator.tmpl

.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
Expand Down Expand Up @@ -152,11 +151,11 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified
.PHONY: deploy
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
$(KUSTOMIZE) build config/default | kubectl apply -f -
$(KUSTOMIZE) build config/default | kubectl apply --server-side --force-conflicts -f -

.PHONY: deploy-chainsaw
deploy-chainsaw: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/chainsaw-overlay | kubectl apply -f -
$(KUSTOMIZE) build config/chainsaw-overlay | kubectl apply --server-side --force-conflicts -f -

.PHONY: undeploy
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
Expand Down
26 changes: 19 additions & 7 deletions bundle/manifests/grafana-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,13 @@ metadata:
capabilities: Basic Install
categories: Monitoring
containerImage: ghcr.io/grafana/grafana-operator@sha256:97561cef949b58f55ec67d133c02ac205e2ec3fb77388aeb868dacfcebad0752
createdAt: "2024-05-09T08:55:59Z"
createdAt: "2024-06-13T13:49:44Z"
description: Deploys and manages Grafana instances, dashboards and data sources
operators.operatorframework.io/builder: operator-sdk-v1.32.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: https://github.com/grafana/grafana-operator
support: Grafana Labs
name: grafana-operator.v5.9.0
name: grafana-operator.v5.9.2
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -299,6 +299,18 @@ spec:
- patch
- update
- watch
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- grafana.integreatly.org
resources:
Expand Down Expand Up @@ -505,12 +517,12 @@ spec:
- --leader-elect
env:
- name: RELATED_IMAGE_GRAFANA
value: docker.io/grafana/grafana@sha256:9a2acaa26a0b302a56d8e113068a1297cf0726fcaff5e6bb77344888e5f1c976
value: docker.io/grafana/grafana@sha256:b7fcb534f7b3512801bb3f4e658238846435804deb479d105b5cdc680847c272
- name: WATCH_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.annotations['olm.targetNamespaces']
image: ghcr.io/grafana/grafana-operator@sha256:48cbc5e4e361e80f27d054fb986762109c199678b12f8b1baf63cfbafc69fc82
image: ghcr.io/grafana/grafana-operator@sha256:e7923d1a71b90a8ad66d114aec4b2b4e4929f15ba91872f64c5e271629612284
imagePullPolicy: Always
livenessProbe:
httpGet:
Expand Down Expand Up @@ -602,9 +614,9 @@ spec:
name: Grafana Labs
url: https://grafana.com
relatedImages:
- image: docker.io/grafana/grafana@sha256:9a2acaa26a0b302a56d8e113068a1297cf0726fcaff5e6bb77344888e5f1c976
- image: docker.io/grafana/grafana@sha256:b7fcb534f7b3512801bb3f4e658238846435804deb479d105b5cdc680847c272
name: grafana
- image: ghcr.io/grafana/grafana-operator@sha256:48cbc5e4e361e80f27d054fb986762109c199678b12f8b1baf63cfbafc69fc82
- image: ghcr.io/grafana/grafana-operator@sha256:e7923d1a71b90a8ad66d114aec4b2b4e4929f15ba91872f64c5e271629612284
name: manager
- image: ghcr.io/grafana/grafana-operator@sha256:97561cef949b58f55ec67d133c02ac205e2ec3fb77388aeb868dacfcebad0752
name: grafana-operator-97561cef949b58f55ec67d133c02ac205e2ec3fb77388aeb868dacfcebad0752-annotation
Expand All @@ -615,4 +627,4 @@ spec:
- grafana-operator.v5.6.3
- grafana-operator.v5.7.0
- grafana-operator.v5.8.0
version: 5.9.0
version: 5.9.2
113 changes: 113 additions & 0 deletions bundle/manifests/grafana.integreatly.org_grafanaalertrulegroups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,42 +17,82 @@ spec:
- name: v1beta1
schema:
openAPIV3Schema:
description: GrafanaAlertRuleGroup is the Schema for the grafanaalertrulegroups
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: GrafanaAlertRuleGroupSpec defines the desired state of GrafanaAlertRuleGroup
properties:
allowCrossNamespaceImport:
type: boolean
folderRef:
description: Match GrafanaFolders CRs to infer the uid
type: string
folderUID:
description: |-
UID of the folder containing this rule group
Overrides the FolderSelector
type: string
instanceSelector:
description: selects Grafanas for import
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
x-kubernetes-list-type: atomic
required:
- key
- operator
type: object
type: array
x-kubernetes-list-type: atomic
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
Expand All @@ -70,6 +110,9 @@ spec:
type: string
rules:
items:
description: AlertRule defines a specific rule to be evaluated.
It is based on the upstream model with some k8s specific type
mappings
properties:
annotations:
additionalProperties:
Expand All @@ -81,19 +124,31 @@ spec:
items:
properties:
datasourceUid:
description: Grafana data source unique identifier; it
should be '__expr__' for a Server Side Expression operation.
type: string
model:
description: JSON is the raw JSON query and includes the
above properties as well as custom properties.
x-kubernetes-preserve-unknown-fields: true
queryType:
description: |-
QueryType is an optional identifier for the type of query.
It can be used to distinguish different types of queries.
type: string
refId:
description: RefID is the unique identifier of the query,
set by the frontend call.
type: string
relativeTimeRange:
description: relative time range
properties:
from:
description: from
format: int64
type: integer
to:
description: to
format: int64
type: integer
type: object
Expand All @@ -104,6 +159,7 @@ spec:
- OK
- Alerting
- Error
- KeepLast
type: string
for:
format: duration
Expand All @@ -120,7 +176,29 @@ spec:
- 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
title:
example: Always firing
maxLength: 190
Expand Down Expand Up @@ -149,32 +227,67 @@ spec:
rule: (has(self.folderUID) && !(has(self.folderRef))) || (has(self.folderRef)
&& !(has(self.folderUID)))
status:
description: GrafanaAlertRuleGroupStatus defines the observed state of
GrafanaAlertRuleGroup
properties:
conditions:
items:
description: "Condition contains details for one aspect of the current
state of this API Resource.\n---\nThis struct is intended for
direct use as an array at the field path .status.conditions. For
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
observations of a foo's current state.\n\t // Known .status.conditions.type
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
\ // other fields\n\t}"
properties:
lastTransitionTime:
description: |-
lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: |-
message is a human readable message indicating details about the transition.
This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: |-
observedGeneration represents the .metadata.generation that the condition was set based upon.
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: |-
reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
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
Expand Down
Loading
Loading