-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Testing Metricbeat/Filebeat k8s manifests on Openshift #17516
Comments
Pinging @elastic/integrations-platforms (Team:Platforms) |
Heads up on this. After #17606 was merged the manifests can be successfully deployed on Openshift (minishift v1.34.2+83ebaab) except for the Metricbeat and Filebeat docs seem to be updated. So maybe the testing can be considered successful for now on |
Awesome work here! +1 to creating a different issue for I think this should also be a good opportunity to add some ideas here on what can we do for Openshift on top of our vanilla kubernetes monitoring. |
Testing on GCP installationBuilding a cluster with Installer Version:
FilebeatVersion: Daemonset manifestTesting passed: ✅
MetricbeatVersion: Deployment manifestTesting passed: ✅ This manifest launches Metricbeat as a k8s Deployment and its target is to collect metrics from
Daemonset manifestTesting passed: Partially ✅
Kubelet API issue: curl -H "Authorization: Bearer $token" --cacert /var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt -v https://${NODE_NAME}:10250/stats/summary
* About to connect() to ocp-be-c5kjr-w-b-jhqvn.c.elastic-observability.internal port 10250 (#0)
* Trying 10.0.32.3...
* Connected to ocp-be-c5kjr-w-b-jhqvn.c.elastic-observability.internal (10.0.32.3) port 10250 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* CAfile: /var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt
CApath: none
* Server certificate:
* subject: CN=system:node:ocp-be-c5kjr-w-b-jhqvn.c.elastic-observability.internal,O=system:nodes
* start date: Apr 16 09:07:00 2020 GMT
* expire date: May 16 08:58:24 2020 GMT
* common name: system:node:ocp-be-c5kjr-w-b-jhqvn.c.elastic-observability.internal
* issuer: CN=kube-csr-signer_@1587027822
* NSS error -8179 (SEC_ERROR_UNKNOWN_ISSUER)
* Peer's Certificate issuer is not recognized.
* Closing connection 0
curl: (60) Peer's Certificate issuer is not recognized.
More details here: http://curl.haxx.se/docs/sslcerts.html
curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.
[root@ocp-be-c5kjr-w-b-jhqvn metricbeat]# env | grep NODE_NAME
NODE_NAME=ocp-be-c5kjr-w-b-jhqvn.c.elastic-observability.internal While on minishift:
I think this has to do with the way the the k8s cluster is setup, for instance there have been similar certificate issues with |
Testing seems to be completed. So far docs for Filebeat and Metricbet seem to be updated and someone can deploy Metricbeat and Filebeat on Openshift without significant issues. In order to consider it done for I propose:
since it seem to work on minishift out of the box but not on GCP installation. What would be the best option to have it documented? @elastic/integrations-platforms would like a review on the above proposal. |
Is the CA available in other place for GCP installations? I think we could add a comment about this in the manifest, as we have the comment for the |
@jsoriano the secrets' directory of [root@ocp-be-c5kjr-w-b-jhqvn metricbeat]# ls /var/run/secrets/kubernetes.io/serviceaccount/
ca.crt namespace service-ca.crt token Trying to access the API manually with:
I get:
|
@ChrsMark is it possible that the CA is available in other place (not as a Kubernetes secret, but in some GCP endpoint)? Did you try to use the other Though according to this unanswered question this may be a common issue 🤔 https://access.redhat.com/discussions/4841441 |
After digging into it along with @jsoriano's help it comes out that the proper CA to use (Openshift GCP installer specific) is the one that can be found in
Steps to fix the issue:
@exekias wondering if we should add it in the docs at https://www.elastic.co/guide/en/beats/metricbeat/master/running-on-kubernetes.html as an extra section-note (since we have this info) and make the comment at https://github.com/elastic/beats/blob/master/deploy/kubernetes/metricbeat-kubernetes.yaml#L83 more flexible mentioning that CA can be available in confifmaps too according to each specific installation approach. |
Since the testing has been completed and all the relevant content has been updated in docs and manifests we can close it. This testing should be streamlined in the future, as issued on #17962. |
Meta issue to keep track of testing process/results of mb/fb k8s manifests on Openshift.
Related to #13054
Testing env:
Metricbeat
Version:
docker.elastic.co/beats/metricbeat:7.6.2
All the testing follows the instructions of:
https://www.elastic.co/guide/en/beats/metricbeat/current/running-on-kubernetes.html#_red_hat_openshift_configuration
Deployment manifest
Testing passed: ✅
This manifest launches Metricbeat as a k8s Deployment and its target is to collect metrics from
kube-state-metrics
.Having
kube-state-metrics
deployed it works out of the box. Events are populated for at least the metricsets below:Daemonset manifest
Testing passed: ❌
system
module: ✅kubernetes
module (kubelet API): ✅kube-proxy
: ❌This manifest launches Metricbeat as a k8s Daemonset to all k8s nodes and its target is to collect system metrics using
system
module, kubelet metrics by accessing kubelet API as well as metrics from kube-proxy.Issues:
access to data volume
Resolved: ✅ by removing
beats/deploy/kubernetes/metricbeat-kubernetes.yaml
Line 152 in ff68af6
This could also be resolved by adding
privileged: true
undersecurityContext
. Would this be sth that we want? cc @jsoriano @exekiasPull request: #17606
unable to access Kubelet api
Resolved: ✅ by using
NODE_NAME
. It is already upstream with #17469unable to retrieve metrics from kube-proxy
Notes:
kube-proxy
pod runs inkube-proxy
namespace and notkube-system
. Not that it would be the issue since we are trying to access host's network.Info:
Resolved: ❌, we have to remove it from the manifest since it has not impact.
Result:
"resolving" the issues above, everything works as expected:
The above could be a validation check for CI.
Filebeat
Version:
docker.elastic.co/beats/filebeat:7.6.2
All the testing follows the instructions of: https://www.elastic.co/guide/en/beats/filebeat/master/running-on-kubernetes.html
Daemonset manifest
Note that for
minishift
the default docker logging driver isjournald
. In order to by able to collect logs with Filebeat one need to start minishift with:minishift start --docker-opt log-driver=json-file
Daemonset manifest
Testing passed: ✅
add_kubernetes_metadata
enriches the events with k8s metadata.The text was updated successfully, but these errors were encountered: