Skip to content

add autopilot support #46

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/cortex-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ Even when using `--reuse-values` (which uses the values of the previous installa
| `platform.talos` | Support for TalOS platform (Required when installing on TalOS) | Since 1.5.0, agent >= 8.2
| `platform.gcos` | Support for GCOS (Google Container-Optimized OS) platform (Required when installing on GCOS) | Since 1.5.0, agent >= 8.2
| `platform.bottlerocket` | Support for BottlerocketOS platform (Required when installing on BottlerocketOS) | Since 1.6.3, agent >= 8.3
| `platform.autopilot` | Support for Autopilot platform (Required when installing on GKE Autopilot cluster) | Since 1.8.0, agent >= 8.9
| `agent.clusterName` | Name of the kuberenets cluster, will be used as part of the information sent to the server | Since 1.5.0, agent >= 8.2
| `namespace.name` | Name of the namespace the agent resides on | Since 1.6.0
| `namespace.create` | Create/Don't create namespace for the agent | Since 1.6.0
Expand Down
12 changes: 12 additions & 0 deletions charts/cortex-agent/templates/cortex-xdr-synchronizer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.platform.autopilot }}
apiVersion: auto.gke.io/v1
kind: AllowlistSynchronizer
metadata:
name: cortex-xdr-synchronizer
annotations:
helm.sh/hook: "pre-install,pre-upgrade"
"helm.sh/hook-weight": "-1"
spec:
allowlistPaths:
- Palo-Alto-Networks/cortex-agent/*
{{- end }}
15 changes: 14 additions & 1 deletion charts/cortex-agent/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ spec:

containers:
- name: cortex-agent
{{- if .Values.platform.autopilot }}
image: {{ .Values.daemonset.image.url }}
{{- else }}
image: {{ .Values.daemonset.image.repository }}:{{ .Values.daemonset.image.tag }}
{{- end }}

imagePullPolicy: {{ .Values.daemonset.image.pullPolicy }}

securityContext:
Expand All @@ -71,7 +76,7 @@ spec:
- SYS_ADMIN
- SYSLOG
- SYS_CHROOT
{{- if not .Values.platform.talos }}
{{- if not (or .Values.platform.talos .Values.platform.autopilot .Values.platform.bottlerocket) }}
- SYS_MODULE
{{- end }}
- SYS_PTRACE
Expand Down Expand Up @@ -106,6 +111,10 @@ spec:
value: {{ .Values.agent.clusterName | quote }}
- name: XDR_VAR_LOG_HOST_PATH
value: {{ include "cortex-xdr.XdrVarLogHostPath" . | quote }}
{{- if .Values.platform.autopilot }}
- name: XDR_CLUSTER_TYPE
value: "autopilot"
{{- end }}

volumeMounts:

Expand All @@ -116,8 +125,10 @@ spec:
- name: var-log
mountPath: /var/log

{{- if not (or .Values.platform.talos .Values.platform.autopilot .Values.platform.bottlerocket) }}
- name: host-km-directory
mountPath: /lib/modules
{{- end }}

- name: pod-info
mountPath: /var/run/pod-info
Expand Down Expand Up @@ -150,10 +161,12 @@ spec:
path: {{ include "cortex-xdr.XdrVarLogHostPath" . | quote }}
type: DirectoryOrCreate

{{- if not .Values.platform.autopilot }}
- name: host-km-directory
hostPath:
path: /lib/modules
type: Directory
{{- end }}

- name: pod-info
downwardAPI:
Expand Down
8 changes: 7 additions & 1 deletion charts/cortex-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ platform:
gcos: false
# Deploy on bottlerocket platform
bottlerocket: false
# Deploy on autopilot cluster
autopilot: false

rbac:
# create/don't create Cluster Role and Cluster Role Bindings
Expand Down Expand Up @@ -92,15 +94,19 @@ daemonset:

tag: "latest"

# for autopilot
url: ""

# These values are the recommended values for cortex agent
# and are not recommended to change!
resources:
limits:
cpu: "1500m"
memory: "2Gi"
ephemeral-storage: "10Gi"
requests:
cpu: "200m"
memory: "600Mi"
ephemeral-storage: "5Gi"
selinuxOptionsSpcT: false

namespace:
Expand Down
Loading