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

doc: fix sample yaml in docs for installing promtail to k8s #1505

Merged
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
86 changes: 48 additions & 38 deletions docs/clients/promtail/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,40 +49,44 @@ cluster. It's the best solution for a single-tenant model.

```yaml
---Daemonset.yaml
apiVersion: extensions/v1beta1
kind: Daemonset
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: promtail-daemonset
...
spec:
...
selector:
matchLabels:
name: promtail
template:
metadata:
labels:
name: promtail
spec:
serviceAccount: SERVICE_ACCOUNT
serviceAccountName: SERVICE_ACCOUNT
volumes:
- name: logs
hostPath: HOST_PATH
hostPath:
path: HOST_PATH
- name: promtail-config
configMap
configMap:
name: promtail-configmap
containers:
- name: promtail-container
args:
- -config.file=/etc/promtail/promtail.yaml
volumeMounts:
- name: logs
mountPath: MOUNT_PATH
- name: promtail-config
mountPath: /etc/promtail
...
image: grafana/promtail
args:
- -config.file=/etc/promtail/promtail.yaml
volumeMounts:
- name: logs
mountPath: MOUNT_PATH
- name: promtail-config
mountPath: /etc/promtail

---configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: promtail-config
...
data:
promtail.yaml: YOUR CONFIG

Expand All @@ -92,29 +96,31 @@ kind: ClusterRole
metadata:
name: promtail-clusterrole
rules:
- apiGroups:
resources:
- nodes
- services
- pod
- apiGroups: [""]
resources:
- nodes
- services
- pod
verbs:
- get
- watch
- list

---ServiceAccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: promtail-serviceaccount

---Rolebinding
apiVersion: rbac.authorization.k9s.io/v1
---Rolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: promtail-clusterrolebinding
subjects:
- kind: ServiceAccount
name: promtail-serviceaccount
name: promtail-serviceaccount
namespace: default
roleRef:
kind: ClusterRole
name: promtail-clusterrole
Expand All @@ -129,32 +135,36 @@ pods and deployments.

```yaml
---Deployment.yaml
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: my_test_app
...
name: promtail-deployment
spec:
...
selector:
matchLabels:
name: promtail
template:
metadata:
labels:
name: promtail
spec:
serviceAccount: SERVICE_ACCOUNT
serviceAccountName: SERVICE_ACCOUNT
volumes:
- name: logs
hostPath: HOST_PATH
hostPath:
path: HOST_PATH
- name: promtail-config
configMap
configMap:
name: promtail-configmap
containers:
- name: promtail-container
args:
- -config.file=/etc/promtail/promtail.yaml
volumeMounts:
- name: logs
mountPath: MOUNT_PATH
- name: promtail-config
mountPath: /etc/promtail
...
...
image: grafana/promtail
args:
- -config.file=/etc/promtail/promtail.yaml
volumeMounts:
- name: logs
mountPath: MOUNT_PATH
- name: promtail-config
mountPath: /etc/promtail
```