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

Lack of flexibility to install addons specific to your OS #116

Open
raelyz opened this issue Oct 22, 2024 · 1 comment
Open

Lack of flexibility to install addons specific to your OS #116

raelyz opened this issue Oct 22, 2024 · 1 comment

Comments

@raelyz
Copy link

raelyz commented Oct 22, 2024

{{- if .Values.agent.enabled }}
{{- $clusterName := .Values.clusterName | required ".Values.clusterName is required." -}}
{{- $region := .Values.region | required ".Values.region is required." -}}
{{- $config := `{"logs":{"metrics_collected":{"application_signals":{}}},"traces":{"traces_collected":{"application_signals":{}}}}` | fromJson -}}
apiVersion: cloudwatch.aws.amazon.com/v1alpha1
kind: AmazonCloudWatchAgent
metadata:
  name: {{ template "cloudwatch-agent.name" . }}-windows
  namespace: {{ .Release.Namespace }}
spec:
  podSecurityContext:
    windowsOptions:
      runAsUserName: "NT AUTHORITY\\System"
  image: {{ template "cloudwatch-agent.image" . }}
  mode: daemonset
  serviceAccount: {{ template "cloudwatch-agent.serviceAccountName" . }}
  nodeSelector:
    kubernetes.io/os: windows
  config: {{ include "cloudwatch-agent.modify-config" (merge (dict "Config" $config) .) }}
  {{- with .Values.agent.resources }}
  resources: {{- toYaml . | nindent 4}}
  {{- end }}
  env:
    - name: K8S_NODE_NAME
      valueFrom:
        fieldRef:
          fieldPath: spec.nodeName
    - name: HOST_IP
      valueFrom:
        fieldRef:
          fieldPath: status.hostIP
    - name: HOST_NAME
      valueFrom:
        fieldRef:
          fieldPath: spec.nodeName
    - name: K8S_NAMESPACE
      valueFrom:
        fieldRef:
          fieldPath: metadata.namespace
  {{- with .Values.tolerations }}
  tolerations: {{- toYaml . | nindent 2}}
  {{- end }}
{{- end }}

If i'm not wrong all the daemonsets are enabled through the agent.enabled flag, this causes my helm installation on EKS to include a lot of bloat.

Is this intentional? I only wanted to install those relevant for Linux for example but I get the windows CRDs installed to my cluster as an unintended side effect.

@sky333999
Copy link
Contributor

The main reason its structured the way its currently is due to the fact that we cannot pre-determine what kind of nodes would be added to a cluster from the helm chart. Hence we create both a linux and a windows daemonset with corresponding nodeSelectors enforcing only the appropriate pod runs on a particular node.

So the bloat here is really the additional CRD/daemonset resources on API server/etcd, but note that it wont spin up any unnecessary pods nor consume any actual resources.

Perhaps we could expose a helm values override to explicitly specify the OS if someone wants to avoid even creating these resources.

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

No branches or pull requests

2 participants