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

feat(kubelet): Create an agent container in the kubelet pod only #944

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

tormodmacleod
Copy link

@tormodmacleod tormodmacleod commented Nov 15, 2023

Description

This provides the user with the ability to create only a single pod containing an infrastructure agent container when combined with kubelet.enabled == false and ksm.enabled == false.

This is useful when you already have your kubernetes infrastructure monitored by newrelic at the infrastructure layer and you want to retrieve the length of some redis keys which are relevant at the application layer.

For more details of the motivation for this change please see #943

Fixes: #943

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • New feature / enhancement (non-breaking change which adds functionality)
  • Security fix
  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • Add changelog entry following the contributing guide
  • Documentation has been updated
  • This change requires changes in testing:
    • unit tests
    • E2E tests

I tested this locally and everything works as it ought to

$ helm install -n newrelic-infrastructure tormod ./newrelic-infrastructure/ --set ksm.enabled=false --set controlPlane.enabled=false --set kubelet.agentOnly=false

$ kubectl -n newrelic-infrastructure get all
NAME                             READY   STATUS    RESTARTS   AGE
pod/tormod-nrk8s-kubelet-fblcd   2/2     Running   0          19s
pod/tormod-nrk8s-kubelet-fjn45   2/2     Running   0          19s

NAME                                  DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
daemonset.apps/tormod-nrk8s-kubelet   2         2         2       2            2           <none>          20s

$ kubectl -n newrelic-infrastructure get configmaps
NAME                            DATA   AGE
kube-root-ca.crt                1      22h
tormod-nrk8s-agent-kubelet      1      44s
tormod-nrk8s-integrations-cfg   1      44s
tormod-nrk8s-kubelet            1      44s

$ helm uninstall -n newrelic-infrastructure tormod
release "tormod" uninstalled
$ helm install -n newrelic-infrastructure tormod ./newrelic-infrastructure/ --set ksm.enabled=false --set controlPlane.enabled=false --set kubelet.agentOnly=true

$ kubectl -n newrelic-infrastructure get all
NAME                                      READY   STATUS    RESTARTS   AGE
pod/tormod-nrk8s-agent-7bdd794558-2c9zq   1/1     Running   0          18s

NAME                                 READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/tormod-nrk8s-agent   1/1     1            1           18s

NAME                                            DESIRED   CURRENT   READY   AGE
replicaset.apps/tormod-nrk8s-agent-7bdd794558   1         1         1       18s

$ kubectl -n newrelic-infrastructure get configmaps
NAME                            DATA   AGE
kube-root-ca.crt                1      22h
tormod-nrk8s-agent-kubelet      1      48s
tormod-nrk8s-integrations-cfg   1      48s

$ helm uninstall -n newrelic-infrastructure tormod
release "tormod" uninstalled

enabling agentOnly mode should create only an 'agent' container within
the kubelet pod
do not create or mount this configmap. it is only used by the kubelet
container
naming a pod as 'kubelet' kind of suggests that it's a daemonset. if
we're running in agentOnly mode then there is only a single pod
containing an infrastructure agent container. renaming this so as not to
mislead or confuse the user
include some information in values.yaml as to what agentOnly controls
@CLAassistant
Copy link

CLAassistant commented Nov 15, 2023

CLA assistant check
All committers have signed the CLA.

@tormodmacleod tormodmacleod marked this pull request as ready for review November 15, 2023 14:24
@tormodmacleod tormodmacleod requested a review from a team November 15, 2023 14:24
@tormodmacleod tormodmacleod changed the title feat(kubelet): Create an agent pod only feat(kubelet): Create an agent container in the kubelet pod only Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

I only want an Infrastructure Agent
2 participants