Ubuntu 지원 및 process-agent 추가
This commit is contained in:
20
README.md
20
README.md
@@ -4,7 +4,6 @@
|
|||||||
* kubernetes 관제 cluster 구축
|
* kubernetes 관제 cluster 구축
|
||||||
* kubernetes 수집 cluster 구축
|
* kubernetes 수집 cluster 구축
|
||||||
* cmoa agent 설치
|
* cmoa agent 설치
|
||||||
* 현재는 RHEL 계열 OS에서만 동작 (ex. redhat, centos, rockyos 등)
|
|
||||||
#### playbook 구조
|
#### playbook 구조
|
||||||
```
|
```
|
||||||
├── README.md
|
├── README.md
|
||||||
@@ -14,10 +13,15 @@
|
|||||||
│ │ └── core
|
│ │ └── core
|
||||||
│ └── kubernetes.core-2.4.0.info
|
│ └── kubernetes.core-2.4.0.info
|
||||||
│ └── GALAXY.yml
|
│ └── GALAXY.yml
|
||||||
|
├── host.yaml
|
||||||
├── inventory
|
├── inventory
|
||||||
├── jaeger.yaml
|
├── jaeger.yaml
|
||||||
├── jspd.yaml
|
├── jspd.yaml
|
||||||
└── roles
|
└── roles
|
||||||
|
├── host
|
||||||
|
│ ├── defaults
|
||||||
|
│ ├── files
|
||||||
|
│ └── tasks
|
||||||
├── jaeger
|
├── jaeger
|
||||||
│ ├── defaults
|
│ ├── defaults
|
||||||
│ ├── files
|
│ ├── files
|
||||||
@@ -27,21 +31,17 @@
|
|||||||
├── files
|
├── files
|
||||||
└── tasks
|
└── tasks
|
||||||
```
|
```
|
||||||
#### 사용 방법
|
## 사용 방법
|
||||||
> jspd 기준 (jaeger 같은 경우 roles/jaeger/defaults)
|
|
||||||
|
|
||||||
##### 변수 수정
|
##### 변수 수정
|
||||||
`roles/jspd/defaults` 경로의 `main.yaml` 을 수정
|
`roles/host/defaults` 경로의 `main.yaml` 을 수정
|
||||||
```
|
```
|
||||||
---
|
---
|
||||||
|
|
||||||
jspd_enabled: true # jspd client 및 tpcc 설치 여부 결정 / false 일 경우 host-agent 만 설치
|
delete_enabled: false # 삭제 여부 결정
|
||||||
delete_enabled: false # client 및 tpcc 삭제 여부 결정 / true 일 경우 설치를 진행하지 않고 기존에 설치되어 있던 tpcc와 host-agent 삭제
|
|
||||||
|
|
||||||
NAMESAPCE: imxc-agent # cmoa agent를 설치한 ns 입력
|
NAMESAPCE: imxc-agent # cmoa agent를 설치한 ns 입력
|
||||||
CLUSTER_ID: kk-MJy2q2OkNiGkm # clusterid 입력
|
|
||||||
DATAGATE: 10.10.43.200:35001 # 관제 서버의 datagate:port 주소 입력 (master node ip:35001)
|
DATAGATE: 10.10.43.200:35001 # 관제 서버의 datagate:port 주소 입력 (master node ip:35001)
|
||||||
DATAGATE_IP: 10.10.43.200 # 관제 서버의 datagate 주소 입력 (master node ip)
|
|
||||||
VERSION: 3.5.2 # 버전 입력
|
VERSION: 3.5.2 # 버전 입력
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -65,6 +65,6 @@ worker02 ansible_host=10.10.43.229 ip=10.10.43.229
|
|||||||
|
|
||||||
##### agent 설치
|
##### agent 설치
|
||||||
```
|
```
|
||||||
ansible-playbook -i inventory jaeger.yaml # playbook 실행
|
ansible-playbook -i inventory host.yaml # playbook 실행
|
||||||
```
|
```
|
||||||
`delete_enabled: true` 일 경우 설치가 아닌 설치된 tpcc 와 host-agent 삭제
|
`delete_enabled: true` 일 경우 설치가 아닌 host-agent 삭제
|
||||||
|
|||||||
6
host.yaml
Normal file
6
host.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
become: true
|
||||||
|
gather_facts: true
|
||||||
|
roles:
|
||||||
|
- role: host
|
||||||
10
inventory
10
inventory
@@ -1,14 +1,16 @@
|
|||||||
[cmoa-master]
|
[cmoa_master]
|
||||||
cmoa-master-1 ansible_host=10.10.43.200 ip=10.10.43.200
|
cmoa-master-1 ansible_host=10.10.43.200 ip=10.10.43.200
|
||||||
|
|
||||||
[agent-master]
|
## HOST AGENT INSTALL NODE ##
|
||||||
master ansible_host=10.10.43.227 ip=10.10.43.227
|
|
||||||
|
|
||||||
[containerd]
|
[containerd]
|
||||||
|
master ansible_host=10.10.43.227 ip=10.10.43.227
|
||||||
worker01 ansible_host=10.10.43.228 ip=10.10.43.228
|
worker01 ansible_host=10.10.43.228 ip=10.10.43.228
|
||||||
|
|
||||||
[docker]
|
[docker]
|
||||||
master ansible_host=10.10.43.227 ip=10.10.43.227
|
|
||||||
|
|
||||||
[crio]
|
[crio]
|
||||||
worker02 ansible_host=10.10.43.229 ip=10.10.43.229
|
worker02 ansible_host=10.10.43.229 ip=10.10.43.229
|
||||||
|
|
||||||
|
[cmoa_master:vars]
|
||||||
|
ansible_user=root
|
||||||
|
|||||||
BIN
roles/.DS_Store
vendored
Normal file
BIN
roles/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
roles/host/.DS_Store
vendored
Normal file
BIN
roles/host/.DS_Store
vendored
Normal file
Binary file not shown.
7
roles/host/defaults/main.yml
Normal file
7
roles/host/defaults/main.yml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
delete_enabled: false
|
||||||
|
|
||||||
|
NAMESAPCE: imxc-agent
|
||||||
|
DATAGATE: 10.10.43.200:35001
|
||||||
|
VERSION: 3.5.2
|
||||||
BIN
roles/host/files/.DS_Store
vendored
Normal file
BIN
roles/host/files/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
roles/host/files/host-agent/host-agent.tar.gz
Normal file
BIN
roles/host/files/host-agent/host-agent.tar.gz
Normal file
Binary file not shown.
@@ -6,4 +6,5 @@
|
|||||||
ip_formatted=$(echo "$ip" | sed -e 's/[][]//g' -e 's/,//g')
|
ip_formatted=$(echo "$ip" | sed -e 's/[][]//g' -e 's/,//g')
|
||||||
kubectl exec -it -n imxc $PG -- psql -U admin postgresdb --command="INSERT INTO auth_resource3 VALUES (nextval('hibernate_sequence'), 'host|$ip_formatted:9100', false, null);"
|
kubectl exec -it -n imxc $PG -- psql -U admin postgresdb --command="INSERT INTO auth_resource3 VALUES (nextval('hibernate_sequence'), 'host|$ip_formatted:9100', false, null);"
|
||||||
done
|
done
|
||||||
when: inventory_hostname == groups['cmoa-master'][0]
|
when: inventory_hostname == groups['cmoa_master'][0]
|
||||||
|
ignore_errors: yes
|
||||||
12
roles/host/tasks/containerd.yaml
Normal file
12
roles/host/tasks/containerd.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
- name: host agent install setting - containerd
|
||||||
|
shell: |
|
||||||
|
sed -i "s/10.10.34.142/{{ hostvars[groups['cmoa_master'][0]]['ip'] }}/" /root/host-agent/default_setup.sh
|
||||||
|
sed -i "s/rel3.4.6/rel{{ VERSION }}/" /root/host-agent/default_setup.sh
|
||||||
|
when:
|
||||||
|
- inventory_hostname in groups['containerd']
|
||||||
|
|
||||||
|
- name: host agent install - containerd
|
||||||
|
shell: sh /root/host-agent/default_setup.sh
|
||||||
|
when:
|
||||||
|
- inventory_hostname in groups['containerd']
|
||||||
39
roles/host/tasks/delete.yaml
Normal file
39
roles/host/tasks/delete.yaml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
---
|
||||||
|
- name: agent container delete - docker
|
||||||
|
shell: /root/host-agent/default_stop.sh
|
||||||
|
ignore_errors: true
|
||||||
|
when:
|
||||||
|
- delete_enabled
|
||||||
|
- inventory_hostname in groups['docker']
|
||||||
|
|
||||||
|
- name: agent container delete - containerd
|
||||||
|
shell: /root/host-agent/default_stop.sh
|
||||||
|
ignore_errors: true
|
||||||
|
when:
|
||||||
|
- delete_enabled
|
||||||
|
- inventory_hostname in groups['containerd']
|
||||||
|
|
||||||
|
- name: agent conatiner delete - podman
|
||||||
|
shell: /root/host-agent/default_stop.sh
|
||||||
|
ignore_errors: true
|
||||||
|
when:
|
||||||
|
- delete_enabled
|
||||||
|
- inventory_hostname in groups['crio']
|
||||||
|
|
||||||
|
- name: old host-agent directory delete
|
||||||
|
ignore_errors: true
|
||||||
|
file:
|
||||||
|
path: /root/host-agent
|
||||||
|
state: absent
|
||||||
|
when:
|
||||||
|
- delete_enabled
|
||||||
|
- inventory_hostname in groups['docker'] or inventory_hostname in groups['containerd'] or inventory_hostname in groups['crio']
|
||||||
|
|
||||||
|
- name: old host-agent.tar.gz delete
|
||||||
|
ignore_errors: true
|
||||||
|
file:
|
||||||
|
path: /root/host-agent.tar.gz
|
||||||
|
state: absent
|
||||||
|
when:
|
||||||
|
- delete_enabled
|
||||||
|
- inventory_hostname in groups['docker'] or inventory_hostname in groups['containerd'] or inventory_hostname in groups['crio']
|
||||||
12
roles/host/tasks/docker.yaml
Normal file
12
roles/host/tasks/docker.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
- name: host agent install setting - docker
|
||||||
|
shell: |
|
||||||
|
sed -i "s/10.10.34.142/{{ hostvars[groups['cmoa_master'][0]]['ip'] }}/" /root/host-agent/default_setup.sh
|
||||||
|
sed -i "s/rel3.4.6/rel{{ VERSION }}/" /root/host-agent/default_setup.sh
|
||||||
|
when:
|
||||||
|
- inventory_hostname in groups['docker']
|
||||||
|
|
||||||
|
- name: host agent install - docker
|
||||||
|
shell: sh /root/host-agent/default_setup.sh
|
||||||
|
when:
|
||||||
|
- inventory_hostname in groups['docker']
|
||||||
@@ -5,6 +5,19 @@
|
|||||||
state: latest
|
state: latest
|
||||||
when:
|
when:
|
||||||
- inventory_hostname in groups['crio']
|
- inventory_hostname in groups['crio']
|
||||||
|
- ansible_distribution == "CentOS" or ansible_distribution == "RedHat" or ansible_distribution == "Rocky"
|
||||||
|
|
||||||
|
- name: install podman
|
||||||
|
shell: |
|
||||||
|
/etc/os-release
|
||||||
|
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_{{ ansible_distribution_version }}/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
|
||||||
|
curl -L "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_{{ ansible_distribution_version }}/Release.key" | sudo apt-key add -
|
||||||
|
apt -y update
|
||||||
|
apt -y upgrade
|
||||||
|
apt install -y podman
|
||||||
|
when:
|
||||||
|
- inventory_hostname in groups['crio']
|
||||||
|
- ansible_distribution == "Ubuntu"
|
||||||
|
|
||||||
- name: nerdctl tar.gz copy
|
- name: nerdctl tar.gz copy
|
||||||
copy:
|
copy:
|
||||||
30
roles/host/tasks/main.yml
Normal file
30
roles/host/tasks/main.yml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
- name: old host-agent dir delete - all
|
||||||
|
include: delete.yaml
|
||||||
|
when:
|
||||||
|
- delete_enabled
|
||||||
|
|
||||||
|
- name: host-agent install settings
|
||||||
|
include: hostsetting.yaml
|
||||||
|
when:
|
||||||
|
- not delete_enabled
|
||||||
|
|
||||||
|
- name: host-agent install - docker
|
||||||
|
include: docker.yaml
|
||||||
|
when:
|
||||||
|
- not delete_enabled
|
||||||
|
|
||||||
|
- name: host-agent install - containerd
|
||||||
|
include: containerd.yaml
|
||||||
|
when:
|
||||||
|
- not delete_enabled
|
||||||
|
|
||||||
|
- name: host-agent install - crio
|
||||||
|
include: podman.yaml
|
||||||
|
when:
|
||||||
|
- not delete_enabled
|
||||||
|
|
||||||
|
- name: host insert
|
||||||
|
include: cmoa.yaml
|
||||||
|
when:
|
||||||
|
- not delete_enabled
|
||||||
12
roles/host/tasks/podman.yaml
Normal file
12
roles/host/tasks/podman.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
- name: host agent install setting - crio
|
||||||
|
shell: |
|
||||||
|
sed -i "s/10.10.34.142/{{ hostvars[groups['cmoa_master'][0]]['ip'] }}/" /root/host-agent/default_setup.sh
|
||||||
|
sed -i "s/rel3.4.6/rel{{ VERSION }}/" /root/host-agent/default_setup.sh
|
||||||
|
when:
|
||||||
|
- inventory_hostname in groups['crio']
|
||||||
|
|
||||||
|
- name: host agent install - crio
|
||||||
|
shell: sh /root/host-agent/default_setup.sh
|
||||||
|
when:
|
||||||
|
- inventory_hostname in groups['crio']
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
---
|
---
|
||||||
jaeger_enabled: true
|
|
||||||
delete_enabled: false
|
delete_enabled: false
|
||||||
|
|
||||||
NAMESAPCE: imxc-agent
|
NAMESAPCE: imxc-agent
|
||||||
CLUSTER_ID: kk-MJy2q2OkNiGkm
|
CLUSTER_ID: kk-MJy2q2OkNiGkm
|
||||||
DATAGATE: 10.10.43.200:35001
|
DATAGATE: 10.10.43.200:35001
|
||||||
VERSION: 3.5.2
|
VERSION: 3.5.2
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
# Patterns to ignore when building packages.
|
|
||||||
# This supports shell glob matching, relative path matching, and
|
|
||||||
# negation (prefixed with !). Only one pattern per line.
|
|
||||||
.DS_Store
|
|
||||||
# Common VCS dirs
|
|
||||||
.git/
|
|
||||||
.gitignore
|
|
||||||
.bzr/
|
|
||||||
.bzrignore
|
|
||||||
.hg/
|
|
||||||
.hgignore
|
|
||||||
.svn/
|
|
||||||
# Common backup files
|
|
||||||
*.swp
|
|
||||||
*.bak
|
|
||||||
*.tmp
|
|
||||||
*.orig
|
|
||||||
*~
|
|
||||||
# Various IDEs
|
|
||||||
.project
|
|
||||||
.idea/
|
|
||||||
*.tmproj
|
|
||||||
.vscode/
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
apiVersion: v2
|
|
||||||
name: exem-jaeger
|
|
||||||
description: A Helm chart for Kubernetes
|
|
||||||
type: application
|
|
||||||
version: 0.1.0
|
|
||||||
appVersion: "1.0"
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
//helm uninstall cmoa-jaeger-client -n imxc-agent
|
|
||||||
helm install cmoa-jaeger-client . -n imxc-agent
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: List
|
|
||||||
items:
|
|
||||||
- apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: cloudmoa-trace-agent
|
|
||||||
#namespace: {{ .Values.global.AGENT_NAMESPACE }}
|
|
||||||
labels:
|
|
||||||
app: cloudmoa-trace-agent
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: cloudmoa-trace-agent
|
|
||||||
replicas: 1
|
|
||||||
strategy:
|
|
||||||
type: Recreate
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: cloudmoa-trace-agent
|
|
||||||
spec:
|
|
||||||
securityContext:
|
|
||||||
runAsNonRoot: true
|
|
||||||
runAsUser: 65534
|
|
||||||
containers:
|
|
||||||
- image: {{ .Values.global.IMXC_IN_REGISTRY }}/trace-agent:{{ .Values.global.TRACE_AGENT_VERSION }}
|
|
||||||
name: cloudmoa-trace-agent
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
cpu: 100m
|
|
||||||
memory: 50Mi
|
|
||||||
limits:
|
|
||||||
cpu: 200m
|
|
||||||
memory: 100Mi
|
|
||||||
ports:
|
|
||||||
- containerPort: 5775
|
|
||||||
protocol: UDP
|
|
||||||
- containerPort: 6831
|
|
||||||
protocol: UDP
|
|
||||||
- containerPort: 6832
|
|
||||||
protocol: UDP
|
|
||||||
- containerPort: 5778
|
|
||||||
protocol: TCP
|
|
||||||
env:
|
|
||||||
- name: LOG_LEVEL
|
|
||||||
value: "INFO"
|
|
||||||
- name: CLUSTER_ID
|
|
||||||
value: {{ .Values.global.CLUSTER_ID }}
|
|
||||||
- name: DATAGATE
|
|
||||||
value: {{ .Values.global.DATAGATE }}
|
|
||||||
- apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: cloudmoa-trace-agent
|
|
||||||
#namespace: {{ .Values.global.AGENT_NAMESPACE }}
|
|
||||||
labels:
|
|
||||||
app: cloudmoa-trace-agent
|
|
||||||
spec:
|
|
||||||
ports:
|
|
||||||
- name: agent-zipkin-thrift
|
|
||||||
port: 5775
|
|
||||||
protocol: UDP
|
|
||||||
targetPort: 5775
|
|
||||||
- name: agent-compact
|
|
||||||
port: 6831
|
|
||||||
protocol: UDP
|
|
||||||
targetPort: 6831
|
|
||||||
- name: agent-binary
|
|
||||||
port: 6832
|
|
||||||
protocol: UDP
|
|
||||||
targetPort: 6832
|
|
||||||
- name: agent-configs
|
|
||||||
port: 5778
|
|
||||||
protocol: TCP
|
|
||||||
targetPort: 5778
|
|
||||||
selector:
|
|
||||||
app: cloudmoa-trace-agent
|
|
||||||
type: ClusterIP
|
|
||||||
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
{{/*
|
|
||||||
Expand the name of the chart.
|
|
||||||
*/}}
|
|
||||||
{{- define "exem-jaeger.name" -}}
|
|
||||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{/*
|
|
||||||
Create a default fully qualified app name.
|
|
||||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
|
||||||
If release name contains chart name it will be used as a full name.
|
|
||||||
*/}}
|
|
||||||
{{- define "exem-jaeger.fullname" -}}
|
|
||||||
{{- if .Values.fullnameOverride }}
|
|
||||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
|
||||||
{{- else }}
|
|
||||||
{{- $name := default .Chart.Name .Values.nameOverride }}
|
|
||||||
{{- if contains $name .Release.Name }}
|
|
||||||
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
|
||||||
{{- else }}
|
|
||||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{/*
|
|
||||||
Create chart name and version as used by the chart label.
|
|
||||||
*/}}
|
|
||||||
{{- define "exem-jaeger.chart" -}}
|
|
||||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{/*
|
|
||||||
Common labels
|
|
||||||
*/}}
|
|
||||||
{{- define "exem-jaeger.labels" -}}
|
|
||||||
helm.sh/chart: {{ include "exem-jaeger.chart" . }}
|
|
||||||
{{ include "exem-jaeger.selectorLabels" . }}
|
|
||||||
{{- if .Chart.AppVersion }}
|
|
||||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
|
||||||
{{- end }}
|
|
||||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{/*
|
|
||||||
Selector labels
|
|
||||||
*/}}
|
|
||||||
{{- define "exem-jaeger.selectorLabels" -}}
|
|
||||||
app.kubernetes.io/name: {{ include "exem-jaeger.name" . }}
|
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{/*
|
|
||||||
Create the name of the service account to use
|
|
||||||
*/}}
|
|
||||||
{{- define "exem-jaeger.serviceAccountName" -}}
|
|
||||||
{{- if .Values.serviceAccount.create }}
|
|
||||||
{{- default (include "exem-jaeger.fullname" .) .Values.serviceAccount.name }}
|
|
||||||
{{- else }}
|
|
||||||
{{- default "default" .Values.serviceAccount.name }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
global:
|
|
||||||
# cluster variables
|
|
||||||
CLUSTER_ID: bE06QBaN4XAbpf3z9g1CjF
|
|
||||||
IMXC_IN_REGISTRY: 10.10.31.243:5000/cmoa3
|
|
||||||
DATAGATE: 10.10.34.142:30051
|
|
||||||
#DATAGATE_IP: 10.10.34.142
|
|
||||||
#DATAGATE_PORT: 30051
|
|
||||||
|
|
||||||
TRACE_AGENT_VERSION: rel3.4.6
|
|
||||||
|
|
||||||
Binary file not shown.
@@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
- name: host agent install setting [1] - containerd
|
|
||||||
lineinfile:
|
|
||||||
path: /root/host-agent/nerdctl-host/metric-agent.yml
|
|
||||||
regexp: 'targets'
|
|
||||||
line: " - targets: ['{{ ip }}:9100']"
|
|
||||||
when:
|
|
||||||
- inventory_hostname in groups['containerd']
|
|
||||||
|
|
||||||
- name: host agent install setting [2] - containerd
|
|
||||||
shell: |
|
|
||||||
sed -i "s/10.10.34.142/{{ hostvars[groups['cmoa-master'][0]]['ip'] }}/" /root/host-agent/nerdctl-host/setup_nerdctl.sh
|
|
||||||
sed -i "s/rel3.4.6/rel{{ VERSION }}/" /root/host-agent/nerdctl-host/setup_nerdctl.sh
|
|
||||||
when:
|
|
||||||
- inventory_hostname in groups['containerd']
|
|
||||||
|
|
||||||
- name: host agent install - containerd
|
|
||||||
shell: sh /root/host-agent/nerdctl-host/setup_nerdctl.sh
|
|
||||||
when:
|
|
||||||
- inventory_hostname in groups['containerd']
|
|
||||||
@@ -1,25 +1,4 @@
|
|||||||
---
|
---
|
||||||
- name: agent container delete - docker
|
|
||||||
shell: /root/host-agent/docker-host/stop.sh
|
|
||||||
ignore_errors: true
|
|
||||||
when:
|
|
||||||
- delete_enabled
|
|
||||||
- inventory_hostname in groups['docker']
|
|
||||||
|
|
||||||
- name: agent container delete - containerd
|
|
||||||
shell: /root/host-agent/nerdctl-host/stop_nerdctl.sh
|
|
||||||
ignore_errors: true
|
|
||||||
when:
|
|
||||||
- delete_enabled
|
|
||||||
- inventory_hostname in groups['containerd']
|
|
||||||
|
|
||||||
- name: agent conatiner delete - podman
|
|
||||||
shell: /root/host-agent/podman-host/stop.sh
|
|
||||||
ignore_errors: true
|
|
||||||
when:
|
|
||||||
- delete_enabled
|
|
||||||
- inventory_hostname in groups['crio']
|
|
||||||
|
|
||||||
- name: jspd tpcc delete
|
- name: jspd tpcc delete
|
||||||
kubernetes.core.helm:
|
kubernetes.core.helm:
|
||||||
chart_ref: "/root/jspd-tpcc"
|
chart_ref: "/root/jspd-tpcc"
|
||||||
@@ -40,15 +19,6 @@
|
|||||||
when:
|
when:
|
||||||
- inventory_hostname == groups['agent-master'][0]
|
- inventory_hostname == groups['agent-master'][0]
|
||||||
|
|
||||||
- name: old host-agent directory delete
|
|
||||||
ignore_errors: true
|
|
||||||
file:
|
|
||||||
path: /root/host-agent
|
|
||||||
state: absent
|
|
||||||
when:
|
|
||||||
- delete_enabled
|
|
||||||
- inventory_hostname in groups['docker'] or inventory_hostname in groups['containerd'] or inventory_hostname in groups['crio']
|
|
||||||
|
|
||||||
- name: old jspd-client directory delete
|
- name: old jspd-client directory delete
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
file:
|
file:
|
||||||
@@ -65,13 +35,4 @@
|
|||||||
state: absent
|
state: absent
|
||||||
when:
|
when:
|
||||||
- delete_enabled
|
- delete_enabled
|
||||||
- inventory_hostname in groups['docker'] or inventory_hostname in groups['containerd'] or inventory_hostname in groups['crio']
|
- inventory_hostname in groups['docker'] or inventory_hostname in groups['containerd'] or inventory_hostname in groups['crio']
|
||||||
|
|
||||||
- name: old host-agent.tar.gz delete
|
|
||||||
ignore_errors: true
|
|
||||||
file:
|
|
||||||
path: /root/host-agent.tar.gz
|
|
||||||
state: absent
|
|
||||||
when:
|
|
||||||
- delete_enabled
|
|
||||||
- inventory_hostname in groups['docker'] or inventory_hostname in groups['containerd'] or inventory_hostname in groups['crio']
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
- name: host agent install setting [1] - docker
|
|
||||||
lineinfile:
|
|
||||||
path: /root/host-agent/docker-host/metric-agent.yml
|
|
||||||
regexp: 'targets'
|
|
||||||
line: " - targets: ['{{ ip }}:9100']"
|
|
||||||
when:
|
|
||||||
- inventory_hostname in groups['docker']
|
|
||||||
|
|
||||||
- name: host agent install setting [2] - docker
|
|
||||||
shell: |
|
|
||||||
sed -i "s/10.10.34.142/{{ hostvars[groups['cmoa-master'][0]]['ip'] }}/" /root/host-agent/docker-host/setup.sh
|
|
||||||
sed -i "s/rel3.4.6/rel{{ VERSION }}/" /root/host-agent/docker-host/setup.sh
|
|
||||||
when:
|
|
||||||
- inventory_hostname in groups['docker']
|
|
||||||
|
|
||||||
- name: host agent install - docker
|
|
||||||
shell: sh /root/host-agent/docker-host/setup.sh
|
|
||||||
when:
|
|
||||||
- inventory_hostname in groups['docker']
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
- name: old host-agent dir delete - all
|
- name: old tpcc dir delete
|
||||||
include: delete.yaml
|
include: delete.yaml
|
||||||
when:
|
when:
|
||||||
- delete_enabled
|
- delete_enabled
|
||||||
@@ -7,30 +7,4 @@
|
|||||||
- name: jaeger-tpcc install
|
- name: jaeger-tpcc install
|
||||||
include: tpcc.yaml
|
include: tpcc.yaml
|
||||||
when:
|
when:
|
||||||
- jaeger_enabled
|
- not delete_enabled
|
||||||
- not delete_enabled
|
|
||||||
|
|
||||||
- name: host-agent install settings
|
|
||||||
include: hostsetting.yaml
|
|
||||||
when:
|
|
||||||
- not delete_enabled
|
|
||||||
|
|
||||||
- name: host-agent install - docker
|
|
||||||
include: docker.yaml
|
|
||||||
when:
|
|
||||||
- not delete_enabled
|
|
||||||
|
|
||||||
- name: host-agent install - containerd
|
|
||||||
include: containerd.yaml
|
|
||||||
when:
|
|
||||||
- not delete_enabled
|
|
||||||
|
|
||||||
- name: host-agent install - crio
|
|
||||||
include: podman.yaml
|
|
||||||
when:
|
|
||||||
- not delete_enabled
|
|
||||||
|
|
||||||
- name: host insert
|
|
||||||
include: cmoa.yaml
|
|
||||||
when:
|
|
||||||
- not delete_enabled
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
- name: host agent install setting [1] - crio
|
|
||||||
lineinfile:
|
|
||||||
path: /root/host-agent/podman-host/metric-agent.yml
|
|
||||||
regexp: 'targets'
|
|
||||||
line: " - targets: ['{{ ip }}:9100']"
|
|
||||||
when:
|
|
||||||
- inventory_hostname in groups['crio']
|
|
||||||
|
|
||||||
- name: host agent install setting [2] - crio
|
|
||||||
shell: |
|
|
||||||
sed -i "s/10.10.34.142/{{ hostvars[groups['cmoa-master'][0]]['ip'] }}/" /root/host-agent/podman-host/setup.sh
|
|
||||||
sed -i "s/rel3.4.6/rel{{ VERSION }}/" /root/host-agent/podman-host/setup.sh
|
|
||||||
when:
|
|
||||||
- inventory_hostname in groups['crio']
|
|
||||||
|
|
||||||
- name: host agent install - crio
|
|
||||||
shell: sh /root/host-agent/podman-host/setup.sh
|
|
||||||
when:
|
|
||||||
- inventory_hostname in groups['crio']
|
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
jspd_enabled: true
|
|
||||||
delete_enabled: false
|
delete_enabled: false
|
||||||
|
|
||||||
NAMESAPCE: imxc-agent
|
NAMESAPCE: imxc-agent
|
||||||
CLUSTER_ID: kk-MJy2q2OkNiGkm
|
CLUSTER_ID: kk-MJy2q2OkNiGkm
|
||||||
DATAGATE: 10.10.43.200:35001
|
DATAGATE: 10.10.43.200:35001
|
||||||
DATAGATE_IP: 10.10.43.200
|
DATAGATE_IP: 10.10.43.200
|
||||||
VERSION: 3.5.2
|
VERSION: 3.5.2
|
||||||
Binary file not shown.
Binary file not shown.
@@ -1,9 +0,0 @@
|
|||||||
---
|
|
||||||
- name: host insert
|
|
||||||
shell: |
|
|
||||||
PG=$(kubectl get po -n imxc | grep postgres | awk '{print $1}')
|
|
||||||
for ip in {{ groups['containerd'] | map('extract', hostvars, ['ansible_host']) | union(groups['docker'] | map('extract', hostvars, ['ansible_host'])) | union(groups['crio'] | map('extract', hostvars, ['ansible_host'])) }}; do
|
|
||||||
ip_formatted=$(echo "$ip" | sed -e 's/[][]//g' -e 's/,//g')
|
|
||||||
kubectl exec -it -n imxc $PG -- psql -U admin postgresdb --command="INSERT INTO auth_resource3 VALUES (nextval('hibernate_sequence'), 'host|$ip_formatted:9100', false, null);"
|
|
||||||
done
|
|
||||||
when: inventory_hostname == groups['cmoa-master'][0]
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
- name: host agent install setting [1] - containerd
|
|
||||||
lineinfile:
|
|
||||||
path: /root/host-agent/nerdctl-host/metric-agent.yml
|
|
||||||
regexp: 'targets'
|
|
||||||
line: " - targets: ['{{ ip }}:9100']"
|
|
||||||
when:
|
|
||||||
- inventory_hostname in groups['containerd']
|
|
||||||
|
|
||||||
- name: host agent install setting [2] - containerd
|
|
||||||
shell: |
|
|
||||||
sed -i "s/10.10.34.142/{{ hostvars[groups['cmoa-master'][0]]['ip'] }}/" /root/host-agent/nerdctl-host/setup_nerdctl.sh
|
|
||||||
sed -i "s/rel3.4.6/rel{{ VERSION }}/" /root/host-agent/nerdctl-host/setup_nerdctl.sh
|
|
||||||
when:
|
|
||||||
- inventory_hostname in groups['containerd']
|
|
||||||
|
|
||||||
- name: host agent install - containerd
|
|
||||||
shell: sh /root/host-agent/nerdctl-host/setup_nerdctl.sh
|
|
||||||
when:
|
|
||||||
- inventory_hostname in groups['containerd']
|
|
||||||
@@ -1,25 +1,4 @@
|
|||||||
---
|
---
|
||||||
- name: agent container delete - docker
|
|
||||||
shell: /root/host-agent/docker-host/stop.sh
|
|
||||||
ignore_errors: true
|
|
||||||
when:
|
|
||||||
- delete_enabled
|
|
||||||
- inventory_hostname in groups['docker']
|
|
||||||
|
|
||||||
- name: agent container delete - containerd
|
|
||||||
shell: /root/host-agent/nerdctl-host/stop_nerdctl.sh
|
|
||||||
ignore_errors: true
|
|
||||||
when:
|
|
||||||
- delete_enabled
|
|
||||||
- inventory_hostname in groups['containerd']
|
|
||||||
|
|
||||||
- name: agent conatiner delete - podman
|
|
||||||
shell: /root/host-agent/podman-host/stop.sh
|
|
||||||
ignore_errors: true
|
|
||||||
when:
|
|
||||||
- delete_enabled
|
|
||||||
- inventory_hostname in groups['crio']
|
|
||||||
|
|
||||||
- name: jspd tpcc delete
|
- name: jspd tpcc delete
|
||||||
kubernetes.core.helm:
|
kubernetes.core.helm:
|
||||||
chart_ref: "/root/jspd-tpcc"
|
chart_ref: "/root/jspd-tpcc"
|
||||||
@@ -40,15 +19,6 @@
|
|||||||
when:
|
when:
|
||||||
- inventory_hostname == groups['agent-master'][0]
|
- inventory_hostname == groups['agent-master'][0]
|
||||||
|
|
||||||
- name: old host-agent directory delete
|
|
||||||
ignore_errors: true
|
|
||||||
file:
|
|
||||||
path: /root/host-agent
|
|
||||||
state: absent
|
|
||||||
when:
|
|
||||||
- delete_enabled
|
|
||||||
- inventory_hostname in groups['docker'] or inventory_hostname in groups['containerd'] or inventory_hostname in groups['crio']
|
|
||||||
|
|
||||||
- name: old jspd-client directory delete
|
- name: old jspd-client directory delete
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
file:
|
file:
|
||||||
@@ -65,13 +35,4 @@
|
|||||||
state: absent
|
state: absent
|
||||||
when:
|
when:
|
||||||
- delete_enabled
|
- delete_enabled
|
||||||
- inventory_hostname in groups['docker'] or inventory_hostname in groups['containerd'] or inventory_hostname in groups['crio']
|
- inventory_hostname in groups['docker'] or inventory_hostname in groups['containerd'] or inventory_hostname in groups['crio']
|
||||||
|
|
||||||
- name: old host-agent.tar.gz delete
|
|
||||||
ignore_errors: true
|
|
||||||
file:
|
|
||||||
path: /root/host-agent.tar.gz
|
|
||||||
state: absent
|
|
||||||
when:
|
|
||||||
- delete_enabled
|
|
||||||
- inventory_hostname in groups['docker'] or inventory_hostname in groups['containerd'] or inventory_hostname in groups['crio']
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
- name: host agent install setting [1] - docker
|
|
||||||
lineinfile:
|
|
||||||
path: /root/host-agent/docker-host/metric-agent.yml
|
|
||||||
regexp: 'targets'
|
|
||||||
line: " - targets: ['{{ ip }}:9100']"
|
|
||||||
when:
|
|
||||||
- inventory_hostname in groups['docker']
|
|
||||||
|
|
||||||
- name: host agent install setting [2] - docker
|
|
||||||
shell: |
|
|
||||||
sed -i "s/10.10.34.142/{{ hostvars[groups['cmoa-master'][0]]['ip'] }}/" /root/host-agent/docker-host/setup.sh
|
|
||||||
sed -i "s/rel3.4.6/rel{{ VERSION }}/" /root/host-agent/docker-host/setup.sh
|
|
||||||
when:
|
|
||||||
- inventory_hostname in groups['docker']
|
|
||||||
|
|
||||||
- name: host agent install - docker
|
|
||||||
shell: sh /root/host-agent/docker-host/setup.sh
|
|
||||||
when:
|
|
||||||
- inventory_hostname in groups['docker']
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
---
|
|
||||||
- name: install podman
|
|
||||||
package:
|
|
||||||
name: podman
|
|
||||||
state: latest
|
|
||||||
when:
|
|
||||||
- inventory_hostname in groups['crio']
|
|
||||||
|
|
||||||
- name: nerdctl tar.gz copy
|
|
||||||
copy:
|
|
||||||
src: "{{ role_path }}/files/host-agent/nerdctl-0.19.0-linux-amd64.tar.gz"
|
|
||||||
dest: /root
|
|
||||||
when:
|
|
||||||
- inventory_hostname in groups['containerd']
|
|
||||||
|
|
||||||
- name: nerdctl unarchive
|
|
||||||
unarchive:
|
|
||||||
src: /root/nerdctl-0.19.0-linux-amd64.tar.gz
|
|
||||||
dest: /usr/local/bin
|
|
||||||
remote_src: yes
|
|
||||||
when:
|
|
||||||
- inventory_hostname in groups['containerd']
|
|
||||||
|
|
||||||
- name: host-agent.tar.gz copy
|
|
||||||
copy:
|
|
||||||
src: "{{ role_path }}/files/host-agent/host-agent.tar.gz"
|
|
||||||
dest: /root/
|
|
||||||
when:
|
|
||||||
- inventory_hostname in groups['containerd'] or inventory_hostname in groups['docker'] or inventory_hostname in groups['crio']
|
|
||||||
|
|
||||||
- name: create host-agent directory
|
|
||||||
file:
|
|
||||||
path: /root/host-agent
|
|
||||||
state: directory
|
|
||||||
when:
|
|
||||||
- inventory_hostname in groups['containerd'] or inventory_hostname in groups['docker'] or inventory_hostname in groups['crio']
|
|
||||||
|
|
||||||
- name: host-agent.tar.gz unarchive
|
|
||||||
unarchive:
|
|
||||||
src: /root/host-agent.tar.gz
|
|
||||||
dest: /root/host-agent/
|
|
||||||
remote_src: yes
|
|
||||||
when:
|
|
||||||
- inventory_hostname in groups['containerd'] or inventory_hostname in groups['docker'] or inventory_hostname in groups['crio']
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
- name: old host-agent dir delete - all
|
- name: old tpcc dir delete
|
||||||
include: delete.yaml
|
include: delete.yaml
|
||||||
when:
|
when:
|
||||||
- delete_enabled
|
- delete_enabled
|
||||||
@@ -7,30 +7,4 @@
|
|||||||
- name: jspd-tpcc install
|
- name: jspd-tpcc install
|
||||||
include: tpcc.yaml
|
include: tpcc.yaml
|
||||||
when:
|
when:
|
||||||
- jspd_enabled
|
- not delete_enabled
|
||||||
- not delete_enabled
|
|
||||||
|
|
||||||
- name: host-agent install settings
|
|
||||||
include: hostsetting.yaml
|
|
||||||
when:
|
|
||||||
- not delete_enabled
|
|
||||||
|
|
||||||
- name: host-agent install - docker
|
|
||||||
include: docker.yaml
|
|
||||||
when:
|
|
||||||
- not delete_enabled
|
|
||||||
|
|
||||||
- name: host-agent install - containerd
|
|
||||||
include: containerd.yaml
|
|
||||||
when:
|
|
||||||
- not delete_enabled
|
|
||||||
|
|
||||||
- name: host-agent install - crio
|
|
||||||
include: podman.yaml
|
|
||||||
when:
|
|
||||||
- not delete_enabled
|
|
||||||
|
|
||||||
- name: host insert
|
|
||||||
include: cmoa.yaml
|
|
||||||
when:
|
|
||||||
- not delete_enabled
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
- name: host agent install setting [1] - crio
|
|
||||||
lineinfile:
|
|
||||||
path: /root/host-agent/podman-host/metric-agent.yml
|
|
||||||
regexp: 'targets'
|
|
||||||
line: " - targets: ['{{ ip }}:9100']"
|
|
||||||
when:
|
|
||||||
- inventory_hostname in groups['crio']
|
|
||||||
|
|
||||||
- name: host agent install setting [2] - crio
|
|
||||||
shell: |
|
|
||||||
sed -i "s/10.10.34.142/{{ hostvars[groups['cmoa-master'][0]]['ip'] }}/" /root/host-agent/podman-host/setup.sh
|
|
||||||
sed -i "s/rel3.4.6/rel{{ VERSION }}/" /root/host-agent/podman-host/setup.sh
|
|
||||||
when:
|
|
||||||
- inventory_hostname in groups['crio']
|
|
||||||
|
|
||||||
- name: host agent install - crio
|
|
||||||
shell: sh /root/host-agent/podman-host/setup.sh
|
|
||||||
when:
|
|
||||||
- inventory_hostname in groups['crio']
|
|
||||||
Reference in New Issue
Block a user