Skip to content

Commit 182039b

Browse files
committed
operator: remove metrics server
1 parent 3ba0a73 commit 182039b

File tree

5 files changed

+2
-113
lines changed

5 files changed

+2
-113
lines changed

cmd/machine-config-operator/start.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,15 @@ var (
2525
}
2626

2727
startOpts struct {
28-
kubeconfig string
29-
imagesFile string
30-
promMetricsURL string
28+
kubeconfig string
29+
imagesFile string
3130
}
3231
)
3332

3433
func init() {
3534
rootCmd.AddCommand(startCmd)
3635
startCmd.PersistentFlags().StringVar(&startOpts.kubeconfig, "kubeconfig", "", "Kubeconfig file to access a remote cluster (testing only)")
3736
startCmd.PersistentFlags().StringVar(&startOpts.imagesFile, "images-json", "", "images.json file for MCO.")
38-
startCmd.PersistentFlags().StringVar(&startOpts.promMetricsURL, "metrics-listen-address", "127.0.0.1:8797", "Listen address for prometheus metrics listener")
3937
}
4038

4139
func runStartCmd(_ *cobra.Command, _ []string) {
@@ -45,8 +43,6 @@ func runStartCmd(_ *cobra.Command, _ []string) {
4543
// This is 'main' context that we thread through the controller context and
4644
// the leader elections. Cancelling this is "stop everything, we are shutting down".
4745
runContext, runCancel := context.WithCancel(context.Background())
48-
stopCh := make(chan struct{})
49-
defer close(stopCh)
5046

5147
// To help debugging, immediately log version
5248
klog.Infof("Version: %s (Raw: %s, Hash: %s)", version.ReleaseVersion, version.Raw, version.Hash)
@@ -60,9 +56,6 @@ func runStartCmd(_ *cobra.Command, _ []string) {
6056
klog.Fatalf("error creating clients: %v", err)
6157
}
6258

63-
// start metrics listener
64-
go ctrlcommon.StartMetricsListener(startOpts.promMetricsURL, stopCh, operator.RegisterMCOMetrics)
65-
6659
run := func(ctx context.Context) {
6760
go common.SignalHandler(runCancel)
6861
ctrlctx := ctrlcommon.CreateControllerContext(ctx, cb)

install/0000_80_machine-config_00_service.yaml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,5 @@
11
apiVersion: v1
22
kind: Service
3-
metadata:
4-
name: machine-config-operator
5-
namespace: openshift-machine-config-operator
6-
labels:
7-
k8s-app: machine-config-operator
8-
annotations:
9-
include.release.openshift.io/ibm-cloud-managed: "true"
10-
include.release.openshift.io/self-managed-high-availability: "true"
11-
include.release.openshift.io/single-node-developer: "true"
12-
service.beta.openshift.io/serving-cert-secret-name: mco-proxy-tls
13-
spec:
14-
type: ClusterIP
15-
selector:
16-
k8s-app: machine-config-operator
17-
ports:
18-
- name: metrics
19-
port: 9001
20-
protocol: TCP
21-
---
22-
apiVersion: v1
23-
kind: Service
243
metadata:
254
name: machine-config-controller
265
namespace: openshift-machine-config-operator

install/0000_80_machine-config_04_deployment.yaml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -43,30 +43,6 @@ spec:
4343
volumeMounts:
4444
- name: images
4545
mountPath: /etc/mco/images
46-
- name: kube-rbac-proxy
47-
image: placeholder.url.oc.will.replace.this.org/placeholdernamespace:kube-rbac-proxy
48-
ports:
49-
- containerPort: 9001
50-
name: metrics
51-
protocol: TCP
52-
args:
53-
- --secure-listen-address=0.0.0.0:9001
54-
- --config-file=/etc/kube-rbac-proxy/config-file.yaml
55-
- --tls-cipher-suites=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305
56-
- --upstream=http://127.0.0.1:8797
57-
- --logtostderr=true
58-
- --tls-cert-file=/etc/tls/private/tls.crt
59-
- --tls-private-key-file=/etc/tls/private/tls.key
60-
resources:
61-
requests:
62-
cpu: 20m
63-
memory: 50Mi
64-
terminationMessagePolicy: FallbackToLogsOnError
65-
volumeMounts:
66-
- mountPath: /etc/tls/private
67-
name: proxy-tls
68-
- mountPath: /etc/kube-rbac-proxy
69-
name: auth-proxy-config
7046
serviceAccountName: machine-config-operator
7147
nodeSelector:
7248
node-role.kubernetes.io/master: ""
@@ -91,10 +67,4 @@ spec:
9167
- name: images
9268
configMap:
9369
name: machine-config-operator-images
94-
- name: proxy-tls
95-
secret:
96-
secretName: mco-proxy-tls
97-
- configMap:
98-
name: kube-rbac-proxy
99-
name: auth-proxy-config
10070

install/0000_80_machine-config_04_kube_rbac_proxy_config.yaml

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

install/0000_90_machine-config_00_servicemonitor.yaml

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,5 @@
11
apiVersion: monitoring.coreos.com/v1
22
kind: ServiceMonitor
3-
metadata:
4-
name: machine-config-operator
5-
namespace: openshift-machine-config-operator
6-
labels:
7-
k8s-app: machine-config-operator
8-
annotations:
9-
include.release.openshift.io/self-managed-high-availability: "true"
10-
include.release.openshift.io/single-node-developer: "true"
11-
spec:
12-
endpoints:
13-
- interval: 30s
14-
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
15-
port: metrics
16-
scheme: https
17-
path: /metrics
18-
relabelings:
19-
- action: replace
20-
regex: ;(.*)
21-
replacement: $1
22-
separator: ";"
23-
sourceLabels:
24-
- node
25-
- __meta_kubernetes_pod_node_name
26-
targetLabel: node
27-
tlsConfig:
28-
caFile: /etc/prometheus/configmaps/serving-certs-ca-bundle/service-ca.crt
29-
serverName: machine-config-operator.openshift-machine-config-operator.svc
30-
namespaceSelector:
31-
matchNames:
32-
- openshift-machine-config-operator
33-
selector:
34-
matchLabels:
35-
k8s-app: machine-config-operator
36-
---
37-
apiVersion: monitoring.coreos.com/v1
38-
kind: ServiceMonitor
393
metadata:
404
name: machine-config-controller
415
namespace: openshift-machine-config-operator

0 commit comments

Comments
 (0)