prepare complete
This commit is contained in:
parent
a440c7ed6c
commit
1f39908e1c
@ -4,13 +4,11 @@ kubectl delete svc mariadb-service
|
|||||||
kubectl delete svc phpmyadmin-service
|
kubectl delete svc phpmyadmin-service
|
||||||
kubectl delete svc ftps
|
kubectl delete svc ftps
|
||||||
kubectl delete svc wp-service
|
kubectl delete svc wp-service
|
||||||
|
kubectl delete deployment telegraf
|
||||||
kubectl delete deployment nginx-deployment
|
kubectl delete deployment nginx-deployment
|
||||||
kubectl delete deployment mariadb
|
kubectl delete deployment mariadb
|
||||||
kubectl delete deployment wp
|
kubectl delete deployment wp
|
||||||
kubectl delete deployment phpmyadmin-deployment
|
kubectl delete deployment phpmyadmin-deployment
|
||||||
kubectl delete deployment ftps
|
kubectl delete deployment ftps
|
||||||
kubectl delete pods --all
|
kubectl delete pods --all
|
||||||
# eval $(minikube docker-env)
|
|
||||||
# docker stop $(docker ps -a -q)
|
|
||||||
# docker rm $(docker ps -a -q)
|
|
||||||
kubectl delete pv --all
|
kubectl delete pv --all
|
||||||
@ -5,6 +5,6 @@ RUN apk add grafana --repository http://dl-cdn.alpinelinux.org/alpine/edge/c
|
|||||||
COPY cfg/grafana.ini /usr/share/grafana/conf/custom.ini
|
COPY cfg/grafana.ini /usr/share/grafana/conf/custom.ini
|
||||||
COPY cfg/datasources.yaml /usr/share/grafana/conf/provisioning/datasources/influxdb.yaml
|
COPY cfg/datasources.yaml /usr/share/grafana/conf/provisioning/datasources/influxdb.yaml
|
||||||
COPY cfg/dashboards.yaml /usr/share/grafana/conf/provisioning/dashboards/dashboards.yaml
|
COPY cfg/dashboards.yaml /usr/share/grafana/conf/provisioning/dashboards/dashboards.yaml
|
||||||
COPY cfg/mdenys-dashboard.json /var/lib/grafana/dashboards/mdenys-dashboard.json
|
COPY cfg/mdenys-dashboard.json /var/lib/grafana/dashboards/dashboard.json
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
CMD /usr/sbin/grafana-server --homepath=/usr/share/grafana
|
CMD /usr/sbin/grafana-server --homepath=/usr/share/grafana
|
||||||
@ -1,7 +1,6 @@
|
|||||||
# # config file version
|
# # config file version
|
||||||
apiVersion: 1
|
apiVersion: 1
|
||||||
|
|
||||||
providers:
|
providers:
|
||||||
- name: 'mdenys dashboard'
|
- name: 'dashboards'
|
||||||
options:
|
options:
|
||||||
path: /var/lib/grafana/dashboards
|
path: /var/lib/grafana/dashboards
|
||||||
|
|||||||
@ -1,13 +1,9 @@
|
|||||||
apiVersion: 1
|
apiVersion: 1
|
||||||
datasources:
|
datasources:
|
||||||
- name: influxdb
|
- name: influxDB
|
||||||
type: influxdb
|
type: influxdb
|
||||||
orgId: 1
|
url: http://influxdb:8086
|
||||||
url: http://influxdb-service:8086
|
password: telegraf
|
||||||
|
user: telegraf
|
||||||
database: telegraf
|
database: telegraf
|
||||||
version: 1
|
editable: false
|
||||||
editable: false
|
|
||||||
isDefault: true
|
|
||||||
basicAuth: true
|
|
||||||
basicAuthUser: user
|
|
||||||
basicAuthPassword: user
|
|
||||||
File diff suppressed because it is too large
Load Diff
@ -1,11 +1,15 @@
|
|||||||
FROM alpine:3.12
|
FROM alpine:3.12
|
||||||
RUN apk update && apk upgrade
|
RUN apk update && apk add openrc
|
||||||
RUN apk add wget
|
ADD https://dl.influxdata.com/telegraf/releases/telegraf-1.17.3_linux_amd64.tar.gz /etc/
|
||||||
RUN wget https://dl.influxdata.com/telegraf/releases/telegraf-1.16.2_linux_amd64.tar.gz
|
RUN tar -xzf /etc/telegraf-1.17.3_linux_amd64.tar.gz -C /etc/ ; \
|
||||||
RUN tar xf telegraf-1.16.2_linux_amd64.tar.gz
|
rm -rf /etc/telegraf-1.17.3_linux_amd64.tar.gz
|
||||||
RUN cp -r ./telegraf-1.16.2/* /
|
RUN mv /etc/telegraf-1.17.3 /telegraf
|
||||||
COPY telegraf.conf /etc/telegraf/
|
RUN cp -r telegraf/* ./
|
||||||
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
|
RUN rm -rf /telegraf
|
||||||
RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.32-r0/glibc-2.32-r0.apk
|
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub \
|
||||||
RUN apk add glibc-2.32-r0.apk
|
https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
|
||||||
|
RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-2.28-r0.apk
|
||||||
|
RUN apk add glibc-2.28-r0.apk
|
||||||
|
RUN telegraf -sample-config telegraf.conf --input-filter cpu:mem --output-filter influxdb > telegraf.conf
|
||||||
|
COPY telegraf.conf /etc/telegraf/
|
||||||
CMD telegraf
|
CMD telegraf
|
||||||
@ -1,105 +1,37 @@
|
|||||||
[global_tags]
|
[global_tags]
|
||||||
# Telegraf has a few options you can configure under the [agent] section of the config.
|
|
||||||
[agent]
|
[agent]
|
||||||
# Default data collection interval for all inputs
|
|
||||||
interval = "10s"
|
interval = "10s"
|
||||||
# Rounds collection interval to interval.
|
|
||||||
# For example, if interval is set to 10s then always collect on :00, :10, :20, etc.
|
|
||||||
round_interval = true
|
round_interval = true
|
||||||
# Telegraf will send metrics to output in batch of at most metric_batch_size metrics.
|
|
||||||
metric_batch_size = 1000
|
metric_batch_size = 1000
|
||||||
# Telegraf will cache metric_buffer_limit metrics for each output, and will flush this buffer on a successful write.
|
|
||||||
# This should be a multiple of metric_batch_size and could not be less than 2 times metric_batch_size.
|
|
||||||
metric_buffer_limit = 10000
|
metric_buffer_limit = 10000
|
||||||
# Collection jitter is used to jitter the collection by a random amount.
|
|
||||||
# Each plugin will sleep for a random time within jitter before collecting. This can be used to avoid many plugins
|
|
||||||
# querying things like sysfs at the same time, which can have a measurable effect on the system.
|
|
||||||
collection_jitter = "0s"
|
collection_jitter = "0s"
|
||||||
# Default data flushing interval for all outputs.
|
|
||||||
# You should not set this below interval. Maximum flush_interval will be flush_interval + flush_jitter
|
|
||||||
flush_interval = "10s"
|
flush_interval = "10s"
|
||||||
# Jitter the flush interval by a random amount. This is primarily to avoid large write spikes for users running a large number of Telegraf instances.
|
|
||||||
# For example, a flush_jitter of 5s and flush_interval of 10s means flushes will happen every 10-15s.
|
|
||||||
flush_jitter = "0s"
|
flush_jitter = "0s"
|
||||||
# By default, precision will be set to the same timestamp order as the collection interval, with the maximum being 1s.
|
|
||||||
# Precision will NOT be used for service inputs, such as logparser and statsd. Valid values are ns, us (or µs), ms, and s.
|
|
||||||
precision = ""
|
precision = ""
|
||||||
# Override default hostname, if empty use os.Hostname().
|
|
||||||
hostname = ""
|
hostname = ""
|
||||||
# If true, do no set the host tag in the Telegraf agent
|
|
||||||
omit_hostname = false
|
omit_hostname = false
|
||||||
|
|
||||||
# Configuration for sending metrics to InfluxDB
|
|
||||||
[[outputs.influxdb]]
|
[[outputs.influxdb]]
|
||||||
## The full HTTP or UDP URL for your InfluxDB instance.
|
urls = ["http://influxdb:8086"]
|
||||||
##
|
|
||||||
## Multiple URLs can be specified for a single cluster, only ONE of the
|
|
||||||
## urls will be written to each interval.
|
|
||||||
urls = ["http://influxdb-service:8086"]
|
|
||||||
## The target database for metrics; will be created as needed.
|
|
||||||
## For UDP url endpoint database needs to be configured on server side.
|
|
||||||
database = "telegraf"
|
database = "telegraf"
|
||||||
## HTTP Basic Auth
|
username = "telegraf"
|
||||||
username = "mdenys"
|
password = "telegraf"
|
||||||
password = "mdenys"
|
|
||||||
|
|
||||||
[[inputs.cpu]]
|
[[inputs.cpu]]
|
||||||
## Whether to report per-cpu stats or not
|
|
||||||
percpu = true
|
percpu = true
|
||||||
## Whether to report total system cpu stats or not
|
|
||||||
totalcpu = true
|
totalcpu = true
|
||||||
## If true, collect raw CPU time metrics.
|
|
||||||
collect_cpu_time = false
|
collect_cpu_time = false
|
||||||
## If true, compute and report the sum of all non-idle CPU states.
|
|
||||||
report_active = false
|
report_active = false
|
||||||
|
|
||||||
[[inputs.disk]]
|
[[inputs.disk]]
|
||||||
## By default stats will be gathered for all mount points.
|
|
||||||
## Set mount_points will restrict the stats to only the specified mount points.
|
|
||||||
# mount_points = ["/"]
|
|
||||||
|
|
||||||
## Ignore mount points by filesystem type.
|
|
||||||
ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs"]
|
ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs"]
|
||||||
|
|
||||||
|
|
||||||
# REF: https://github.com/influxdata/telegraf/tree/master/plugins/inputs/docker
|
|
||||||
# Read metrics about docker containers
|
|
||||||
[[inputs.docker]]
|
[[inputs.docker]]
|
||||||
## Docker Endpoint
|
|
||||||
## To use TCP, set endpoint = "tcp://[ip]:[port]"
|
|
||||||
## To use environment variables (ie, docker-machine), set endpoint = "ENV"
|
|
||||||
endpoint = "unix:///var/run/docker.sock"
|
endpoint = "unix:///var/run/docker.sock"
|
||||||
## Set to true to collect Swarm metrics(desired_replicas, running_replicas)
|
|
||||||
## Note: configure this in one of the manager nodes in a Swarm cluster.
|
|
||||||
## configuring in multiple Swarm managers results in duplication of metrics.
|
|
||||||
gather_services = false
|
gather_services = false
|
||||||
## Only collect metrics for these containers. Values will be appended to
|
|
||||||
## container_name_include.
|
|
||||||
## Deprecated (1.4.0), use container_name_include
|
|
||||||
container_names = []
|
container_names = []
|
||||||
## Set the source tag for the metrics to the container ID hostname, eg first 12 chars
|
|
||||||
source_tag = false
|
source_tag = false
|
||||||
## Containers to include and exclude. Collect all if empty. Globs accepted.
|
|
||||||
container_name_include = []
|
container_name_include = []
|
||||||
container_name_exclude = []
|
container_name_exclude = []
|
||||||
## Timeout for docker list, info, and stats commands
|
|
||||||
timeout = "5s"
|
timeout = "5s"
|
||||||
## Whether to report for each container per-device blkio (8:0, 8:1...) and
|
|
||||||
## network (eth0, eth1, ...) stats or not
|
|
||||||
perdevice = true
|
perdevice = true
|
||||||
## Whether to report for each container total blkio and network stats or not
|
|
||||||
total = false
|
total = false
|
||||||
## docker labels to include and exclude as tags. Globs accepted.
|
|
||||||
## Note that an empty array for both will include all labels as tags
|
|
||||||
docker_label_include = []
|
docker_label_include = []
|
||||||
docker_label_exclude = ["annotation.kubernetes*"]
|
docker_label_exclude = ["annotation.kubernetes*"]
|
||||||
|
tag_env = ["JAVA_HOME", "HEAP_SIZE"]
|
||||||
## Which environment variables should we use as a tag
|
|
||||||
tag_env = ["JAVA_HOME", "HEAP_SIZE"]
|
|
||||||
|
|
||||||
## Optional TLS Config
|
|
||||||
# tls_ca = "/etc/telegraf/ca.pem"
|
|
||||||
# tls_cert = "/etc/telegraf/cert.pem"
|
|
||||||
# tls_key = "/etc/telegraf/key.pem"
|
|
||||||
## Use TLS but skip chain & host verification
|
|
||||||
# insecure_skip_verify = false
|
|
||||||
@ -1,15 +1,15 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: influxdb-service
|
name: influxdb
|
||||||
labels:
|
labels:
|
||||||
app: influxdb
|
app: influxdb
|
||||||
spec:
|
spec:
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
ports:
|
ports:
|
||||||
- port: 8086
|
- port: 8086
|
||||||
name: influxdb
|
targetPort: 8086
|
||||||
targetPort: 8086
|
name: http
|
||||||
selector:
|
selector:
|
||||||
app: influxdb
|
app: influxdb
|
||||||
---
|
---
|
||||||
@ -23,79 +23,82 @@ spec:
|
|||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: influxdb
|
app: influxdb
|
||||||
|
strategy:
|
||||||
|
type: Recreate
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app: influxdb
|
app: influxdb
|
||||||
spec:
|
spec:
|
||||||
|
restartPolicy: Always
|
||||||
containers:
|
containers:
|
||||||
- name: influxdb-container
|
- name: influxdb
|
||||||
image: influxdb-image
|
image: influxdb-image
|
||||||
imagePullPolicy: Never
|
imagePullPolicy: Never
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8086
|
- containerPort: 8086
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: "/var/lib/influxdb"
|
- mountPath: "/var/lib/influxdb"
|
||||||
name: influxdb-pv
|
name: influxdb-data
|
||||||
- name: influxdb-conf
|
- name: influxdb
|
||||||
mountPath: /etc/influxdb/influxdb.conf
|
mountPath: /etc/influxdb/influxdb.conf
|
||||||
subPath: influxdb.conf
|
subPath: influxdb.conf
|
||||||
readOnly: true
|
readOnly: true
|
||||||
volumes:
|
volumes:
|
||||||
- name: influxdb-pv
|
- name: influxdb-data
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: influxdb-pvc
|
claimName: influxdb-data-disk
|
||||||
- name: influxdb-conf
|
- name: influxdb
|
||||||
configMap:
|
configMap:
|
||||||
name: influxdb-conf
|
name: influxdb
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: influxdb
|
||||||
|
labels:
|
||||||
|
app: influxdb
|
||||||
|
data:
|
||||||
|
influxdb.conf: |
|
||||||
|
bind-adress="172.17.0.1:8088"
|
||||||
|
[meta]
|
||||||
|
dir="/var/lib/influxdb/meta"
|
||||||
|
[data]
|
||||||
|
dir="/var/lib/influxdb/data"
|
||||||
|
wal-dir = "/var/lib/influxdb/wal"
|
||||||
|
trace-logging-enable=true
|
||||||
|
[http]
|
||||||
|
bind-addres=":8086"
|
||||||
|
log-enabled=true
|
||||||
|
[[graphite]]
|
||||||
|
database="telegraf"
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: PersistentVolume
|
kind: PersistentVolume
|
||||||
metadata:
|
metadata:
|
||||||
name: influxdb-pv
|
name: influxdb-data
|
||||||
labels:
|
labels:
|
||||||
type: local
|
type: local
|
||||||
spec:
|
spec:
|
||||||
storageClassName: fast
|
storageClassName: manual
|
||||||
capacity:
|
|
||||||
storage: 500Mi
|
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteOnce
|
- ReadWriteOnce
|
||||||
|
capacity:
|
||||||
|
storage: 1Gi
|
||||||
hostPath:
|
hostPath:
|
||||||
path: "/var/lib/influxdb"
|
path: "/mnt/influx"
|
||||||
|
type: DirectoryOrCreate
|
||||||
claimRef:
|
claimRef:
|
||||||
name: mysql-pvc
|
name: influxdb-data-disk
|
||||||
|
namespace: default
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: PersistentVolumeClaim
|
kind: PersistentVolumeClaim
|
||||||
metadata:
|
metadata:
|
||||||
name: influxdb-pvc
|
name: influxdb-data-disk
|
||||||
labels:
|
|
||||||
app: influxdb
|
|
||||||
spec:
|
spec:
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteOnce
|
- ReadWriteOnce
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: 500Mi
|
storage: 1Gi
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name: influxdb-conf
|
|
||||||
labels:
|
|
||||||
app: influxdb
|
|
||||||
data:
|
|
||||||
influxdb.conf: |
|
|
||||||
bind-address = "127.0.0.1:8088"
|
|
||||||
[meta]
|
|
||||||
dir = "/var/lib/influxdb/meta"
|
|
||||||
[data]
|
|
||||||
dir = "/var/lib/influxdb/data"
|
|
||||||
wal-dir = "/var/lib/influxdb/wal"
|
|
||||||
trace-logging-enabled = true
|
|
||||||
[http]
|
|
||||||
bind-address = ":8086"
|
|
||||||
log-enabled = true
|
|
||||||
[[graphite]]
|
|
||||||
database = "telegraf"
|
|
||||||
@ -8,6 +8,10 @@ spec:
|
|||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: telegraf
|
app: telegraf
|
||||||
|
replicas: 1
|
||||||
|
strategy:
|
||||||
|
type: Recreate
|
||||||
|
minReadySeconds: 5
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
name: telegraf
|
name: telegraf
|
||||||
@ -15,7 +19,7 @@ spec:
|
|||||||
app: telegraf
|
app: telegraf
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: telegraf-container
|
- name: telegraf
|
||||||
image: telegraf-image
|
image: telegraf-image
|
||||||
imagePullPolicy: Never
|
imagePullPolicy: Never
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user