Loading manifests/monitoring.yaml +22 −22 Original line number Diff line number Diff line Loading @@ -13,15 +13,7 @@ spec: app: monitoring spec: terminationGracePeriodSeconds: 5 initContainers: - name: influxdb image: influxdb:1.8 ports: - containerPort: 8086 envFrom: - secretRef: name: influxdb-secrets containers: # initContainers: # - name: influxdb # image: influxdb:1.8 # ports: Loading @@ -29,19 +21,27 @@ spec: # envFrom: # - secretRef: # name: influxdb-secrets # readinessProbe: # exec: # command: ["curl", "-XGET", "localhost:8086/health"] # livenessProbe: # exec: # command: ["curl", "-XGET", "localhost:8086/health"] # resources: # requests: # cpu: 250m # memory: 512Mi # limits: # cpu: 700m # memory: 1024Mi containers: - name: influxdb image: influxdb:1.8 ports: - containerPort: 8086 envFrom: - secretRef: name: influxdb-secrets readinessProbe: exec: command: ["curl", "-XGET", "localhost:8086/health"] livenessProbe: exec: command: ["curl", "-XGET", "localhost:8086/health"] resources: requests: cpu: 250m memory: 512Mi limits: cpu: 700m memory: 1024Mi - name: server image: registry.gitlab.com/teraflow-h2020/controller/monitoring:latest imagePullPolicy: Always Loading src/monitoring/.gitlab-ci.yml +26 −26 Original line number Diff line number Diff line # build, tag and push the Docker image to the gitlab registry build monitoring: variables: IMAGE_NAME: 'monitoring' # name of the microservice IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: build before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/ - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" after_script: - docker rmi $(docker images --quiet --filter=dangling=true) rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - src/$IMAGE_NAME/tests/Dockerfile - manifests/$IMAGE_NAME.yaml - .gitlab-ci.yml # # build, tag and push the Docker image to the gitlab registry # build monitoring: # variables: # IMAGE_NAME: 'monitoring' # name of the microservice # IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) # stage: build # before_script: # - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY # script: # - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/ # - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" # - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" # after_script: # - docker rmi $(docker images --quiet --filter=dangling=true) # rules: # - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' # - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' # - changes: # - src/$IMAGE_NAME/**/*.{py,in,yml} # - src/$IMAGE_NAME/Dockerfile # - src/$IMAGE_NAME/tests/*.py # - src/$IMAGE_NAME/tests/Dockerfile # - manifests/$IMAGE_NAME.yaml # - .gitlab-ci.yml kubernetes test: stage: build Loading @@ -30,8 +30,8 @@ kubernetes test: # - kubectl get all # - kubectl delete -f "manifests/monitoring.yaml" # - sleep 15 # - kubectl apply -f "manifests/monitoring.yaml" # - sleep 30 - kubectl apply -f "manifests/monitoring.yaml" - sleep 30 - kubectl get all - kubectl --namespace gitlab-ci describe pod monitoring-84fcb785-25knt - kubectl --namespace gitlab-ci logs monitoring-84fcb785-25knt influxdb Loading Loading
manifests/monitoring.yaml +22 −22 Original line number Diff line number Diff line Loading @@ -13,15 +13,7 @@ spec: app: monitoring spec: terminationGracePeriodSeconds: 5 initContainers: - name: influxdb image: influxdb:1.8 ports: - containerPort: 8086 envFrom: - secretRef: name: influxdb-secrets containers: # initContainers: # - name: influxdb # image: influxdb:1.8 # ports: Loading @@ -29,19 +21,27 @@ spec: # envFrom: # - secretRef: # name: influxdb-secrets # readinessProbe: # exec: # command: ["curl", "-XGET", "localhost:8086/health"] # livenessProbe: # exec: # command: ["curl", "-XGET", "localhost:8086/health"] # resources: # requests: # cpu: 250m # memory: 512Mi # limits: # cpu: 700m # memory: 1024Mi containers: - name: influxdb image: influxdb:1.8 ports: - containerPort: 8086 envFrom: - secretRef: name: influxdb-secrets readinessProbe: exec: command: ["curl", "-XGET", "localhost:8086/health"] livenessProbe: exec: command: ["curl", "-XGET", "localhost:8086/health"] resources: requests: cpu: 250m memory: 512Mi limits: cpu: 700m memory: 1024Mi - name: server image: registry.gitlab.com/teraflow-h2020/controller/monitoring:latest imagePullPolicy: Always Loading
src/monitoring/.gitlab-ci.yml +26 −26 Original line number Diff line number Diff line # build, tag and push the Docker image to the gitlab registry build monitoring: variables: IMAGE_NAME: 'monitoring' # name of the microservice IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: build before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/ - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" after_script: - docker rmi $(docker images --quiet --filter=dangling=true) rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - src/$IMAGE_NAME/tests/Dockerfile - manifests/$IMAGE_NAME.yaml - .gitlab-ci.yml # # build, tag and push the Docker image to the gitlab registry # build monitoring: # variables: # IMAGE_NAME: 'monitoring' # name of the microservice # IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) # stage: build # before_script: # - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY # script: # - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/ # - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" # - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" # after_script: # - docker rmi $(docker images --quiet --filter=dangling=true) # rules: # - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' # - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' # - changes: # - src/$IMAGE_NAME/**/*.{py,in,yml} # - src/$IMAGE_NAME/Dockerfile # - src/$IMAGE_NAME/tests/*.py # - src/$IMAGE_NAME/tests/Dockerfile # - manifests/$IMAGE_NAME.yaml # - .gitlab-ci.yml kubernetes test: stage: build Loading @@ -30,8 +30,8 @@ kubernetes test: # - kubectl get all # - kubectl delete -f "manifests/monitoring.yaml" # - sleep 15 # - kubectl apply -f "manifests/monitoring.yaml" # - sleep 30 - kubectl apply -f "manifests/monitoring.yaml" - sleep 30 - kubectl get all - kubectl --namespace gitlab-ci describe pod monitoring-84fcb785-25knt - kubectl --namespace gitlab-ci logs monitoring-84fcb785-25knt influxdb Loading