forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Elastic agent on k8s (elastic#19727)
- Loading branch information
Showing
7 changed files
with
397 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: agent-ingest-management-nodescope | ||
namespace: kube-system | ||
labels: | ||
app: agent-ingest-management-nodescope | ||
group: ingest-management | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: agent-ingest-management-nodescope | ||
template: | ||
metadata: | ||
labels: | ||
app: agent-ingest-management-nodescope | ||
group: ingest-management | ||
spec: | ||
serviceAccountName: agent-ingest-management | ||
hostNetwork: true | ||
dnsPolicy: ClusterFirstWithHostNet | ||
containers: | ||
- name: agent-ingest-management-nodescope | ||
image: docker.elastic.co/beats/elastic-agent:8.0.0-SNAPSHOT | ||
env: | ||
- name: FLEET_ENROLL | ||
value: "1" | ||
# Use enrollment key of node scope configuration to distinguish node scope datasets | ||
- name: FLEET_ENROLLMENT_TOKEN | ||
value: | ||
- name: KIBANA_HOST | ||
value: "http://kibana:5601" | ||
- name: NODE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
securityContext: | ||
runAsUser: 0 | ||
resources: | ||
limits: | ||
memory: 200Mi | ||
requests: | ||
cpu: 100m | ||
memory: 100Mi | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: agent-ingest-management-clusterscope | ||
namespace: kube-system | ||
labels: | ||
app: agent-ingest-management-clusterscope | ||
group: ingest-management | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: agent-ingest-management-clusterscope | ||
template: | ||
metadata: | ||
labels: | ||
app: agent-ingest-management-clusterscope | ||
group: ingest-management | ||
spec: | ||
serviceAccountName: agent-ingest-management | ||
containers: | ||
- name: agent-ingest-management-clusterscope | ||
image: docker.elastic.co/beats/elastic-agent:8.0.0-SNAPSHOT | ||
env: | ||
- name: FLEET_ENROLL | ||
value: "1" | ||
# Use enrollment key of cluster scope configuration to distinguish node scope datasets | ||
- name: FLEET_ENROLLMENT_TOKEN | ||
value: | ||
- name: KIBANA_HOST | ||
value: "http://kibana:5601" | ||
- name: NODE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
securityContext: | ||
runAsUser: 0 | ||
resources: | ||
limits: | ||
memory: 200Mi | ||
requests: | ||
cpu: 100m | ||
memory: 100Mi | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: agent-ingest-management | ||
subjects: | ||
- kind: ServiceAccount | ||
name: agent-ingest-management | ||
namespace: kube-system | ||
roleRef: | ||
kind: ClusterRole | ||
name: agent-ingest-management | ||
apiGroup: rbac.authorization.k8s.io | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: agent-ingest-management | ||
labels: | ||
k8s-app: agent-ingest-management | ||
rules: | ||
- apiGroups: [""] | ||
resources: | ||
- nodes | ||
- namespaces | ||
- events | ||
- pods | ||
- secrets | ||
verbs: ["get", "list", "watch"] | ||
- apiGroups: ["extensions"] | ||
resources: | ||
- replicasets | ||
verbs: ["get", "list", "watch"] | ||
- apiGroups: ["apps"] | ||
resources: | ||
- statefulsets | ||
- deployments | ||
- replicasets | ||
verbs: ["get", "list", "watch"] | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- nodes/stats | ||
verbs: | ||
- get | ||
# required for apiserver | ||
- nonResourceURLs: | ||
- "/metrics" | ||
verbs: | ||
- get | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: agent-ingest-management | ||
namespace: kube-system | ||
labels: | ||
k8s-app: agent-ingest-management | ||
--- |
44 changes: 44 additions & 0 deletions
44
deploy/kubernetes/elastic-agent/elastic-agent-daemonset.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: agent-ingest-management-nodescope | ||
namespace: kube-system | ||
labels: | ||
app: agent-ingest-management-nodescope | ||
group: ingest-management | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: agent-ingest-management-nodescope | ||
template: | ||
metadata: | ||
labels: | ||
app: agent-ingest-management-nodescope | ||
group: ingest-management | ||
spec: | ||
serviceAccountName: agent-ingest-management | ||
hostNetwork: true | ||
dnsPolicy: ClusterFirstWithHostNet | ||
containers: | ||
- name: agent-ingest-management-nodescope | ||
image: docker.elastic.co/beats/elastic-agent:8.0.0-SNAPSHOT | ||
env: | ||
- name: FLEET_ENROLL | ||
value: "1" | ||
# Use enrollment key of node scope configuration to distinguish node scope datasets | ||
- name: FLEET_ENROLLMENT_TOKEN | ||
value: | ||
- name: KIBANA_HOST | ||
value: "http://kibana:5601" | ||
- name: NODE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
securityContext: | ||
runAsUser: 0 | ||
resources: | ||
limits: | ||
memory: 200Mi | ||
requests: | ||
cpu: 100m | ||
memory: 100Mi |
42 changes: 42 additions & 0 deletions
42
deploy/kubernetes/elastic-agent/elastic-agent-deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: agent-ingest-management-clusterscope | ||
namespace: kube-system | ||
labels: | ||
app: agent-ingest-management-clusterscope | ||
group: ingest-management | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: agent-ingest-management-clusterscope | ||
template: | ||
metadata: | ||
labels: | ||
app: agent-ingest-management-clusterscope | ||
group: ingest-management | ||
spec: | ||
serviceAccountName: agent-ingest-management | ||
containers: | ||
- name: agent-ingest-management-clusterscope | ||
image: docker.elastic.co/beats/elastic-agent:8.0.0-SNAPSHOT | ||
env: | ||
- name: FLEET_ENROLL | ||
value: "1" | ||
# Use enrollment key of cluster scope configuration to distinguish node scope datasets | ||
- name: FLEET_ENROLLMENT_TOKEN | ||
value: | ||
- name: KIBANA_HOST | ||
value: "http://kibana:5601" | ||
- name: NODE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
securityContext: | ||
runAsUser: 0 | ||
resources: | ||
limits: | ||
memory: 200Mi | ||
requests: | ||
cpu: 100m | ||
memory: 100Mi |
12 changes: 12 additions & 0 deletions
12
deploy/kubernetes/elastic-agent/elastic-agent-role-binding.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: agent-ingest-management | ||
subjects: | ||
- kind: ServiceAccount | ||
name: agent-ingest-management | ||
namespace: kube-system | ||
roleRef: | ||
kind: ClusterRole | ||
name: agent-ingest-management | ||
apiGroup: rbac.authorization.k8s.io |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: agent-ingest-management | ||
labels: | ||
k8s-app: agent-ingest-management | ||
rules: | ||
- apiGroups: [""] | ||
resources: | ||
- nodes | ||
- namespaces | ||
- events | ||
- pods | ||
- secrets | ||
verbs: ["get", "list", "watch"] | ||
- apiGroups: ["extensions"] | ||
resources: | ||
- replicasets | ||
verbs: ["get", "list", "watch"] | ||
- apiGroups: ["apps"] | ||
resources: | ||
- statefulsets | ||
- deployments | ||
- replicasets | ||
verbs: ["get", "list", "watch"] | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- nodes/stats | ||
verbs: | ||
- get | ||
# required for apiserver | ||
- nonResourceURLs: | ||
- "/metrics" | ||
verbs: | ||
- get |
7 changes: 7 additions & 0 deletions
7
deploy/kubernetes/elastic-agent/elastic-agent-service-account.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: agent-ingest-management | ||
namespace: kube-system | ||
labels: | ||
k8s-app: agent-ingest-management |
Oops, something went wrong.