Skip to content
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

Facilitate ECK integration with MutatingAdmissionWebhook #2418

Open
pebrc opened this issue Jan 13, 2020 · 1 comment
Open

Facilitate ECK integration with MutatingAdmissionWebhook #2418

pebrc opened this issue Jan 13, 2020 · 1 comment
Labels
discuss We need to figure this out

Comments

@pebrc
Copy link
Collaborator

pebrc commented Jan 13, 2020

Integrating with an ECK managed Elasticsearch cluster involves typically:

  • getting access to user credentials (username/password)
  • getting hold of the necessary TLS certificates

This can be done via two environment variables

          - name: ELASTICSEARCH_PASSWORD
            valueFrom:
              secretKeyRef:
                key: elastic
                name: my-cluster-es-elastic-user
          - name: ELASTICSEARCH_USER
            value: elastic

Plus a volume/volume mount for the certificates

          volumeMounts:
          - name: es-certs
            mountPath:  /mnt/elastic/tls.crt
            readOnly: true
            subPath: tls.crt
        volumes:
        - name: es-certs
          secret:
            secretName: my-cluster-es-http-certs-public

we could facilitate that kind of integration with a MutatingAdmissionWebhook that is triggered by a label or annotation and is able to inject these snippets into a Pod spec. Something like:
k8s.elastic.co/inject-cluster: my-cluster and optionally to give more control over the injected user: k8s.elastic.co/inject-user: my-custom-user or a set of user roles k8s.elastic.co/inject-roles: kibana_user,monitoring_user ECK would make sure the corresponding user exists and inject its credentials into the Pod spec. It would also make sure the secrets for password and certificates are available in the namespace of the annotated resource.

Concerns:

  • copying secrets that give access to Elasticsearch clusters around based on annotations or labels might be undesirable
  • complexity of introducing and managing yet another webhook

Benefits:

  • fairly generic way of 'integrating' with ECK managed Elasticsearch clusters, without implementing explicit support for every possible integration in ECK itself
@pebrc pebrc added the discuss We need to figure this out label Jan 13, 2020
@stasrelevanceai
Copy link

Hi, we personally right now copy certificate to other namespace where needed with terraform. Works very well on IaC provisioning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss We need to figure this out
Projects
None yet
Development

No branches or pull requests

2 participants