mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-05-06 00:46:56 +00:00
225 lines
4.8 KiB
YAML
225 lines
4.8 KiB
YAML
---
|
|
apiVersion: v1
|
|
kind: ServiceAccount
|
|
metadata:
|
|
name: fluentd
|
|
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
|
kind: ClusterRole
|
|
metadata:
|
|
name: fluentd
|
|
rules:
|
|
- apiGroups:
|
|
- ""
|
|
resources:
|
|
- pods
|
|
- namespaces
|
|
verbs:
|
|
- get
|
|
- list
|
|
- watch
|
|
|
|
---
|
|
kind: ClusterRoleBinding
|
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
|
metadata:
|
|
name: fluentd
|
|
roleRef:
|
|
kind: ClusterRole
|
|
name: fluentd
|
|
apiGroup: rbac.authorization.k8s.io
|
|
subjects:
|
|
- kind: ServiceAccount
|
|
name: fluentd
|
|
namespace: default
|
|
|
|
---
|
|
apiVersion: extensions/v1beta1
|
|
kind: DaemonSet
|
|
metadata:
|
|
name: fluentd
|
|
labels:
|
|
k8s-app: fluentd-logging
|
|
version: v1
|
|
kubernetes.io/cluster-service: "true"
|
|
spec:
|
|
template:
|
|
metadata:
|
|
labels:
|
|
k8s-app: fluentd-logging
|
|
version: v1
|
|
kubernetes.io/cluster-service: "true"
|
|
spec:
|
|
serviceAccount: fluentd
|
|
serviceAccountName: fluentd
|
|
tolerations:
|
|
- key: node-role.kubernetes.io/master
|
|
effect: NoSchedule
|
|
containers:
|
|
- name: fluentd
|
|
image: fluent/fluentd-kubernetes-daemonset:elasticsearch
|
|
env:
|
|
- name: FLUENT_ELASTICSEARCH_HOST
|
|
value: "elasticsearch"
|
|
- name: FLUENT_ELASTICSEARCH_PORT
|
|
value: "9200"
|
|
- name: FLUENT_ELASTICSEARCH_SCHEME
|
|
value: "http"
|
|
# X-Pack Authentication
|
|
# =====================
|
|
- name: FLUENT_ELASTICSEARCH_USER
|
|
value: "elastic"
|
|
- name: FLUENT_ELASTICSEARCH_PASSWORD
|
|
value: "changeme"
|
|
- name: FLUENT_UID
|
|
value: "0"
|
|
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
|
|
|
|
---
|
|
apiVersion: extensions/v1beta1
|
|
kind: Deployment
|
|
metadata:
|
|
annotations:
|
|
deployment.kubernetes.io/revision: "1"
|
|
creationTimestamp: null
|
|
generation: 1
|
|
labels:
|
|
run: elasticsearch
|
|
name: elasticsearch
|
|
selfLink: /apis/extensions/v1beta1/namespaces/default/deployments/elasticsearch
|
|
spec:
|
|
progressDeadlineSeconds: 600
|
|
replicas: 1
|
|
revisionHistoryLimit: 10
|
|
selector:
|
|
matchLabels:
|
|
run: elasticsearch
|
|
strategy:
|
|
rollingUpdate:
|
|
maxSurge: 1
|
|
maxUnavailable: 1
|
|
type: RollingUpdate
|
|
template:
|
|
metadata:
|
|
creationTimestamp: null
|
|
labels:
|
|
run: elasticsearch
|
|
spec:
|
|
containers:
|
|
- image: elasticsearch:5.6.8
|
|
imagePullPolicy: IfNotPresent
|
|
name: elasticsearch
|
|
resources: {}
|
|
terminationMessagePath: /dev/termination-log
|
|
terminationMessagePolicy: File
|
|
dnsPolicy: ClusterFirst
|
|
restartPolicy: Always
|
|
schedulerName: default-scheduler
|
|
securityContext: {}
|
|
terminationGracePeriodSeconds: 30
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
creationTimestamp: null
|
|
labels:
|
|
run: elasticsearch
|
|
name: elasticsearch
|
|
selfLink: /api/v1/namespaces/default/services/elasticsearch
|
|
spec:
|
|
ports:
|
|
- port: 9200
|
|
protocol: TCP
|
|
targetPort: 9200
|
|
selector:
|
|
run: elasticsearch
|
|
sessionAffinity: None
|
|
type: ClusterIP
|
|
|
|
---
|
|
apiVersion: extensions/v1beta1
|
|
kind: Deployment
|
|
metadata:
|
|
annotations:
|
|
deployment.kubernetes.io/revision: "1"
|
|
creationTimestamp: null
|
|
generation: 1
|
|
labels:
|
|
run: kibana
|
|
name: kibana
|
|
selfLink: /apis/extensions/v1beta1/namespaces/default/deployments/kibana
|
|
spec:
|
|
progressDeadlineSeconds: 600
|
|
replicas: 1
|
|
revisionHistoryLimit: 10
|
|
selector:
|
|
matchLabels:
|
|
run: kibana
|
|
strategy:
|
|
rollingUpdate:
|
|
maxSurge: 1
|
|
maxUnavailable: 1
|
|
type: RollingUpdate
|
|
template:
|
|
metadata:
|
|
creationTimestamp: null
|
|
labels:
|
|
run: kibana
|
|
spec:
|
|
containers:
|
|
- env:
|
|
- name: ELASTICSEARCH_URL
|
|
value: http://elasticsearch:9200/
|
|
image: kibana:5.6.8
|
|
imagePullPolicy: Always
|
|
name: kibana
|
|
resources: {}
|
|
terminationMessagePath: /dev/termination-log
|
|
terminationMessagePolicy: File
|
|
dnsPolicy: ClusterFirst
|
|
restartPolicy: Always
|
|
schedulerName: default-scheduler
|
|
securityContext: {}
|
|
terminationGracePeriodSeconds: 30
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
creationTimestamp: null
|
|
labels:
|
|
run: kibana
|
|
name: kibana
|
|
selfLink: /api/v1/namespaces/default/services/kibana
|
|
spec:
|
|
externalTrafficPolicy: Cluster
|
|
ports:
|
|
- port: 5601
|
|
protocol: TCP
|
|
targetPort: 5601
|
|
selector:
|
|
run: kibana
|
|
sessionAffinity: None
|
|
type: NodePort
|