Skip to content

Commit 6028579

Browse files
PMM-7: External single pmm client setup (#171)
1 parent 2b47c62 commit 6028579

File tree

3 files changed

+111
-185
lines changed

3 files changed

+111
-185
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
22
# Order is important; the last matching pattern takes the most precedence.
33

4-
* @yurkovychv @puneet0191 @olexandr-havryliak @sandraromanchenko
4+
* @yurkovychv @puneet0191 @olexandr-havryliak @sandraromanchenko @peterSirotnak

pmm_qa/external_setup.yml

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,34 +27,37 @@
2727
ignore_errors: true
2828

2929
- name: Prepare Container for External Exporters
30-
shell: >
31-
sudo docker run -d -p 43100:43100 --name={{ external_container }}
32-
phusion/baseimage:jammy-1.0.1
30+
shell: |
31+
docker run -d \
32+
-p 43100:43100 \
33+
--name={{ external_container }} \
34+
--network=pmm-qa \
35+
phusion/baseimage:noble-1.0.2
3336
3437
- name: Copy all required Artifacts to the docker external_container
3538
shell: "{{ item }}"
3639
with_items:
3740
- docker cp ./external_setup.sh {{ external_container }}:/
38-
- docker cp ./pmm3-client-setup.sh {{ external_container }}:/
3941
- docker exec {{ external_container }} apt-get update
4042
- docker exec {{ external_container }} apt-get -y install wget curl git gnupg2 lsb-release
4143

4244
- name: Run Redis Container in Host
43-
shell: "{{ item }}"
44-
with_items:
45-
- docker run --name redis_container -d -p 6379:6379 redis '--requirepass oFukiBRg7GujAJXq3tmd'
46-
- docker network connect pmm-qa redis_container
45+
shell: |
46+
docker run -d \
47+
--name=redis_container \
48+
--network=pmm-qa \
49+
-p 6379:6379 \
50+
redis '--requirepass oFukiBRg7GujAJXq3tmd'
4751
4852
- name: Setup External Exporters for monitoring
4953
shell: "{{ item }}"
5054
with_items:
5155
- docker exec {{ external_container }} bash -x ./external_setup.sh > setup_external.log
5256

53-
- name: Install pmm2-client on the external_container
54-
shell: "{{ item }}"
55-
with_items:
56-
- docker network connect pmm-qa {{ external_container }}
57-
- docker exec {{ external_container }} bash -x ./pmm3-client-setup.sh --pmm_server_ip {{ pmm_server_ip }} --client_version {{ client_version }} --admin_password {{ admin_password }} --use_metrics_mode no
57+
- name: Install PMM Client inside of container
58+
include_tasks: ./tasks/install_pmm_client.yml
59+
vars:
60+
container_name: "{{ external_container }}"
5861

5962
- name: Execute Setup script inside the External container for Redis
6063
shell: "{{ item }}"
@@ -91,11 +94,11 @@
9194
- name: Add Redis for Monitoring to PMM via pmm-admin add external command
9295
shell: "{{ item }}"
9396
with_items:
94-
- docker exec {{ external_container }} bash -c 'source ~/.bash_profile || true; pmm-admin list'
95-
- docker exec {{ external_container }} bash -c 'source ~/.bash_profile || true; pmm-admin add external --listen-port=42200 --group="redis" --service-name=redis_external_service_{{ random_number }}'
97+
- docker exec {{ external_container }} pmm-admin list
98+
- docker exec {{ external_container }} pmm-admin add external --listen-port=42200 --group="redis" --service-name=redis_external_service_{{ random_number }}
9699

97100
- name: Add Node Process for Monitoring to PMM via pmm-admin add external command
98101
shell: "{{ item }}"
99102
with_items:
100-
- docker exec {{ external_container }} bash -c 'source ~/.bash_profile || true; pmm-admin list'
101-
- docker exec {{ external_container }} bash -c 'source ~/.bash_profile || true; pmm-admin add external --group=processes --listen-port=9256 --service-name=nodeprocess_service_{{ random_number }}'
103+
- docker exec {{ external_container }} pmm-admin list
104+
- docker exec {{ external_container }} pmm-admin add external --group=processes --listen-port=9256 --service-name=nodeprocess_service_{{ random_number }}

0 commit comments

Comments
 (0)