mirror of https://github.com/k3s-io/k3s
Add cluster logging with fluentd and elastic search
parent
7d7d5d4c4e
commit
3a78104267
|
@ -43,6 +43,9 @@ flannel_prefix: 12
|
|||
# room for 4096 nodes with 254 pods per node.
|
||||
flannel_host_prefix: 24
|
||||
|
||||
# Set to false to disable logging with elasticsearch
|
||||
cluster_logging: true
|
||||
|
||||
# Turn to false to disable cluster monitoring with heapster and influxdb
|
||||
cluster_monitoring: true
|
||||
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
- name: LOGGING | Assures {{ kube_config_dir }}/addons/cluster-logging dir exists
|
||||
file: path={{ kube_config_dir }}/addons/cluster-logging state=directory
|
||||
|
||||
- name: LOGGING | Download logging files from Kubernetes repo
|
||||
get_url:
|
||||
url=https://raw.githubusercontent.com/GoogleCloudPlatform/kubernetes/master/cluster/addons/fluentd-elasticsearch/{{ item }}
|
||||
dest="{{ kube_config_dir }}/addons/cluster-logging/"
|
||||
force=yes
|
||||
with_items:
|
||||
- es-controller.yaml
|
||||
- es-service.yaml
|
||||
- kibana-controller.yaml
|
||||
- kibana-service.yaml
|
|
@ -17,6 +17,9 @@
|
|||
- include: cluster-monitoring.yml
|
||||
when: cluster_monitoring
|
||||
|
||||
- include: cluster-logging.yml
|
||||
when: cluster_logging
|
||||
|
||||
#- name: Get kube-addons script from Kubernetes
|
||||
# get_url:
|
||||
# url=https://raw.githubusercontent.com/GoogleCloudPlatform/kubernetes/master/cluster/saltbase/salt/kube-addons/kube-addons.sh
|
||||
|
@ -42,6 +45,7 @@
|
|||
with_items:
|
||||
- "system:dns"
|
||||
- "system:monitoring"
|
||||
- "system:logging"
|
||||
register: gentoken
|
||||
changed_when: "'Added' in gentoken.stdout"
|
||||
notify:
|
||||
|
|
|
@ -17,6 +17,10 @@ kube_cert_dir: "{{ kube_config_dir }}/certs"
|
|||
# This is where all of the bearer tokens will be stored
|
||||
kube_token_dir: "{{ kube_config_dir }}/tokens"
|
||||
|
||||
# This is where you can drop yaml/json files and the kubelet will run those
|
||||
# pods on startup
|
||||
kube_manifest_dir: "{{ kube_config_dir }}/manifests"
|
||||
|
||||
# This is the group that the cert creation scripts chgrp the
|
||||
# cert files to. Not really changable...
|
||||
kube_cert_group: kube-cert
|
||||
|
|
|
@ -14,6 +14,16 @@
|
|||
- include: centos.yml
|
||||
when: not is_atomic and ansible_distribution == "CentOS"
|
||||
|
||||
- name: Make sure manifest directory exists
|
||||
file: path={{ kube_manifest_dir }} state=directory
|
||||
|
||||
- name: Install fluentd pod into each node
|
||||
get_url:
|
||||
url=https://raw.githubusercontent.com/GoogleCloudPlatform/kubernetes/master/cluster/saltbase/salt/fluentd-es/fluentd-es.yaml
|
||||
dest="{{ kube_manifest_dir }}"
|
||||
force=yes
|
||||
when: cluster_logging
|
||||
|
||||
- name: Get the node token values
|
||||
slurp:
|
||||
src: "{{ kube_token_dir }}/{{ item }}-{{ inventory_hostname }}.token"
|
||||
|
|
|
@ -15,7 +15,7 @@ KUBELET_API_SERVER="--api_servers=https://{{ groups['masters'][0]}}:443"
|
|||
|
||||
# Add your own!
|
||||
{% if dns_setup %}
|
||||
KUBELET_ARGS="--cluster_dns={{ dns_server }} --cluster_domain={{ dns_domain }} --kubeconfig={{ kube_config_dir}}/kubelet.kubeconfig"
|
||||
KUBELET_ARGS="--cluster_dns={{ dns_server }} --cluster_domain={{ dns_domain }} --kubeconfig={{ kube_config_dir}}/kubelet.kubeconfig --config={{ kube_manifest_dir }}"
|
||||
{% else %}
|
||||
KUBELET_ARGS="--kubeconfig={{ kube_config_dir}}/kubelet.kubeconfig"
|
||||
KUBELET_ARGS="--kubeconfig={{ kube_config_dir}}/kubelet.kubeconfig --config={{ kube_manifest_dir }}"
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in New Issue