Add an yaml example in Writing a DaemonSet Spec (#4553)

* Add yaml example in DeamonSet doc

* Update daemonset.md

* use code include instead of duplicate in md

* remove redundant download link
This commit is contained in:
chaowang95
2017-08-03 01:31:32 +08:00
committed by Andrew Chen
parent abd60bc4be
commit 1f7f9aa0e6
2 changed files with 47 additions and 0 deletions
@@ -26,6 +26,17 @@ different flags and/or different memory and cpu requests for different hardware
## Writing a DaemonSet Spec
### Create a DeamonSet
You can describe a DeamonSet in a YAML file. For example, the deamonset.yaml file below describes a DeamonSet that runs the fluentd-elasticsearch Docker image:
{% include code.html language="yaml" file="deamonset.yaml" ghlink="/docs/concepts/workloads/controllers/deamonset.yaml" %}
* Create a DeamonSet based on the YAML file:
```
kubectl create -f deamonset.yaml
```
### Required Fields
As with all other Kubernetes config, a DaemonSet needs `apiVersion`, `kind`, and `metadata` fields. For
@@ -0,0 +1,36 @@
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: fluentd-elasticsearch
namespace: kube-system
labels:
k8s-app: fluentd-logging
spec:
template:
metadata:
labels:
name: fluentd-elasticsearch
spec:
containers:
- name: fluentd-elasticsearch
image: gcr.io/google-containers/fluentd-elasticsearch:1.20
resources:
limits:
memory: 200Mi
requests:
cpu: 100m
memory: 200Mi
volumeMounts:
- name: varlog
mountPath: /var/log
- name: varlibdockercontainers
mountPath: /var/lib/docker/containers
readOnly: true
terminationGracePeriodSeconds: 30
volumes:
- name: varlog
hostPath:
path: /var/log
- name: varlibdockercontainers
hostPath:
path: /var/lib/docker/containers