-
Notifications
You must be signed in to change notification settings - Fork 38
OCPBUGS-60905, OCPBUGS-51196, OCPBUGS-51181: fix(metrics): metrics export through service works now #268
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
base: master
Are you sure you want to change the base?
OCPBUGS-60905, OCPBUGS-51196, OCPBUGS-51181: fix(metrics): metrics export through service works now #268
Changes from all commits
58d5e7e
faf007d
6cade1a
474d091
da505c9
9cd57b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: Role | ||
| metadata: | ||
| creationTimestamp: null | ||
| name: prometheus-k8s | ||
| rules: | ||
| - apiGroups: | ||
| - "" | ||
| resources: | ||
| - services | ||
| - endpoints | ||
| - pods | ||
| verbs: | ||
| - get | ||
| - list | ||
| - watch |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: RoleBinding | ||
| metadata: | ||
| creationTimestamp: null | ||
| name: prometheus-k8s | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: Role | ||
| name: prometheus-k8s | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: prometheus-k8s | ||
| namespace: openshift-monitoring |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,12 +16,14 @@ metadata: | |
| } | ||
| ] | ||
| capabilities: Basic Install | ||
| createdAt: "2025-05-14T21:01:52Z" | ||
| console.openshift.io/operator-monitoring-default: "true" | ||
| createdAt: "2026-07-21T18:06:48Z" | ||
| description: Creates and maintains an OpenShift Update Service instance | ||
| kubernetes.io/description: "This OpenShift Update Service operator Deployment | ||
| reconciles local UpdateServices into more fundamental Kubernetes\nand OpenShift | ||
| resources like Cincinnati Deployments and Routes, and it reports the status | ||
| of those components in \nthe UpdateService status.\n" | ||
| operatorframework.io/cluster-monitoring: "true" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I'm not sure if that's still current, or how it would work on clusters where the console is not installed. but it suggests that 6cade1a might not be necessary. |
||
| operatorframework.io/suggested-namespace: openshift-update-service | ||
| operators.operatorframework.io/builder: operator-sdk-v1.31.0-ocp | ||
| operators.operatorframework.io/project_layout: go.kubebuilder.io/v3 | ||
|
|
@@ -124,6 +126,7 @@ spec: | |
| - apiGroups: | ||
| - config.openshift.io | ||
| resources: | ||
| - apiservers | ||
| - images | ||
| verbs: | ||
| - get | ||
|
|
@@ -192,8 +195,20 @@ spec: | |
| image: controller:latest | ||
| imagePullPolicy: Always | ||
| name: updateservice-operator | ||
| ports: | ||
| - containerPort: 8443 | ||
| name: https | ||
| protocol: TCP | ||
| resources: {} | ||
| volumeMounts: | ||
| - mountPath: /etc/metrics-certs | ||
| name: metrics-certs | ||
| readOnly: true | ||
| serviceAccountName: updateservice-operator | ||
| volumes: | ||
| - name: metrics-certs | ||
| secret: | ||
| secretName: updateservice-operator-metrics-tls | ||
| permissions: | ||
| - rules: | ||
| - apiGroups: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| annotations: | ||
| service.beta.openshift.io/serving-cert-secret-name: updateservice-operator-metrics-tls | ||
| creationTimestamp: null | ||
| labels: | ||
| name: updateservice-operator | ||
| name: updateservice-operator-metrics | ||
| spec: | ||
| ports: | ||
| - name: https | ||
| port: 8443 | ||
| targetPort: https | ||
| selector: | ||
| name: updateservice-operator | ||
| status: | ||
| loadBalancer: {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,3 +5,4 @@ resources: | |
| - ../crd | ||
| - ../rbac | ||
| - ../manager | ||
| - ../prometheus/rbac | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| resources: | ||
| - role.yaml | ||
| - role_binding.yaml |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: Role | ||
| metadata: | ||
| name: prometheus-k8s | ||
| namespace: openshift-update-service | ||
| rules: | ||
| - apiGroups: | ||
| - "" | ||
| resources: | ||
| - services | ||
| - endpoints | ||
| - pods | ||
| verbs: | ||
| - get | ||
| - list | ||
| - watch |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: RoleBinding | ||
| metadata: | ||
| name: prometheus-k8s | ||
| namespace: openshift-update-service | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: Role | ||
| name: prometheus-k8s | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: prometheus-k8s | ||
| namespace: openshift-monitoring |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,7 @@ rules: | |
| - apiGroups: | ||
| - config.openshift.io | ||
| resources: | ||
| - apiservers | ||
| - images | ||
| verbs: | ||
| - get | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,7 +58,7 @@ type UpdateServiceReconciler struct { | |
| // +kubebuilder:rbac:groups="apps",resources=deployments,verbs=get;list;watch | ||
| // +kubebuilder:rbac:groups=networking.k8s.io,resources=networkpolicies,verbs=get;list;watch | ||
| // +kubebuilder:rbac:groups="policy",resources=poddisruptionbudgets,verbs=get;list;watch | ||
| // +kubebuilder:rbac:groups=config.openshift.io,resources=images,verbs=get;list;watch | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't we need this to support these calls: $ git grep -B1 'ImageConfigName'
controllers/mapper.go-// Map will return a reconcile request for a UpdateService if the event is for a
controllers/mapper.go:// ImageConfigName Image or a ConfigMap referenced by AdditionalTrustedCA.Name.
--
controllers/mapper.go- image := &apicfgv1.Image{}
controllers/mapper.go: err := m.client.Get(ctx, types.NamespacedName{Name: defaults.ImageConfigName, Namespace: ""}, image)
...
controllers/updateservice_controller.go- image := &apicfgv1.Image{}
controllers/updateservice_controller.go: err := r.Client.Get(ctx, types.NamespacedName{Name: defaults.ImageConfigName}, image)
...
vendor/github.com/openshift/cluster-image-registry-operator/pkg/defaults/defaults.go-
vendor/github.com/openshift/cluster-image-registry-operator/pkg/defaults/defaults.go: ImageConfigName = "cluster" |
||
| // +kubebuilder:rbac:groups=config.openshift.io,resources=apiservers;images,verbs=get;list;watch | ||
| // +kubebuilder:rbac:groups=route.openshift.io,resources=routes,verbs=get;list;watch | ||
| // +kubebuilder:rbac:groups=updateservice.operator.openshift.io,resources=*,verbs=get;list;watch | ||
| // +kubebuilder:rbac:groups="",resources=pods;services;services/finalizers;endpoints;persistentvolumeclaims;events;configmaps;secrets,verbs=create;delete;get;list;patch;update;watch,namespace=openshift-update-service | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there docs for this one? It sounds a lot like
operatorframework.io/cluster-monitoring, but I haven't found anything that looks like docs. I did find this code, but that also sounds a lot like theoperatorframework.io/cluster-monitoringsemantics. Having a commit message that says "hey, reviewer and future devs, these changes are the appropiate changes to make because..." would help convince me ;) But commit message or not, I'd like to understand what this annotation is about, and I haven't been able to turn up docs around it on my own :/