Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

Commit

Permalink
Update Container Insights Chart (#41)
Browse files Browse the repository at this point in the history
- Enable Service account annotation
- Update labels
- Update Docker image
  • Loading branch information
lawliet89 authored Jun 9, 2021
1 parent 7ff4a36 commit a161a1c
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 19 deletions.
2 changes: 1 addition & 1 deletion charts/eks-container-insights/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v1
appVersion: "1.0"
description: A Helm chart for EKS Container Insights
name: eks-container-insights
version: 0.3.4
version: 0.4.0
home: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Container-Insights-setup-logs.html
3 changes: 1 addition & 2 deletions charts/eks-container-insights/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ kind: ConfigMap
metadata:
name: {{ include "eks-container-insights.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
k8s-app: {{ include "eks-container-insights.name" . }}
labels: {{- include "eks-container-insights.labels" . | nindent 4 }}
data:
fluent.conf: |
@include containers.conf
Expand Down
16 changes: 9 additions & 7 deletions charts/eks-container-insights/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ kind: DaemonSet
metadata:
name: {{ include "eks-container-insights.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
k8s-app: {{ include "eks-container-insights.name" . }}
labels: {{- include "eks-container-insights.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
Expand All @@ -14,25 +13,26 @@ spec:
metadata:
labels:
k8s-app: {{ include "eks-container-insights.name" . }}
{{- include "eks-container-insights.labels" . | nindent 8 }}
annotations:
configHash: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
spec:
{{- if .Values.priorityClassName }}
priorityClassName: "{{ .Values.priorityClassName }}"
{{- end }}
serviceAccountName: {{ .Values.serviceAccountName }}
serviceAccountName: {{ .Values.serviceAccount.name }}
terminationGracePeriodSeconds: 30
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- toYaml .Values.nodeSelector | nindent 8 }}
{{- end }}
{{ if .Values.affinity }}
affinity:
{{ toYaml .Values.affinity | indent 8 }}
{{- toYaml .Values.affinity | nindent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
{{- toYaml .Values.tolerations | nindent 8 }}
{{- end }}
# Because the image's entrypoint requires to write on /fluentd/etc but we mount configmap there which is read-only,
# this initContainers workaround or other is needed.
Expand Down Expand Up @@ -67,10 +67,12 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: AWS_STS_REGIONAL_ENDPOINTS
value: regional
# END Archive cluster logs to S3
{{- end }}
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: config-volume
mountPath: /config-volume
Expand Down
10 changes: 6 additions & 4 deletions charts/eks-container-insights/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ .Values.serviceAccountName }}-role
name: {{ .Values.serviceAccount.name }}-role
labels: {{- include "eks-container-insights.labels" . | nindent 4 }}
rules:
- apiGroups: [""]
resources:
Expand All @@ -14,12 +15,13 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ .Values.serviceAccountName }}-role-binding
name: {{ .Values.serviceAccount.name }}-role-binding
labels: {{- include "eks-container-insights.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ .Values.serviceAccountName }}-role
name: {{ .Values.serviceAccount.name }}-role
subjects:
- kind: ServiceAccount
name: {{ .Values.serviceAccountName }}
name: {{ .Values.serviceAccount.name }}
namespace: {{ .Release.Namespace }}
7 changes: 6 additions & 1 deletion charts/eks-container-insights/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.serviceAccountName }}
name: {{ .Values.serviceAccount.name }}
namespace: {{ .Release.Namespace }}
labels: {{- include "eks-container-insights.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
6 changes: 4 additions & 2 deletions charts/eks-container-insights/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ nameOverride: ""
fullnameOverride: ""

priorityClassName: "system-node-critical"
serviceAccountName: fluentd
serviceAccount:
name: fluentd
annotations: {}

image: basisai/eks-container-insights
imageTag: v1.7.3
imageTag: v1.12.4

initImage: busybox
initImageTag: 1.32.0
Expand Down
4 changes: 2 additions & 2 deletions dockerfiles/eks-container-insights/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM fluent/fluentd-kubernetes-daemonset:v1.7.3-debian-cloudwatch-1.0
FROM fluent/fluentd-kubernetes-daemonset:v1.12.4-debian-cloudwatch-amd64-1.3

RUN gem install fluent-plugin-s3 -v 1.2.1 --no-document
RUN gem install fluent-plugin-s3 -v 1.6.0 --no-document

0 comments on commit a161a1c

Please sign in to comment.