-
Notifications
You must be signed in to change notification settings - Fork 122
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
Adding kustomize templates for k8s onboarding #4754
base: main
Are you sure you want to change the base?
Conversation
This pull request does not have a backport label. Could you fix it @gizas? 🙏
NOTE: |
kind: DaemonSet | ||
metadata: | ||
name: elastic-agent | ||
namespace: kube-system |
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.
Wonder if all namespace
fields should be removed from all files apart from the kustomization.yaml
? The value gets correctly overwritten anyway, but it is not doing anything anymore.
@@ -28,19 +28,21 @@ spec: | |||
# Uncomment if using hints feature |
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.
Maybe we could have another base for hints, instead of leaving it in a comment here.
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.
As we discuss lets tackle this in another story
I am a bit confused. What is the different between |
|
||
Users can clone this repository to use the provided kustomize templates. | ||
|
||
For *Managed Elastic Agent*, please update the following secrets inside main kustomization.yaml: |
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.
For *Managed Elastic Agent*, please update the following secrets inside main kustomization.yaml: | |
For *Managed Elastic Agent*, please update the following secrets inside main [kustomization.yaml](./elastic-agent-managed/kustomization.yaml): |
- api_key=${enrollment_token} | ||
``` | ||
|
||
For *Standalone Elastic Agent*, please update the following secrets inside main [kustomization.yaml](./elastic-agent-managed/kustomization.yaml): |
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.
For *Standalone Elastic Agent*, please update the following secrets inside main [kustomization.yaml](./elastic-agent-managed/kustomization.yaml): | |
For *Standalone Elastic Agent*, please update the following secrets inside main [kustomization.yaml](./elastic-agent-standalone/kustomization.yaml): |
|
||
Managed Elastic Agent: | ||
|
||
```bash |
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.
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 think a more intuitive approach would be to change the kustomization.yaml
file directly. So the user would see this file in Kibana:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: kube-system
images:
- name: docker.elastic.co/beats/elastic-agent
newTag: ${IMAGE_TAG}
secretGenerator:
- name: elastic-agent-creds
literals:
- host=${ES_HOST}
- enrollment_token=${ENROLLMENT_TOKEN}
resources:
- ./base # <------------ This would need to point to our GitHub directory
- https://github.com/kubernetes/kube-state-metrics
patches:
- path: environmental-variables-remove.yaml
- target:
group: apps
version: v1
kind: DaemonSet
name: elastic-agent
path: fleet-enrollment-token-patch.yaml
And all ${...}
variables should have literal values by that point.
I think the problem with that command is that it still requires us to evaluate base64
of the variables and we end up not making use of the literal of the secret map. And then the sed
is not easy to read. What do you think?
Quality Gate passedIssues Measures |
What does this PR do?
WHAT: Introduces the onboarding templates of kustomize for k8s observability
WHY: #4657
Checklist
./changelog/fragments
using the changelog toolHow to test this PR locally
cd elastic-agent-kustomize/onboarding/default kubectl apply -k elastic-agent-managed or kubectl apply -k elastic-agent-standalone
Examples of online references:
Testing for onboarding procedure
Managed:
Standalone
Eg.
Note: API_KEY should be given as bas64 encoded values from Kibana
Base 64 encoding decding:
Images
Successful enrollement in managed
Successful Installation of kube-state-metrics and
Related issues