Skip to content

Commit a228b1e

Browse files
committed
change gitops-operator namespace, add artifacts needed for openshift-monitoring
Signed-off-by: Jaideep Rao <[email protected]>
1 parent 50b7b67 commit a228b1e

22 files changed

+215
-66
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# To re-generate a bundle for another specific version without changing the standard setup, you can:
44
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
55
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
6-
VERSION ?= ""
6+
VERSION ?= "1.9.0-ocp-metrics-5"
77

88
# CHANNELS define the bundle channels used in the bundle.
99
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "preview,fast,stable")
@@ -27,7 +27,7 @@ endif
2727
BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
2828

2929
# IMAGE defines the base image to be used for operator, bundle and catalog.
30-
IMAGE ?= quay.io/redhat-developer/gitops-operator
30+
IMAGE ?= quay.io/jrao/gitops-operator
3131

3232
# IMAGE_TAG_BASE defines the docker.io namespace and part of the image name for remote images.
3333
# This variable is used to construct full image tags for bundle and catalog images.

bundle.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
77
LABEL operators.operatorframework.io.bundle.package.v1=gitops-operator
88
LABEL operators.operatorframework.io.bundle.channels.v1=latest,gitops-1.8
99
LABEL operators.operatorframework.io.bundle.channel.default.v1=latest
10-
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.10.0+git
10+
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.28.1
1111
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
1212
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3
1313

bundle/manifests/gitops-operator-controller-manager-metrics-service_v1_service.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

bundle/manifests/gitops-operator-metrics-reader_rbac.authorization.k8s.io_v1_clusterrole.yaml

Lines changed: 0 additions & 10 deletions
This file was deleted.

bundle/manifests/gitops-operator.clusterserviceversion.yaml

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ metadata:
137137
containerImage: quay.io/redhat-developer/gitops-operator
138138
description: Enables teams to adopt GitOps principles for managing cluster configurations
139139
and application delivery across hybrid multi-cluster Kubernetes environments.
140+
operatorframework.io/cluster-monitoring: "true"
141+
operatorframework.io/suggested-namespace: openshift-gitops-operator
140142
operators.openshift.io/infrastructure-features: '["disconnected"]'
141143
operators.operatorframework.io/builder: operator-sdk-v1.10.0+git
142144
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
@@ -865,22 +867,56 @@ spec:
865867
- subjectaccessreviews
866868
verbs:
867869
- create
868-
serviceAccountName: gitops-operator-controller-manager
870+
serviceAccountName: openshift-gitops-operator-controller-manager
869871
deployments:
870-
- name: gitops-operator-controller-manager
872+
- label:
873+
control-plane: gitops-operator
874+
name: openshift-gitops-operator-controller-manager
871875
spec:
872876
replicas: 1
873877
selector:
874878
matchLabels:
875-
control-plane: argocd-operator
879+
control-plane: gitops-operator
876880
strategy: {}
877881
template:
878882
metadata:
879883
labels:
880-
control-plane: argocd-operator
884+
control-plane: gitops-operator
881885
spec:
882886
containers:
883-
- command:
887+
- args:
888+
- --secure-listen-address=0.0.0.0:8443
889+
- --upstream=http://127.0.0.1:8080
890+
- --tls-cert-file=/etc/tls/private/tls.crt
891+
- --tls-private-key-file=/etc/tls/private/tls.key
892+
- --logtostderr=true
893+
- --allow-paths=/metrics
894+
image: registry.redhat.io/openshift4/ose-kube-rbac-proxy@sha256:da5d5061dbc2ec5082cf14b6c600fb5400b83cf91d7ccebfa80680a238d275db
895+
name: kube-rbac-proxy
896+
ports:
897+
- containerPort: 8443
898+
name: metrics
899+
resources:
900+
limits:
901+
cpu: 500m
902+
memory: 128Mi
903+
requests:
904+
cpu: 1m
905+
memory: 15Mi
906+
securityContext:
907+
allowPrivilegeEscalation: false
908+
capabilities:
909+
drop:
910+
- ALL
911+
volumeMounts:
912+
- mountPath: /etc/tls/private
913+
name: kube-rbac-proxy-tls
914+
readOnly: true
915+
- args:
916+
- --health-probe-bind-address=:8081
917+
- --metrics-bind-address=127.0.0.1:8080
918+
- --leader-elect
919+
command:
884920
- /usr/local/bin/manager
885921
env:
886922
- name: ARGOCD_CLUSTER_CONFIG_NAMESPACES
@@ -911,8 +947,12 @@ spec:
911947
runAsNonRoot: true
912948
securityContext:
913949
runAsNonRoot: true
914-
serviceAccountName: gitops-operator-controller-manager
950+
serviceAccountName: openshift-gitops-operator-controller-manager
915951
terminationGracePeriodSeconds: 10
952+
volumes:
953+
- name: kube-rbac-proxy-tls
954+
secret:
955+
secretName: kube-rbac-proxy-tls
916956
permissions:
917957
- rules:
918958
- apiGroups:
@@ -946,7 +986,7 @@ spec:
946986
verbs:
947987
- create
948988
- patch
949-
serviceAccountName: gitops-operator-controller-manager
989+
serviceAccountName: openshift-gitops-operator-controller-manager
950990
strategy: deployment
951991
installModes:
952992
- supported: false

bundle/manifests/gitops-operator-manager-config_v1_configmap.yaml renamed to bundle/manifests/openshift-gitops-operator-manager-config_v1_configmap.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ data:
1414
resourceName: 2b63967d.openshift.io
1515
kind: ConfigMap
1616
metadata:
17-
name: gitops-operator-manager-config
17+
name: openshift-gitops-operator-manager-config
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: monitoring.coreos.com/v1
2+
kind: ServiceMonitor
3+
metadata:
4+
labels:
5+
control-plane: gitops-operator
6+
name: openshift-gitops-operator-metrics-monitor
7+
spec:
8+
endpoints:
9+
- bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
10+
interval: 30s
11+
path: /metrics
12+
port: metrics
13+
scheme: https
14+
tlsConfig:
15+
caFile: /etc/prometheus/configmaps/serving-certs-ca-bundle/service-ca.crt
16+
serverName: openshift-gitops-operator-metrics-service.openshift-gitops-operator.svc
17+
selector:
18+
matchLabels:
19+
control-plane: gitops-operator
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
annotations:
5+
service.beta.openshift.io/serving-cert-secret-name: kube-rbac-proxy-tls
6+
creationTimestamp: null
7+
labels:
8+
control-plane: gitops-operator
9+
name: openshift-gitops-operator-metrics-service
10+
spec:
11+
ports:
12+
- name: metrics
13+
port: 8443
14+
targetPort: metrics
15+
selector:
16+
control-plane: gitops-operator
17+
type: ClusterIP
18+
status:
19+
loadBalancer: {}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: Role
3+
metadata:
4+
creationTimestamp: null
5+
name: openshift-gitops-operator-prometheus
6+
rules:
7+
- apiGroups:
8+
- ""
9+
resources:
10+
- services
11+
- endpoints
12+
- pods
13+
verbs:
14+
- get
15+
- list
16+
- watch
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: RoleBinding
3+
metadata:
4+
creationTimestamp: null
5+
name: openshift-gitops-operator-prometheus
6+
roleRef:
7+
apiGroup: rbac.authorization.k8s.io
8+
kind: Role
9+
name: openshift-gitops-operator-prometheus
10+
subjects:
11+
- kind: ServiceAccount
12+
name: prometheus-k8s
13+
namespace: openshift-monitoring

config/default/kustomization.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Adds namespace to all resources.
2-
namespace: gitops-operator-system
2+
namespace: openshift-gitops-operator
33

44
# Value of this field is prepended to the
55
# names of all resources, e.g. a deployment named
66
# "wordpress" becomes "alices-wordpress".
77
# Note that it should also match with the prefix (text before '-') of the namespace
88
# field above.
9-
namePrefix: gitops-operator-
9+
namePrefix: openshift-gitops-operator-
1010

1111
# Labels to add to all resources and selectors.
1212
#commonLabels:
@@ -22,13 +22,13 @@ bases:
2222
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required.
2323
#- ../certmanager
2424
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
25-
#- ../prometheus
25+
- ../prometheus
2626

2727
patchesStrategicMerge:
2828
# Protect the /metrics endpoint by putting it behind auth.
2929
# If you want your controller-manager to expose the /metrics
3030
# endpoint w/o any authn/z, please comment the following line.
31-
#- manager_auth_proxy_patch.yaml
31+
- manager_auth_proxy_patch.yaml
3232

3333
# Mount the controller config file for loading manager configurations
3434
# through a ComponentConfig type

config/default/manager_auth_proxy_patch.yaml

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,50 @@ metadata:
66
name: controller-manager
77
namespace: system
88
spec:
9+
selector:
10+
matchLabels:
11+
control-plane: gitops-operator
912
template:
1013
spec:
1114
containers:
1215
- name: kube-rbac-proxy
13-
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0
16+
image: registry.redhat.io/openshift4/ose-kube-rbac-proxy@sha256:da5d5061dbc2ec5082cf14b6c600fb5400b83cf91d7ccebfa80680a238d275db
1417
args:
15-
- "--secure-listen-address=0.0.0.0:8443"
16-
- "--upstream=http://127.0.0.1:8080/"
17-
- "--logtostderr=true"
18-
- "--v=10"
18+
- --secure-listen-address=0.0.0.0:8443
19+
- --upstream=http://127.0.0.1:8080
20+
- --tls-cert-file=/etc/tls/private/tls.crt
21+
- --tls-private-key-file=/etc/tls/private/tls.key
22+
- --logtostderr=true
23+
- --allow-paths=/metrics
1924
ports:
2025
- containerPort: 8443
21-
name: https
26+
name: metrics
27+
resources:
28+
limits:
29+
cpu: 500m
30+
memory: 128Mi
31+
requests:
32+
cpu: 1m
33+
memory: 15Mi
34+
securityContext:
35+
allowPrivilegeEscalation: false
36+
capabilities:
37+
drop:
38+
- ALL
39+
volumeMounts:
40+
- mountPath: /etc/tls/private
41+
name: kube-rbac-proxy-tls
42+
readOnly: true
2243
- name: manager
2344
args:
2445
- "--health-probe-bind-address=:8081"
2546
- "--metrics-bind-address=127.0.0.1:8080"
2647
- "--leader-elect"
48+
volumes:
49+
# Secret created by the service CA operator.
50+
# We assume that the Kubernetes service exposing the application's pods has the
51+
# "service.beta.openshift.io/serving-cert-secret-name: kube-rbac-proxy-tls"
52+
# annotation.
53+
- name: kube-rbac-proxy-tls
54+
secret:
55+
secretName: kube-rbac-proxy-tls

config/manager/manager.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v1
22
kind: Namespace
33
metadata:
44
labels:
5-
control-plane: argocd-operator
5+
control-plane: gitops-operator
66
name: system
77
---
88
apiVersion: apps/v1
@@ -11,16 +11,16 @@ metadata:
1111
name: controller-manager
1212
namespace: system
1313
labels:
14-
control-plane: argocd-operator
14+
control-plane: gitops-operator
1515
spec:
1616
selector:
1717
matchLabels:
18-
control-plane: argocd-operator
18+
control-plane: gitops-operator
1919
replicas: 1
2020
template:
2121
metadata:
2222
labels:
23-
control-plane: argocd-operator
23+
control-plane: gitops-operator
2424
spec:
2525
securityContext:
2626
runAsNonRoot: true

config/manifests/bases/gitops-operator.clusterserviceversion.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ metadata:
77
containerImage: quay.io/redhat-developer/gitops-operator
88
description: Enables teams to adopt GitOps principles for managing cluster configurations
99
and application delivery across hybrid multi-cluster Kubernetes environments.
10+
operatorframework.io/cluster-monitoring: "true"
11+
operatorframework.io/suggested-namespace: openshift-gitops-operator
1012
operators.openshift.io/infrastructure-features: '["disconnected"]'
1113
repository: https://github.com/redhat-developer/gitops-operator
1214
support: Red Hat

config/prometheus/kustomization.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
resources:
22
- monitor.yaml
3+
- role.yaml
4+
- rolebinding.yaml

config/prometheus/monitor.yaml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@ apiVersion: monitoring.coreos.com/v1
44
kind: ServiceMonitor
55
metadata:
66
labels:
7-
control-plane: argocd-operator
8-
name: controller-manager-metrics-monitor
7+
control-plane: gitops-operator
8+
name: metrics-monitor
99
namespace: system
1010
spec:
1111
endpoints:
12-
- path: /metrics
13-
port: https
12+
- bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
13+
path: /metrics
14+
interval: 30s
15+
port: metrics
1416
scheme: https
15-
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
1617
tlsConfig:
17-
insecureSkipVerify: true
18+
caFile: /etc/prometheus/configmaps/serving-certs-ca-bundle/service-ca.crt
19+
serverName: openshift-gitops-operator-metrics-service.openshift-gitops-operator.svc
1820
selector:
1921
matchLabels:
20-
control-plane: argocd-operator
22+
control-plane: gitops-operator

0 commit comments

Comments
 (0)