-
Notifications
You must be signed in to change notification settings - Fork 402
*: Enable etcd monitoring by default #239
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
Changes from all commits
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 |
|---|---|---|
|
|
@@ -46,6 +46,8 @@ const ( | |
| apiAuthenticationConfigMap = "kube-system/extension-apiserver-authentication" | ||
| kubeletServingCAConfigMap = "openshift-config-managed/kubelet-serving-ca" | ||
| prometheusAdapterTLSSecret = "openshift-monitoring/prometheus-adapter-tls" | ||
|
|
||
| prometheusEtcdCertSecretName = "kube-etcd-client-certs" | ||
| ) | ||
|
|
||
| type Operator struct { | ||
|
|
@@ -382,5 +384,23 @@ func (o *Operator) Config(key string) *manifests.Config { | |
| glog.Warningf("Error loading proxy from API. Proceeding without it: %v", err) | ||
| } | ||
|
|
||
| s, err := o.client.GetSecret(o.namespace, prometheusEtcdCertSecretName) | ||
| if err != nil { | ||
| glog.Warningf("Error loading etcd certificates for Prometheus. Proceeding with etcd disabled. Error: %v", err) | ||
|
Contributor
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 guess we could do an early return here, but maybe this function grows in the future, so this is also fine with me.
Contributor
Author
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. Agreed, I think the early return would cause future problems. |
||
| } | ||
| if err == nil { | ||
| caContent, caFound := s.Data["etcd-client-ca.crt"] | ||
| certContent, certFound := s.Data["etcd-client.crt"] | ||
| keyContent, keyFound := s.Data["etcd-client.key"] | ||
|
|
||
| if caFound && len(caContent) > 0 && | ||
| certFound && len(certContent) > 0 && | ||
| keyFound && len(keyContent) > 0 { | ||
|
|
||
| trueBool := true | ||
| c.EtcdConfig.Enabled = &trueBool | ||
| } | ||
| } | ||
|
|
||
| return c | ||
| } | ||
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.
Is this still necessary, given that
EtcdConfiginConfigis disabled anyways?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.
I intentionally left this to modify the least amount of code, but also seems like a reasonable strategy to me. Essentially what's happening here is that when the right certificates are present in the
Secret, then this field gets set to enabled.