Skip to content

Instantly share code, notes, and snippets.

@quasi-coherent
Created October 5, 2022 00:56
Show Gist options
  • Save quasi-coherent/705823f5844451e46336c5eb79240925 to your computer and use it in GitHub Desktop.
Save quasi-coherent/705823f5844451e46336c5eb79240925 to your computer and use it in GitHub Desktop.
---
# Source: elastic-agent/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: elastic-agent
labels:
helm.sh/chart: elastic-agent-0.1.0
app.kubernetes.io/name: elastic-agent
app.kubernetes.io/instance: elastic-agent
app.kubernetes.io/managed-by: Helm
---
# Source: elastic-agent/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: elastic-agent
labels:
helm.sh/chart: elastic-agent-0.1.0
app.kubernetes.io/name: elastic-agent
app.kubernetes.io/instance: elastic-agent
app.kubernetes.io/managed-by: Helm
spec:
type: ClusterIP
ports:
- port: 80
targetPort: http-external
protocol: TCP
name: http-external
selector:
app: elastic-agent
---
# Source: elastic-agent/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: elastic-agent
labels:
helm.sh/chart: elastic-agent-0.1.0
app.kubernetes.io/name: elastic-agent
app.kubernetes.io/instance: elastic-agent
app.kubernetes.io/managed-by: Helm
spec:
replicas: 1
selector:
matchLabels:
app: elastic-agent
template:
metadata:
annotations:
sidecar.opentelemetry.io/inject: "false"
labels:
app: elastic-agent
sidecar.istio.io/inject: "false"
spec:
serviceAccountName: elastic-agent
securityContext:
fsGroup: 65532
containers:
- name: elastic-agent
securityContext:
allowPrivilegeEscalation: false
capabilities:
add:
- NET_BIND_SERVICE
drop:
- all
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 65532
image: "docker.elastic.co/beats/elastic-agent:8.4.2-amd64"
imagePullPolicy: IfNotPresent
env:
- name: FLEET_ENROLL
value: "1"
- name: FLEET_INSECURE
value: "true"
- name: ELASTIC_AGENT_TAGS
value: "devel"
- name: DD_AGENT_HOST
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: FLEET_URL
valueFrom:
secretKeyRef:
name: "elastic-agent-fleet-enroll"
key: "fleetUrl"
- name: FLEET_ENROLLMENT_TOKEN
valueFrom:
secretKeyRef:
name: "elastic-agent-fleet-enroll"
key: "fleetEnrollmentToken"
ports:
- name: http-external
containerPort: 8787
protocol: TCP
volumeMounts:
- name: elastic-agent
mountPath: /usr/share
resources:
limits:
memory: 125Mi
requests:
cpu: 100m
memory: 125Mi
volumes:
- name: elastic-agent
emptyDir: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment