Skip to content
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

Update k8s example #348

Merged
merged 1 commit into from
Jul 1, 2021
Merged
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
31 changes: 26 additions & 5 deletions examples/k8s/daemonset/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ metadata:
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
# kubernetes versions before 1.8.0 should use rbac.authorization.k8s.io/v1beta1
metadata:
name: stanza-metadata
namespace: default
Expand All @@ -21,7 +20,7 @@ rules:
verbs: ["get", "list"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: stanza-metadata
roleRef:
Expand All @@ -41,10 +40,16 @@ apiVersion: v1
data:
config.yaml: |2-
pipeline:
- type: kubernetes
- type: kubernetes_container
cluster_name: stanza_example
container_name: '*'
# avoid parsing stanza's log output
exclude:
- /var/log/containers/stanza-*_*-*.log
start_at: end

- type: file_output
path: /tmp/test.out
# watch stanza's output with 'kubectl logs -f <pod name> | jq .'
- type: stdout
---
apiVersion: apps/v1
kind: DaemonSet
Expand All @@ -63,8 +68,18 @@ spec:
serviceAccountName: stanza-metadata
containers:
- name: stanza
# Production deployments should use an image tag other than latest
image: observiq/stanza:latest
imagePullPolicy: Always
# Override args in order to set database location
# to the database hostPath volume
args:
- --config
- /stanza_home/config.yaml
- --database
- /stanza_home/database/stanza.db
- --plugin_dir
- /stanza_home/plugins
resources:
limits:
memory: "250Mi"
Expand All @@ -80,6 +95,9 @@ spec:
name: varlog
- mountPath: /var/lib/docker/containers
name: dockerlogs
- mountPath: /stanza_home/database/
name: database
readOnly: false
restartPolicy: Always
terminationGracePeriodSeconds: 5
volumes:
Expand All @@ -92,3 +110,6 @@ spec:
- name: config
configMap:
name: stanza-config
- name: database
hostPath:
path: /var/observiq-agent/database