From 6a713a6023a3ccf5c6be30ebb6d5cae3fde37543 Mon Sep 17 00:00:00 2001 From: REPO01 Date: Sat, 28 Sep 2019 11:54:34 +0200 Subject: [PATCH] 3. forberedelse weekend --- hostfiles/hosts_kubernetes | 13 +++++++++++++ playbooks/kubernetes/install-nfsutils.yml | 15 +++++++++++++++ playbooks/kubernetes/upgrade-kubelet.yml | 17 +++++++++++++++++ playbooks/monitoring/assets/filebeat.yml | 6 +++--- .../monitoring/assets/modules.d/system.yml | 7 +++++++ playbooks/monitoring/filebeat-updateconfig.yml | 14 +++++++++++++- 6 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 hostfiles/hosts_kubernetes create mode 100644 playbooks/kubernetes/install-nfsutils.yml create mode 100644 playbooks/kubernetes/upgrade-kubelet.yml create mode 100644 playbooks/monitoring/assets/modules.d/system.yml diff --git a/hostfiles/hosts_kubernetes b/hostfiles/hosts_kubernetes new file mode 100644 index 0000000..f020ff7 --- /dev/null +++ b/hostfiles/hosts_kubernetes @@ -0,0 +1,13 @@ +"kubernetes-master":[ + "10.100.101.20" + ], +"kubernetes-nodes":[ + "10.100.101.10", + "10.100.101.11", + "10.100.101.13", + "10.100.102.10", + "10.100.102.11", + "10.100.102.12", + "10.100.103.10", + "10.100.103.11" +], diff --git a/playbooks/kubernetes/install-nfsutils.yml b/playbooks/kubernetes/install-nfsutils.yml new file mode 100644 index 0000000..f3f7bda --- /dev/null +++ b/playbooks/kubernetes/install-nfsutils.yml @@ -0,0 +1,15 @@ +--- +- hosts: kubernetes-nodes + tasks: + - name: Install kubelet version + apt: + name: "{{ packages }}" + update_cache: yes + vars: + packages: + - nfs-common + +# - name: Restart service kubelet +# service: +# name: kubelet +# state: restarted diff --git a/playbooks/kubernetes/upgrade-kubelet.yml b/playbooks/kubernetes/upgrade-kubelet.yml new file mode 100644 index 0000000..ecc1b61 --- /dev/null +++ b/playbooks/kubernetes/upgrade-kubelet.yml @@ -0,0 +1,17 @@ +--- +- hosts: kubernetes-nodes + tasks: + - name: Install kubelet version + apt: + name: "{{ packages }}" + update_cache: yes + vars: + packages: + - kubelet=1.15.4-00 + - kubectl=1.15.4-00 + - kubeadm=1.15.4-00 + + - name: Restart service kubelet + service: + name: kubelet + state: restarted diff --git a/playbooks/monitoring/assets/filebeat.yml b/playbooks/monitoring/assets/filebeat.yml index 9011105..f00f5d4 100644 --- a/playbooks/monitoring/assets/filebeat.yml +++ b/playbooks/monitoring/assets/filebeat.yml @@ -29,7 +29,7 @@ filebeat.inputs: - type: log - enabled: true + enabled: false paths: - /var/log/kern.log include_lines: ['EDAC MC0:'] @@ -157,7 +157,7 @@ setup.kibana: #-------------------------- Elasticsearch output ------------------------------ output.elasticsearch: # Array of hosts to connect to. - hosts: ["ip-101-80.rack1.srv.minserver.dk:9200", "ip-102-83.rack2.srv.minserver.dk:9200","ip-102-68.rack2.srv.minserver.dk:9200","ip-103-143.rack3.srv.minserver.dk:9200","ip-103-69.rack3.srv.minserver.dk:9200","ip-102-78.rack2.srv.minserver.dk:9200"] + hosts: ["10.100.101.7:9200","10.100.102.6:9200","10.100.102.7:9200","10.100.103.7:9200"] pipeline: '%{[fields.pipeline]}' index: "filebeat-%{[beat.version]}-%{+yyyy.MM.dd}" @@ -169,7 +169,7 @@ output.elasticsearch: setup.template: name: "filebeat" pattern: "filebeat-*" - enabled: false + enabled: true #----------------------------- Logstash output -------------------------------- #output.logstash: diff --git a/playbooks/monitoring/assets/modules.d/system.yml b/playbooks/monitoring/assets/modules.d/system.yml new file mode 100644 index 0000000..c75a6c8 --- /dev/null +++ b/playbooks/monitoring/assets/modules.d/system.yml @@ -0,0 +1,7 @@ +- module: system + syslog: + enabled: true + var.paths: ["/var/log/syslog*"] + auth: + enabled: true + var.paths: ["/var/log/auth.log*"] diff --git a/playbooks/monitoring/filebeat-updateconfig.yml b/playbooks/monitoring/filebeat-updateconfig.yml index 2158605..737b711 100644 --- a/playbooks/monitoring/filebeat-updateconfig.yml +++ b/playbooks/monitoring/filebeat-updateconfig.yml @@ -1,5 +1,5 @@ --- -- hosts: npf_gameservers_all +- hosts: npf_gameservers gather_facts: no tasks: - name: copy filebeat.yml config files @@ -9,6 +9,18 @@ owner: root group: root + - name: Create modules.d + file: + path: /etc/filebeat/modules.d + state: directory + + - name: copy system.yml to modules.d + copy: + src: assets/modules.d/system.yml + dest: /etc/filebeat/modules.d/system.yml + owner: root + group: root + - name: reload daemons command: systemctl daemon-reload