Comments (6)
RKE2 has always used EC keys. It sounds like the version of curl (or the version of openssl your curl is linked against) doesn't include support for EC keys. The request works for me - although I will note that the metrics are not served on the port you're trying:
root@k3s-server-1:/# curl -vs https://localhost:2379/metrics --cacert /var/lib/rancher/k3s/server/tls/etcd/server-ca.crt --cert /var/lib/rancher/k3s/server/tls/etcd/client.crt --key /var/lib/rancher/k3s/server/tls/etcd/client.key
* Trying 127.0.0.1:2379...
* Connected to localhost (127.0.0.1) port 2379 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* CAfile: /var/lib/rancher/k3s/server/tls/etcd/server-ca.crt
* CApath: /etc/ssl/certs
* TLSv1.0 (OUT), TLS header, Certificate Status (22):
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS header, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS header, Finished (20):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Request CERT (13):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.2 (OUT), TLS header, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.3 (OUT), TLS handshake, Certificate (11):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.3 (OUT), TLS handshake, CERT verify (15):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN, server accepted to use h2
* Server certificate:
* subject: CN=etcd-server
* start date: May 13 16:54:52 2024 GMT
* expire date: May 13 16:54:52 2025 GMT
* subjectAltName: host "localhost" matched cert's "localhost"
* issuer: CN=etcd-server-ca@1715619292
* SSL certificate verify ok.
* Using HTTP2, server supports multiplexing
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* Using Stream ID: 1 (easy handle 0x615150141eb0)
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
> GET /metrics HTTP/2
> Host: localhost:2379
> user-agent: curl/7.81.0
> accept: */*
>
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* Connection state changed (MAX_CONCURRENT_STREAMS == 4294967295)!
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
< HTTP/2 415
< content-type: application/grpc
< grpc-status: 3
< grpc-message: invalid gRPC request content-type ""
<
* Connection #0 to host localhost left intact
root@k3s-server-1:/# curl -s https://localhost:2382/metrics --cacert /var/lib/rancher/k3s/server/tls/etcd/server-ca.crt --cert /var/lib/rancher/k3s/server/tls/etcd/client.crt --key /var/lib/rancher/k3s/server/tls/etcd/client.key | grep etcd_server_version
# HELP etcd_server_version Which version is running. 1 for 'server_version' label with current version.
# TYPE etcd_server_version gauge
etcd_server_version{server_version="3.5.9"} 1
from k3s.
What about prometheus? I must update de version so?
regards,
from k3s.
I don't know. Perhaps you need to change the scrape port in your prometheus config?
from k3s.
# curl https://localhost:2379/metrics --cacert /var/lib/rancher/k3s/server/tls/etcd/server-ca.crt --cert /var/lib/rancher/k3s/server/tls/etcd/client.crt --key /var/lib/rancher/k3s/server/tls/etcd/client.key
curl: (58) unable to load client key: -8178 (SEC_ERROR_BAD_KEY)
[root@master01 ~]# curl --version
curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.44 zlib/1.2.7 libidn/1.28 libssh2/1.8.0
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz unix-sockets
from k3s.
I can't help you if your version of curl or openssl doesn't support ec keys. You'll have to upgrade, or upgrade to a newer distro release that has a modern version of curl and openssl. I don't understand what this has to do with scraping things via Prometheus, either... prometheus doesn't use curl.
root@k3s-server-1:/# curl --version
curl 7.81.0 (x86_64-pc-linux-gnu) libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.17
Release-Date: 2022-01-05
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets zstd
root@k3s-server-1:/# cat /var/lib/rancher/k3s/server/tls/etcd/client.key
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIPEfgcXhWfJrnmjZ2KrJUQ4LKXUJJB/9m5reD34LLL4PoAoGCCqGSM49
AwEHoUQDQgAEQ8+TLFmZngs7rEIcj09V3uWwRbpVTR6rMz89HAmXPOS+cC8yLaZn
CALFl1Z4I38bTvrIpY50l+JLDJJ8cd/mRg==
-----END EC PRIVATE KEY-----
from k3s.
Thanks Brandon!
Very Good!
from k3s.
Related Issues (20)
- Update etcd to >= v3.5.13 HOT 1
- Improve documentation for Tailscale + K3s with an example ACL HOT 1
- Pod priority enforcement without killing lower priority pods
- netpol controller does not honor debug: true HOT 1
- Availability of StructuredAuthenticationConfiguration in 1.30.0-k3s HOT 1
- k3s 使用mysql 8.0.20 版本存储kine表,启动k3s后,mysql进程会反复重启,k3s报错连接被拒绝 HOT 1
- Image pulls from embedded registry fail if --bind-address is set (and not 127.0.0.1) HOT 6
- missing kernel config check HOT 1
- k3s-agent Fails to start with with embedded registry and kill entire OS HOT 7
- Update kube-router to v2.1.2 HOT 1
- unable to get REST mapping for extensions HOT 1
- anget node working but access fail on anget node HOT 3
- container didn't get the environment var from CONTAINERD_XXX HOT 1
- Install script `INSTALL_K3S_PR` support does not work if CI has run more than once HOT 2
- Spegel mirror returns 500 instead of 404 on unavailable images HOT 1
- Bump containerd to >= v1.7.17
- Bump etcd to >= v3.5.13 HOT 1
- Add client certificate auth support to HelmChart controller / job image HOT 1
- k3s spontaneous implosion HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from k3s.