Loading manifests/monitoring.yaml +6 −6 Original line number Diff line number Diff line Loading @@ -27,12 +27,12 @@ spec: value: "teraflow" - name: INFLUXDB_HTTP_AUTH_ENABLED value: "True" # readinessProbe: # exec: # command: ["curl", "-XGET", "localhost:8086/health"] # livenessProbe: # exec: # command: ["curl", "-XGET", "localhost:8086/health"] readinessProbe: exec: command: ["curl", "-XGET", "localhost:8086/health"] livenessProbe: exec: command: ["curl", "-XGET", "localhost:8086/health"] resources: requests: cpu: 250m Loading src/monitoring/.gitlab-ci.yml +4 −2 Original line number Diff line number Diff line Loading @@ -39,9 +39,11 @@ build influx: # # - kubectl get all # - curl -XGET "10.97.74.29:8086/health" # # - kubectl delete -f "manifests/influx.yaml" - pip install influxdb - cd ./src/monitoring/service - python3 test_influx.py - docker build -t "test-influx" ./ - docker run --name test-influx --rm test-influx - docker stop test-influx - docker rmi test-influx # test if the Docker image can be pulled from the gitlab registry # test monitoring pull: Loading src/monitoring/service/Dockerfile 0 → 100644 +6 −0 Original line number Diff line number Diff line FROM python:3-slim RUN pip install --upgrade pip RUN pip install influxdb RUN pip install datetime ENTRYPOINT ["python3", "test_influx.py"] No newline at end of file src/monitoring/service/test_influx.py +2 −2 Original line number Diff line number Diff line from influx_tools import * from influxdb import InfluxDBClient from datetime import datetime influx = Influx('10.97.74.29', 8086, 'teraflow', 'teraflow', 'monitoring') influx = InfluxDBClient('10.97.74.29', 8086, 'teraflow', 'teraflow', 'monitoring') influx.write_KPI(datetime.now(),1,1,101,1000) results = influx.client.query('select * from samples;') print(results.raw) No newline at end of file Loading
manifests/monitoring.yaml +6 −6 Original line number Diff line number Diff line Loading @@ -27,12 +27,12 @@ spec: value: "teraflow" - name: INFLUXDB_HTTP_AUTH_ENABLED value: "True" # readinessProbe: # exec: # command: ["curl", "-XGET", "localhost:8086/health"] # livenessProbe: # exec: # command: ["curl", "-XGET", "localhost:8086/health"] readinessProbe: exec: command: ["curl", "-XGET", "localhost:8086/health"] livenessProbe: exec: command: ["curl", "-XGET", "localhost:8086/health"] resources: requests: cpu: 250m Loading
src/monitoring/.gitlab-ci.yml +4 −2 Original line number Diff line number Diff line Loading @@ -39,9 +39,11 @@ build influx: # # - kubectl get all # - curl -XGET "10.97.74.29:8086/health" # # - kubectl delete -f "manifests/influx.yaml" - pip install influxdb - cd ./src/monitoring/service - python3 test_influx.py - docker build -t "test-influx" ./ - docker run --name test-influx --rm test-influx - docker stop test-influx - docker rmi test-influx # test if the Docker image can be pulled from the gitlab registry # test monitoring pull: Loading
src/monitoring/service/Dockerfile 0 → 100644 +6 −0 Original line number Diff line number Diff line FROM python:3-slim RUN pip install --upgrade pip RUN pip install influxdb RUN pip install datetime ENTRYPOINT ["python3", "test_influx.py"] No newline at end of file
src/monitoring/service/test_influx.py +2 −2 Original line number Diff line number Diff line from influx_tools import * from influxdb import InfluxDBClient from datetime import datetime influx = Influx('10.97.74.29', 8086, 'teraflow', 'teraflow', 'monitoring') influx = InfluxDBClient('10.97.74.29', 8086, 'teraflow', 'teraflow', 'monitoring') influx.write_KPI(datetime.now(),1,1,101,1000) results = influx.client.query('select * from samples;') print(results.raw) No newline at end of file