tpcc and host-agent ansible installer add
This commit is contained in:
10
roles/jspd/defaults/main.yml
Normal file
10
roles/jspd/defaults/main.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
|
||||
jspd_enabled: true
|
||||
delete_enabled: false
|
||||
|
||||
NAMESAPCE: imxc-agent
|
||||
CLUSTER_ID: kk-MJy2q2OkNiGkm
|
||||
DATAGATE: 10.10.43.200:35001
|
||||
DATAGATE_IP: 10.10.43.200
|
||||
VERSION: 3.5.2
|
||||
BIN
roles/jspd/files/helm.tar.gz
Normal file
BIN
roles/jspd/files/helm.tar.gz
Normal file
Binary file not shown.
BIN
roles/jspd/files/host-agent/host-agent.tar.gz
Normal file
BIN
roles/jspd/files/host-agent/host-agent.tar.gz
Normal file
Binary file not shown.
BIN
roles/jspd/files/host-agent/nerdctl-0.19.0-linux-amd64.tar.gz
Normal file
BIN
roles/jspd/files/host-agent/nerdctl-0.19.0-linux-amd64.tar.gz
Normal file
Binary file not shown.
23
roles/jspd/files/jspd-client/.helmignore
Normal file
23
roles/jspd/files/jspd-client/.helmignore
Normal file
@@ -0,0 +1,23 @@
|
||||
# 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/
|
||||
6
roles/jspd/files/jspd-client/Chart.yaml
Normal file
6
roles/jspd/files/jspd-client/Chart.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
apiVersion: v2
|
||||
name: exem-jspd
|
||||
description: A Helm chart for Kubernetes
|
||||
type: application
|
||||
version: 0.1.0
|
||||
appVersion: "1.0"
|
||||
2
roles/jspd/files/jspd-client/install.sh
Normal file
2
roles/jspd/files/jspd-client/install.sh
Normal file
@@ -0,0 +1,2 @@
|
||||
// helm uninstall cmoa-jspd-client -n imxc
|
||||
helm install cmoa-jspd-client . -n imxc
|
||||
@@ -0,0 +1,57 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: jspd-lite-collector
|
||||
#namespace: {{ .Values.global.AGENT_NAMESPACE }}
|
||||
labels:
|
||||
app: jspd-lite-collector
|
||||
spec:
|
||||
ports:
|
||||
- name: jspd-lite-collector
|
||||
protocol: TCP
|
||||
port: 50083
|
||||
targetPort: 50083
|
||||
selector:
|
||||
app: jspd-lite-collector
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
#namespace: {{ .Values.global.AGENT_NAMESPACE }}
|
||||
name: jspd-lite-collector
|
||||
labels:
|
||||
app: jspd-lite-collector
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: jspd-lite-collector
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: jspd-lite-collector
|
||||
spec:
|
||||
containers:
|
||||
- name: jspd-lite-collector
|
||||
image: {{ .Values.global.IMXC_IN_REGISTRY }}/jspdlitecollector:{{ .Values.global.TRACE_AGENT_VERSION }}
|
||||
imagePullPolicy: IfNotPresent
|
||||
resources:
|
||||
limits:
|
||||
memory: "500Mi"
|
||||
cpu: "500m"
|
||||
requests:
|
||||
cpu: "100m"
|
||||
ports:
|
||||
- containerPort: 50083
|
||||
env:
|
||||
- name: CMOA_CLST_ID
|
||||
value: {{ .Values.global.CLUSTER_ID }}
|
||||
- name: CMOA_JSPDCOLLECT_PORT
|
||||
value: "50083"
|
||||
- name: CMOA_DATAGATE_IP
|
||||
value: {{ .Values.global.DATAGATE_IP }}
|
||||
- name: CMOA_DATAGATE_PORT
|
||||
value: "{{ .Values.global.DATAGATE_PORT }}"
|
||||
- name: LOG_LEVEL
|
||||
value: INFO
|
||||
14
roles/jspd/files/jspd-client/values.yaml
Normal file
14
roles/jspd/files/jspd-client/values.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
global:
|
||||
# cluster variables
|
||||
CLUSTER_ID: none
|
||||
IMXC_IN_REGISTRY: none
|
||||
DATAGATE: none
|
||||
DATAGATE_IP: none
|
||||
DATAGATE_PORT: 30051
|
||||
|
||||
JSPD_LITE_COLLECTOR_NODEPORT: 40083
|
||||
JSPD_LITE_COLLECTOR_VERSION: none
|
||||
|
||||
TRACE_AGENT_VERSION: none
|
||||
|
||||
|
||||
23
roles/jspd/files/jspd-tpcc/.helmignore
Executable file
23
roles/jspd/files/jspd-tpcc/.helmignore
Executable file
@@ -0,0 +1,23 @@
|
||||
# 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/
|
||||
6
roles/jspd/files/jspd-tpcc/Chart.yaml
Executable file
6
roles/jspd/files/jspd-tpcc/Chart.yaml
Executable file
@@ -0,0 +1,6 @@
|
||||
apiVersion: v2
|
||||
name: exem-jspd
|
||||
description: A Helm chart for Kubernetes
|
||||
type: application
|
||||
version: 0.1.0
|
||||
appVersion: "1.0"
|
||||
3
roles/jspd/files/jspd-tpcc/install.sh
Normal file
3
roles/jspd/files/jspd-tpcc/install.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
// helm uninstall cmoa-jspd-tpcc -n default
|
||||
helm install cmoa-jspd-tpcc . -n default
|
||||
@@ -0,0 +1,19 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: postgres-config
|
||||
labels:
|
||||
app: postgres
|
||||
data:
|
||||
POSTGRES_DB: postgres
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: postgres-exporter-config
|
||||
labels:
|
||||
app: postgres-exporter
|
||||
data:
|
||||
DATA_SOURCE_NAME: postgresql://postgres:postgres@localhost:5432/postgres?sslmode=disable
|
||||
@@ -0,0 +1,27 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: postgres
|
||||
labels:
|
||||
app: postgres
|
||||
spec:
|
||||
type: NodePort
|
||||
ports:
|
||||
- port: 5432
|
||||
nodePort: {{ .Values.global.POSTGRES_NODEPORT }}
|
||||
selector:
|
||||
app: postgres
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: postgres-exporter
|
||||
labels:
|
||||
app: postgres-exporter
|
||||
spec:
|
||||
type: NodePort
|
||||
ports:
|
||||
- port: 9187
|
||||
nodePort: {{ .Values.global.POSTGRES_EXPORTER_NODEPORT }}
|
||||
selector:
|
||||
app: postgres
|
||||
@@ -0,0 +1,24 @@
|
||||
#apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: postgres
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: postgres
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: postgres
|
||||
spec:
|
||||
containers:
|
||||
- name: postgres
|
||||
image: {{ .Values.global.IMXC_IN_REGISTRY }}/postgres:0.1
|
||||
imagePullPolicy: "IfNotPresent"
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: postgres-config
|
||||
@@ -0,0 +1,10 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: tpcc-client-config
|
||||
labels:
|
||||
app: tpcc-client
|
||||
data:
|
||||
ADDRESS: "tpcc-main:30080"
|
||||
TPS: "20"
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
kind: Service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: tpcc-client
|
||||
spec:
|
||||
selector:
|
||||
app: tpcc-client
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 30000
|
||||
targetPort: 30000
|
||||
@@ -0,0 +1,24 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: tpcc-client
|
||||
labels:
|
||||
app: tpcc-client
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: tpcc-client
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: tpcc-client
|
||||
spec:
|
||||
containers:
|
||||
- name: tpcc-client
|
||||
image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-client:R30020210216
|
||||
ports:
|
||||
- containerPort: 30000
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: tpcc-client-config
|
||||
14
roles/jspd/files/jspd-tpcc/templates/0_tpcc/tpcc_server/tpcc_configmap.yml
Executable file
14
roles/jspd/files/jspd-tpcc/templates/0_tpcc/tpcc_server/tpcc_configmap.yml
Executable file
@@ -0,0 +1,14 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
namespace: {{ .Values.global.TPCC_NAMESPACE }}
|
||||
name: tpcc-config
|
||||
labels:
|
||||
app: tpcc
|
||||
data:
|
||||
JDBC_URL: "jdbc:postgresql://postgres:5432/postgres"
|
||||
JDBC_USER: postgres
|
||||
JDBC_PASSWORD: postgres
|
||||
JAEGER_SAMPLER_TYPE: remote
|
||||
#JAEGER_SAMPLER_PARAM: "1"
|
||||
JAEGER_SAMPLER_MANAGER_HOST_PORT: jaeger-agent.{{ .Values.global.AGENT_NAMESPACE }}.svc.cluster.local:5778
|
||||
442
roles/jspd/files/jspd-tpcc/templates/0_tpcc/tpcc_server/tpcc_deploy.yaml
Executable file
442
roles/jspd/files/jspd-tpcc/templates/0_tpcc/tpcc_server/tpcc_deploy.yaml
Executable file
@@ -0,0 +1,442 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
namespace: {{ .Values.global.TPCC_NAMESPACE }}
|
||||
name: tpcc-main
|
||||
labels:
|
||||
app: tpcc-main
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: tpcc-main
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: tpcc-main
|
||||
traceAgentType: jspd
|
||||
spec:
|
||||
containers:
|
||||
- name: tpcc-main
|
||||
image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-main:JSPD
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 39080
|
||||
env:
|
||||
- name: CMOA_JSPDCOLLECT_IP
|
||||
value: jspd-lite-collector.{{ .Values.global.AGENT_NAMESPACE }}
|
||||
- name: CMOA_JSPDCOLLECT_PORT
|
||||
value: "50083"
|
||||
- name: CMOA_CLST_ID
|
||||
value: {{ .Values.global.CLUSTER_ID }}
|
||||
- name: CMOA_NODE_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
- name: CMOA_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: CMOA_POD_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: CMOA_SERVICE
|
||||
value: "tpcc-main"
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: tpcc-config
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
namespace: {{ .Values.global.TPCC_NAMESPACE }}
|
||||
name: tpcc-neworder
|
||||
labels:
|
||||
app: tpcc-neworder
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: tpcc-neworder
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: tpcc-neworder
|
||||
traceAgentType: jspd
|
||||
spec:
|
||||
containers:
|
||||
- name: tpcc-neworder
|
||||
image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-neworder:JSPD
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 39081
|
||||
env:
|
||||
- name: CMOA_JSPDCOLLECT_IP
|
||||
value: jspd-lite-collector.{{ .Values.global.AGENT_NAMESPACE }}
|
||||
- name: CMOA_JSPDCOLLECT_PORT
|
||||
value: "50083"
|
||||
- name: CMOA_CLST_ID
|
||||
value: {{ .Values.global.CLUSTER_ID }}
|
||||
- name: CMOA_NODE_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
- name: CMOA_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: CMOA_POD_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: CMOA_SERVICE
|
||||
value: "tpcc-neworder"
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: tpcc-config
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
namespace: {{ .Values.global.TPCC_NAMESPACE }}
|
||||
name: tpcc-orderstatus
|
||||
labels:
|
||||
app: tpcc-orderstatus
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: tpcc-orderstatus
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: tpcc-orderstatus
|
||||
traceAgentType: jspd
|
||||
spec:
|
||||
containers:
|
||||
- name: tpcc-orderstatus
|
||||
image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-orderstatus:JSPD
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 39084
|
||||
env:
|
||||
- name: CMOA_JSPDCOLLECT_IP
|
||||
value: jspd-lite-collector.{{ .Values.global.AGENT_NAMESPACE }}
|
||||
- name: CMOA_JSPDCOLLECT_PORT
|
||||
value: "50083"
|
||||
- name: CMOA_CLST_ID
|
||||
value: {{ .Values.global.CLUSTER_ID }}
|
||||
- name: CMOA_NODE_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
- name: CMOA_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: CMOA_POD_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: CMOA_SERVICE
|
||||
value: "tpcc-orderstatus"
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: tpcc-config
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
namespace: {{ .Values.global.TPCC_NAMESPACE }}
|
||||
name: tpcc-user
|
||||
labels:
|
||||
app: tpcc-user
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: tpcc-user
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: tpcc-user
|
||||
traceAgentType: jspd
|
||||
spec:
|
||||
containers:
|
||||
- name: tpcc-user
|
||||
image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-user:JSPD
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 39087
|
||||
env:
|
||||
- name: CMOA_JSPDCOLLECT_IP
|
||||
value: jspd-lite-collector.{{ .Values.global.AGENT_NAMESPACE }}
|
||||
- name: CMOA_JSPDCOLLECT_PORT
|
||||
value: "50083"
|
||||
- name: CMOA_CLST_ID
|
||||
value: {{ .Values.global.CLUSTER_ID }}
|
||||
- name: CMOA_NODE_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
- name: CMOA_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: CMOA_POD_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: CMOA_SERVICE
|
||||
value: "tpcc-user"
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: tpcc-config
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
namespace: {{ .Values.global.TPCC_NAMESPACE }}
|
||||
name: tpcc-delivery
|
||||
labels:
|
||||
app: tpcc-delivery
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: tpcc-delivery
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: tpcc-delivery
|
||||
traceAgentType: jspd
|
||||
spec:
|
||||
containers:
|
||||
- name: tpcc-delivery
|
||||
image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-delivery:JSPD
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 39088
|
||||
env:
|
||||
- name: CMOA_JSPDCOLLECT_IP
|
||||
value: jspd-lite-collector.{{ .Values.global.AGENT_NAMESPACE }}
|
||||
- name: CMOA_JSPDCOLLECT_PORT
|
||||
value: "50083"
|
||||
- name: CMOA_CLST_ID
|
||||
value: {{ .Values.global.CLUSTER_ID }}
|
||||
- name: CMOA_NODE_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
- name: CMOA_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: CMOA_POD_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: CMOA_SERVICE
|
||||
value: "tpcc-delivery"
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: tpcc-config
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
namespace: {{ .Values.global.TPCC_NAMESPACE }}
|
||||
name: tpcc-payment
|
||||
labels:
|
||||
app: tpcc-payment
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: tpcc-payment
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: tpcc-payment
|
||||
traceAgentType: jspd
|
||||
spec:
|
||||
containers:
|
||||
- name: tpcc-payment
|
||||
image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-payment:JSPD
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 39089
|
||||
env:
|
||||
- name: CMOA_JSPDCOLLECT_IP
|
||||
value: jspd-lite-collector.{{ .Values.global.AGENT_NAMESPACE }}
|
||||
- name: CMOA_JSPDCOLLECT_PORT
|
||||
value: "50083"
|
||||
- name: CMOA_CLST_ID
|
||||
value: {{ .Values.global.CLUSTER_ID }}
|
||||
- name: CMOA_NODE_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
- name: CMOA_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: CMOA_POD_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: CMOA_SERVICE
|
||||
value: "tpcc-payment"
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: tpcc-config
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
namespace: {{ .Values.global.TPCC_NAMESPACE }}
|
||||
name: tpcc-sendmail
|
||||
labels:
|
||||
app: tpcc-sendmail
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: tpcc-sendmail
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: tpcc-sendmail
|
||||
traceAgentType: jspd
|
||||
spec:
|
||||
containers:
|
||||
- name: tpcc-sendmail
|
||||
image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-sendmail:JSPD
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 39090
|
||||
env:
|
||||
- name: CMOA_JSPDCOLLECT_IP
|
||||
value: jspd-lite-collector.{{ .Values.global.AGENT_NAMESPACE }}
|
||||
- name: CMOA_JSPDCOLLECT_PORT
|
||||
value: "50083"
|
||||
- name: CMOA_CLST_ID
|
||||
value: {{ .Values.global.CLUSTER_ID }}
|
||||
- name: CMOA_NODE_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
- name: CMOA_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: CMOA_POD_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: CMOA_SERVICE
|
||||
value: "tpcc-sendmail"
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: tpcc-config
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
namespace: {{ .Values.global.TPCC_NAMESPACE }}
|
||||
name: tpcc-shipping
|
||||
labels:
|
||||
app: tpcc-shipping
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: tpcc-shipping
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: tpcc-shipping
|
||||
traceAgentType: jspd
|
||||
spec:
|
||||
containers:
|
||||
- name: tpcc-shipping
|
||||
image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-shipping:JSPD
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 39091
|
||||
env:
|
||||
- name: CMOA_JSPDCOLLECT_IP
|
||||
value: jspd-lite-collector.{{ .Values.global.AGENT_NAMESPACE }}
|
||||
- name: CMOA_JSPDCOLLECT_PORT
|
||||
value: "50083"
|
||||
- name: CMOA_CLST_ID
|
||||
value: {{ .Values.global.CLUSTER_ID }}
|
||||
- name: CMOA_NODE_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
- name: CMOA_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: CMOA_POD_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: CMOA_SERVICE
|
||||
value: "tpcc-shipping"
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: tpcc-config
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
namespace: {{ .Values.global.TPCC_NAMESPACE }}
|
||||
name: tpcc-stocklevel
|
||||
labels:
|
||||
app: tpcc-stocklevel
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: tpcc-stocklevel
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: tpcc-stocklevel
|
||||
traceAgentType: jspd
|
||||
spec:
|
||||
containers:
|
||||
- name: tpcc-stocklevel
|
||||
image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-stocklevel:JSPD
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 39092
|
||||
env:
|
||||
- name: CMOA_JSPDCOLLECT_IP
|
||||
value: jspd-lite-collector.{{ .Values.global.AGENT_NAMESPACE }}
|
||||
- name: CMOA_JSPDCOLLECT_PORT
|
||||
value: "50083"
|
||||
- name: CMOA_CLST_ID
|
||||
value: {{ .Values.global.CLUSTER_ID }}
|
||||
- name: CMOA_NODE_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
- name: CMOA_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: CMOA_POD_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: CMOA_SERVICE
|
||||
value: "tpcc-stocklevel"
|
||||
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: tpcc-config
|
||||
|
||||
134
roles/jspd/files/jspd-tpcc/templates/0_tpcc/tpcc_server/tpcc_service.yml
Executable file
134
roles/jspd/files/jspd-tpcc/templates/0_tpcc/tpcc_server/tpcc_service.yml
Executable file
@@ -0,0 +1,134 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
namespace: {{ .Values.global.TPCC_NAMESPACE }}
|
||||
name: tpcc-main
|
||||
labels:
|
||||
app: tpcc-main
|
||||
spec:
|
||||
selector:
|
||||
app: tpcc-main
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 30080
|
||||
targetPort: 30080
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
namespace: {{ .Values.global.TPCC_NAMESPACE }}
|
||||
name: tpcc-neworder
|
||||
labels:
|
||||
app: tpcc-neworder
|
||||
spec:
|
||||
selector:
|
||||
app: tpcc-neworder
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 30081
|
||||
targetPort: 30081
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
namespace: {{ .Values.global.TPCC_NAMESPACE }}
|
||||
name: tpcc-orderstatus
|
||||
labels:
|
||||
app: tpcc-orderstatus
|
||||
spec:
|
||||
selector:
|
||||
app: tpcc-orderstatus
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 30084
|
||||
targetPort: 30084
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
namespace: {{ .Values.global.TPCC_NAMESPACE }}
|
||||
name: tpcc-user
|
||||
labels:
|
||||
app: tpcc-user
|
||||
spec:
|
||||
selector:
|
||||
app: tpcc-user
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 30087
|
||||
targetPort: 30087
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
namespace: {{ .Values.global.TPCC_NAMESPACE }}
|
||||
name: tpcc-delivery
|
||||
labels:
|
||||
app: tpcc-delivery
|
||||
spec:
|
||||
selector:
|
||||
app: tpcc-delivery
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 30083
|
||||
targetPort: 30083
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
namespace: {{ .Values.global.TPCC_NAMESPACE }}
|
||||
name: tpcc-payment
|
||||
labels:
|
||||
app: tpcc-payment
|
||||
spec:
|
||||
selector:
|
||||
app: tpcc-payment
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 30082
|
||||
targetPort: 30082
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
namespace: {{ .Values.global.TPCC_NAMESPACE }}
|
||||
name: tpcc-sendmail
|
||||
labels:
|
||||
app: tpcc-sendmail
|
||||
spec:
|
||||
selector:
|
||||
app: tpcc-sendmail
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 30086
|
||||
targetPort: 30086
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
namespace: {{ .Values.global.TPCC_NAMESPACE }}
|
||||
name: tpcc-shipping
|
||||
labels:
|
||||
app: tpcc-shipping
|
||||
spec:
|
||||
selector:
|
||||
app: tpcc-shipping
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 30088
|
||||
targetPort: 30088
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
namespace: {{ .Values.global.TPCC_NAMESPACE }}
|
||||
name: tpcc-stocklevel
|
||||
labels:
|
||||
app: tpcc-stocklevel
|
||||
spec:
|
||||
selector:
|
||||
app: tpcc-stocklevel
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 30085
|
||||
targetPort: 30085
|
||||
12
roles/jspd/files/jspd-tpcc/values.yaml
Executable file
12
roles/jspd/files/jspd-tpcc/values.yaml
Executable file
@@ -0,0 +1,12 @@
|
||||
global:
|
||||
# cluster variables
|
||||
CLUSTER_ID: none
|
||||
AGENT_NAMESPACE: imxc-agent
|
||||
TPCC_NAMESPACE: default
|
||||
IMXC_IN_REGISTRY: 10.10.31.243:5000/cmoa3
|
||||
|
||||
POSTGRES_NODEPORT: 30002
|
||||
POSTGRES_EXPORTER_NODEPORT: 30001
|
||||
|
||||
|
||||
|
||||
9
roles/jspd/tasks/cmoa.yaml
Normal file
9
roles/jspd/tasks/cmoa.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
- name: host insert
|
||||
shell: |
|
||||
PG=$(kubectl get po -n imxc | grep postgres | awk '{print $1}')
|
||||
for ip in {{ groups['containerd'] | union(groups['docker']) | union(groups['crio']) }}; 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]
|
||||
20
roles/jspd/tasks/containerd.yaml
Normal file
20
roles/jspd/tasks/containerd.yaml
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
- name: host agent install setting [1] - containerd
|
||||
lineinfile:
|
||||
path: /root/host-agent/nerdctl-host/metric-agent.yml
|
||||
regexp: 'targets'
|
||||
line: " - targets: ['{{ ansible_default_ipv4.address }}: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]]['ansible_default_ipv4']['address'] }}/" /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']
|
||||
77
roles/jspd/tasks/delete.yaml
Normal file
77
roles/jspd/tasks/delete.yaml
Normal file
@@ -0,0 +1,77 @@
|
||||
---
|
||||
- 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.yaml
|
||||
shell: /root/host-agent/podman-host/stop.sh
|
||||
ignore_errors: true
|
||||
when:
|
||||
- delete_enabled
|
||||
- inventory_hostname in groups['crio']
|
||||
|
||||
- name: jspd tpcc delete
|
||||
kubernetes.core.helm:
|
||||
chart_ref: "/root/jspd-tpcc"
|
||||
name: jspd-tpcc
|
||||
namespace: default
|
||||
state: absent
|
||||
wait: true
|
||||
when:
|
||||
- inventory_hostname == groups['agent-master'][0]
|
||||
|
||||
- name: jspd client delete
|
||||
kubernetes.core.helm:
|
||||
chart_ref: "/root/jspd-client"
|
||||
name: jspd-client
|
||||
namespace: "{{ NAMESAPCE }}"
|
||||
state: absent
|
||||
wait: true
|
||||
when:
|
||||
- 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
|
||||
ignore_errors: true
|
||||
file:
|
||||
path: /root/jspd-client
|
||||
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-tpcc directory delete
|
||||
ignore_errors: true
|
||||
file:
|
||||
path: /root/jspd-tpcc
|
||||
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']
|
||||
20
roles/jspd/tasks/docker.yaml
Normal file
20
roles/jspd/tasks/docker.yaml
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
- name: host agent install setting [1] - docker
|
||||
lineinfile:
|
||||
path: /root/host-agent/docker-host/metric-agent.yml
|
||||
regexp: 'targets'
|
||||
line: " - targets: ['{{ ansible_default_ipv4.address }}: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]]['ansible_default_ipv4']['address'] }}/" /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']
|
||||
44
roles/jspd/tasks/hostsetting.yaml
Normal file
44
roles/jspd/tasks/hostsetting.yaml
Normal file
@@ -0,0 +1,44 @@
|
||||
---
|
||||
- name: install podman
|
||||
yum:
|
||||
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']
|
||||
36
roles/jspd/tasks/main.yml
Normal file
36
roles/jspd/tasks/main.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
- name: old host-agent dir delete - all
|
||||
include: delete.yaml
|
||||
when:
|
||||
- delete_enabled
|
||||
|
||||
- name: jspd-tpcc install
|
||||
include: tpcc.yaml
|
||||
when:
|
||||
- jspd_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
|
||||
20
roles/jspd/tasks/podman.yaml
Normal file
20
roles/jspd/tasks/podman.yaml
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
- name: host agent install setting [1] - crio
|
||||
lineinfile:
|
||||
path: /root/host-agent/podman-host/metric-agent.yml
|
||||
regexp: 'targets'
|
||||
line: " - targets: ['{{ ansible_default_ipv4.address }}: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]]['ansible_default_ipv4']['address'] }}/" /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']
|
||||
63
roles/jspd/tasks/tpcc.yaml
Normal file
63
roles/jspd/tasks/tpcc.yaml
Normal file
@@ -0,0 +1,63 @@
|
||||
---
|
||||
- name: helm.tar.gz copy
|
||||
copy:
|
||||
src: "{{ role_path }}/files/helm.tar.gz"
|
||||
dest: /root
|
||||
when:
|
||||
- inventory_hostname == groups['agent-master'][0]
|
||||
|
||||
- name: helm install
|
||||
unarchive:
|
||||
src: /root/helm.tar.gz
|
||||
dest: /usr/local/bin/
|
||||
remote_src: yes
|
||||
when:
|
||||
- inventory_hostname == groups['agent-master'][0]
|
||||
|
||||
- name: JSDP Clinet Chart copy
|
||||
copy:
|
||||
src: "{{ role_path }}/files/jspd-client"
|
||||
dest: /root/
|
||||
when:
|
||||
- inventory_hostname == groups['agent-master'][0]
|
||||
|
||||
- name: JSDP TPCC Chart copy
|
||||
copy:
|
||||
src: "{{ role_path }}/files/jspd-tpcc"
|
||||
dest: /root/
|
||||
when:
|
||||
- inventory_hostname == groups['agent-master'][0]
|
||||
|
||||
- name: Deploy JSPD Client
|
||||
kubernetes.core.helm:
|
||||
name: jspd-client
|
||||
chart_ref: "/root/jspd-client"
|
||||
release_namespace: "{{ NAMESAPCE }}"
|
||||
values:
|
||||
global:
|
||||
CLUSTER_ID: "{{ CLUSTER_ID }}"
|
||||
IMXC_IN_REGISTRY: "10.10.31.243:5000/cmoa3"
|
||||
DATAGATE: "{{ DATAGATE }}"
|
||||
DATAGATE_IP: "{{ DATAGATE_IP }}"
|
||||
DATAGATE_PORT: "30051"
|
||||
JSPD_LITE_COLLECTOR_NODEPORT: "40083"
|
||||
JSPD_LITE_COLLECTOR_VERSION: "rel{{ VERSION }}"
|
||||
TRACE_AGENT_VERSION: "rel{{ VERSION }}"
|
||||
when:
|
||||
- inventory_hostname == groups['agent-master'][0]
|
||||
|
||||
- name: Deploy JSPD TPCC
|
||||
kubernetes.core.helm:
|
||||
name: jspd-tpcc
|
||||
chart_ref: "/root/jspd-tpcc"
|
||||
release_namespace: "default"
|
||||
values:
|
||||
global:
|
||||
CLUSTER_ID: "{{ CLUSTER_ID }}"
|
||||
AGENT_NAMESPACE: "{{ NAMESAPCE }}"
|
||||
TPCC_NAMESPACE: "default"
|
||||
IMXC_IN_REGISTRY: "10.10.31.243:5000/cmoa3"
|
||||
POSTGRES_NODEPORT: "30002"
|
||||
POSTGRES_EXPORTER_NODEPORT: "30001"
|
||||
when:
|
||||
- inventory_hostname == groups['agent-master'][0]
|
||||
Reference in New Issue
Block a user