Created
October 2, 2019 14:56
-
-
Save megastef/a66760dca0830d773d8c531de746d9fe to your computer and use it in GitHub Desktop.
Logagent with cluster role
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
# st-agent-clusterrole.yml | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRoleBinding | |
metadata: | |
name: sematext-agent | |
labels: | |
app: sematext-agent | |
roleRef: | |
apiGroup: rbac.authorization.k8s.io | |
kind: ClusterRole | |
name: sematext-agent | |
subjects: | |
- kind: ServiceAccount | |
name: sematext-agent | |
namespace: default | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRole | |
metadata: | |
name: sematext-agent | |
labels: | |
app: sematext-agent | |
rules: | |
- apiGroups: | |
- "" | |
resources: | |
- events | |
- pods | |
- configmaps | |
- nodes | |
- secrets | |
verbs: | |
- list | |
- get | |
- watch | |
- apiGroups: | |
- "" | |
resources: | |
- pods | |
- configmaps | |
verbs: | |
- create | |
- delete | |
- update | |
- apiGroups: | |
- apps | |
resources: | |
- deployments | |
verbs: | |
- watch | |
- list | |
# run the following command | |
# kubectl create -f st-agent-clusterrole.yml | |
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
apiVersion: apps/v1 | |
kind: DaemonSet | |
metadata: | |
name: st-logagent | |
spec: | |
selector: | |
matchLabels: | |
app: st-logagent | |
template: | |
metadata: | |
labels: | |
app: st-logagent | |
spec: | |
serviceAccountName: sematext-agent | |
hostNetwork: true | |
dnsPolicy: "ClusterFirst" | |
restartPolicy: "Always" | |
containers: | |
- name: logagent | |
image: sematext/logagent:latest | |
imagePullPolicy: "Always" | |
env: | |
- name: LOGS_TOKEN | |
value: "YOUR_TOKEN_HERE" | |
- name: REGION | |
value: "EU" | |
volumeMounts: | |
- mountPath: /var/run/docker.sock | |
name: docker-sock | |
- mountPath: /etc/localtime | |
name: localtime | |
volumes: | |
- name: docker-sock | |
hostPath: | |
path: /var/run/docker.sock | |
- name: localtime | |
hostPath: | |
path: /etc/localtime |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment