Welcome to the documentation of cloudmon

cloudmon

StackMon as name suggest consists of multiple components required for running the tests, capturing and storing metrics, processing metrics and managing incidents in the status dashboard. It is not an easy task to ensure all of the components do what they need to do and get a corresponding configuration. CloudMon controller is a tool to automate installation and configuration management of all those components. It can be compared with Ansible AWX, since it actually even invokes ansible-runner to do the work.

CloudMon controller is supposed to become a central operating tool responsible for provisioning of all corresponding conmponents and their maintenance. It is not required to use it, but it can help to dramatically reduce operations efforts.

Please note the project is in the early development phase therefore bugs and missing features are expected to exist.

Quickstart

CloudMon requires currently 2 things to work:

  • configuration file

  • inventory

Inventory represents an Ansible inventory for the whole CloudMon installation. It defines hosts and groups onto which CloudMon components would be installed

ansible/inventory/hosts
all:
  hosts:
    # All-In-One VM
    1.2.3.4:
      ansible_user: ubuntu
      internal_address: 192.168.1.2
  children:
    # Manage graphite
    graphite:
      hosts:
        1.2.3.4:
    # ApiMon Schedulers
    schedulers:
      hosts:
        1.2.3.4:
    # ApiMon Executors
    executors:
      hosts:
        1.2.3.4:

Configuration file is responsible for defining which CloudMon plugins are going to be used, which environments need to be monitored and with which settings.

%YAML 1.2
---
monitoring_zones: # Defining from where we are monitoring
  - name: internal
    graphite_group_name: graphite
    statsd_group_name: statsd
    #  external:
    #    graphite_group_name: graphite
    #    statsd_group_name: statsd

environments: # What we monitor and which credentials to use from every monitoring location (zone)
  # NOTE: not allowed to use same cloud names in same zone for different envs
  - name: production
    env:
      OS_CLOUD: production
    monitoring_zones:
      - name: internal
        clouds:
          - name: production
            ref: p1
          - name: swift
            ref: swift1
      - name: external
        clouds:
          - name: production
            ref: p2
          - name: swift
            ref: swift1

# Known CloudMon plugins with their basic settings
plugins:
  - name: apimon
    type: apimon
    scheduler_image: quay.io/opentelekomcloud/apimon:change_35_latest
    executor_image: quay.io/opentelekomcloud/apimon:change_35_latest
    epmon_image: quay.io/opentelekomcloud/apimon:change_35_latest
    tests_projects:
      - name: apimon
        repo_url: https://github.com/stackmon/apimon-tests
        repo_ref: main
        exec_cmd: ansible-playbook -i inventory/production %s -vvv
        scenarios_location: playbooks
        grafana_dashboards_location: dashboards
  - name: epmon
    type: epmon
    image: quay.io/opentelekomcloud/apimon:change_35_latest
    config: sample_config_epmon.yaml
  - name: globalmon
    type: globalmon
    image: quay.io/stackmon/globalmon:change_12_latest
  - name: lb
    type: general
    image: quay.io/opentelekomcloud/cloudmon-plugin-lb
    init_image: quay.io/opentelekomcloud/cloudmon-plugin-lb-init

graphite:
  host: localhost

database:
  # using ha_mode (patroni) requires having multiple hosts in the postgres
  # group. For now it is disabled since there is certain instability in the
  # setup.
  # ha_mode: true
  postgres_postgres_password: ChangeMe123$
  databases:
    - name: grafana
      users:
        - name: grafana
          password: &grafana_database_password ChangeMe!123$
    - name: apimon
      users:
        - name: apimon
          password: &apimon_database_password ChangeMe!123$

grafana:
  datasources:
    - name: cloudmon
      type: graphite
    - name: apimon_db
      type: postgres
      database: apimon
      user: apimon
      jsonData:
        postgresVersion: 14
        sslmode: disable
      secureJsonData:
        password: *apimon_database_password
  config:
    grafana_image: quay.io/opentelekomcloud/grafana:9.1.5
    grafana_renderer_image: quay.io/opentelekomcloud/grafana-image-renderer:3.6.1
    grafana_security_admin_password: fake_password_change_me
    grafana_enable_renderer: "true"
    grafana_grafana_host: grafana
    grafana_renderer_host: renderer
    grafana_database_type: postgres
    grafana_database_name: grafana
    grafana_database_user: grafana
    grafana_database_password: *grafana_database_password
  dashboards:
    - name: main
      repo_url: https://github.com/stackmon/apimon-tests.git
      repo_ref: main
      path: dashboards/grafana

matrix:
  # Mapping of environments to test projects
  # Regular apimon project in env ext
  - env: production
    monitoring_zone: internal
    # TODO: placing db_url here feels questionable
    # db_url or db_entry as ref to database.databases
    db_entry: apimon.apimon
    plugins:
      - name: apimon
        schedulers_inventory_group_name: schedulers
        executors_inventory_group_name: executors
        #epmons_inventory_group_name: epmons
        tests_project: apimon
        tasks:
          - scenario1_token.yaml
      - name: epmon
        epmons_inventory_group_name: epmons
        cloud_name: production # env in zone has few creds. We need to pick one
        config_elements:
          - compute
          - dns
          - identity
          - image
          - network
          - object_store
          - orchestration
          - volume
      - name: globalmon
        globalmons_inventory_group_name: globalmons
        cloud_name: production # env in zone has few creds. We need to pick one
        config: globalmon-config.yaml

clouds_credentials:
  - name: p1
    auth:
      auth_url: https://fake.com
      username: fake_user
      password: fake_pass
      project_name: fake_project
      user_domain_name: fake_domain
  - name: swift1
    profile: otc
    auth:
      auth_url: https://fake.com
      username: fake_user
      password: fake_pass
      project_name: fake_project
      user_domain_name: fake_domain

CloudMon can be invoked specifying path to the config repository and the config directory containing config.yaml and inventory.yml files. (absolute paths) Config repo contains the public part of the configuration whereas the secret part can be stored in the config.yaml in config directory.

# Provision everything
cloudmon --config-dir PATH/TO/CONFIG_DIR --config-repo https://your-repo-url.git provision

# Using specific branch of config repo
cloudmon --config-dir PATH/TO/CONFIG_DIR --config-repo https://your-repo-url.git --config-repo-branch BRANCH_NAME provision

# Provision apimon
cloudmon --config-dir PATH/TO/CONFIG_DIR --config-repo https://your-repo-url.git apimon provision


# Stopping
cloudmon --config-dir PATH/TO/CONFIG_DIR --config-repo https://your-repo-url.git apimon stop

# Starting
cloudmon --config-dir PATH/TO/CONFIG_DIR --config-repo https://your-repo-url.git apimon start

NOTE: A sample of config repo can be found here.

CloudMon can also be invoked in insecure mode specifying path to the config file and inventory file (absolute paths). Sample files can be found in ./etc directory.

# Provision everything
cloudmon --config ./etc/sample_config.yaml --inventory ./etc/inventory_quickstart/ --insecure provision

# Provision apimon
cloudmon --config ./etc/sample_config.yaml --inventory ./etc/inventory_quickstart/ --insecure apimon provision

# Stopping
cloudmon --config ./etc/sample_config.yaml --inventory ./etc/inventory_quickstart/ --insecure apimon stop

# Starting
cloudmon --config ./etc/sample_config.yaml --inventory ./etc/inventory_quickstart/ --insecure apimon start

Unless CloudMon release process and invocation interface are clarified it is possible to use it from the local checkout and install it locally:

  • python3 setup.py develop

or

  • tox -epy39 –notest && source .tox/py39/bin/activate

Contents:

Indices and tables