-
Notifications
You must be signed in to change notification settings - Fork 719
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
Kibana cannot connect to ES when using self signed certs that are not created by the operator itself #1494
Comments
I got it kinda working after a bunch of try and error and going through the source code now. What works was using this spec in Kibana: elasticsearch: {
certificateAuthorities: {
secretName: clusterInternalCaCertSecretName
},
url: `https://main-es-http:9200/`,
auth: {
secret: { name: 'main-es-elastic-user', key: 'elastic' }
}
} The magic sauce was basically that the Unfortunately it's not possible to only set Btw a few more other oddities:
Could you please make this a bit more intuitive and update the docs to include info about those settings? |
another thing that's missing from the docs is: |
I think the problem here is that we implicitly assume that the custom certificate you configure in Elasticsearch is also a CA or uses a public CA, which is of course a problematic assumption we need to reconsider. One workaround is to include the whole certificate chain in the
What happens here is that we create a
The reason this section is undocumented is that is meant for internal use by the operator only and the restrictions apply that you have to specify everything in that section and the operator might also overwrite what you specified at any time. The supported workaround for your issue is to use standard Kibana configuration in combination with a pod template. Example apiVersion: kibana.k8s.elastic.co/v1alpha1
kind: Kibana
metadata:
name: KIBANA_NAME
spec:
version: 7.2.0
nodeCount: 1
config:
elasticsearch.ssl.certificateAuthorities: /mnt/usr/ca.crt
podTemplate:
spec:
containers:
- name: kibana
volumeMounts:
- name: certs
mountPath: /mnt/usr
volumes:
- name: certs
secret:
secretName: clusterInternalCaCertSecretName
elasticsearchRef:
name: ES_NAME
Absolutely, I will create a doc issue for that. |
Yeah well, no public would issue certs for kubernetes' cluster internal DNS names like Thanks for your workaround suggestion, I'll try that out. |
We could inspect the user provided certificate secret to see if it contains a |
yeah that'd be great! |
Did Docs for the altNames get created? Several years later this is still an issue and confusing. I'd expect to be able to add a custom CA Cert, to the Http.tls. and give it multiple names (enterprise-search, kibana, dns & ips). Then when going to the kibana or ent external urls it should see the cert and say it's secure. This is not the case. |
We run a cluster internal CA (that is using cert-manager) which can issue certificates for all kind of applications in the cluster incl. elasticsearch. This cluster internal CA uses a self signed root certificate.
We use this Issuer to issue certificates to elasticsearch which works just fine.
E.g:
Remark: The code snippets below are pulumi code written in TypeScript, but I believe it's understandable enough how that would look in raw yaml
However when creating a Kibana instance with
The kibana instance fails to get into healthy mode and eventually fails continuously with:
As far as I can see it kibana does not mount anywhere the
ca.crt
that is contained in the elasticsearch secret (namedCERT_NAME
above) and could be used to establish trust.I also tried to setup a kibana without elasticsearchRef via the undocumented
elasticsearch
section of Kibana:but that fails with the same error.
NOTE: The ElasticSearch instance works fine. I can connect to it from other application or via port-forward as long as I import the
ca.crt
from our cluster internal CA (that root cert is also contained in the secret passed to the elasticsearch instance).Last but not least I believe the
spec.elasticsearch.auth.secret
is defined incorrectly in the CRD since it expects an object instead of a string / name.Also it should probably be called
secretName
to be consistent with other places.The text was updated successfully, but these errors were encountered: