tpcc and host-agent ansible installer add

This commit is contained in:
변정훈
2023-07-11 16:31:15 +09:00
commit 7e0429176c
456 changed files with 55291 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
---
jaeger_enabled: true
delete_enabled: false
NAMESAPCE: imxc-agent
CLUSTER_ID: kk-MJy2q2OkNiGkm
DATAGATE: 10.10.43.200:35001
VERSION: 3.5.2

View 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/

View File

@@ -0,0 +1,6 @@
apiVersion: v2
name: exem-jaeger
description: A Helm chart for Kubernetes
type: application
version: 0.1.0
appVersion: "1.0"

View File

@@ -0,0 +1,2 @@
//helm uninstall cmoa-jaeger-client -n imxc-agent
helm install cmoa-jaeger-client . -n imxc-agent

View File

@@ -0,0 +1,81 @@
---
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

View File

@@ -0,0 +1,62 @@
{{/*
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 }}

View File

@@ -0,0 +1,10 @@
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.

Binary file not shown.

View 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/

View File

@@ -0,0 +1,6 @@
apiVersion: v2
name: exem-jaeger
description: A Helm chart for Kubernetes
type: application
version: 0.1.0
appVersion: "1.0"

View File

@@ -0,0 +1,2 @@
//helm uninstall cmoa-jaeger-client -n imxc-agent
helm install cmoa-jaeger-client . -n imxc-agent

View File

@@ -0,0 +1,81 @@
---
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

View File

@@ -0,0 +1,62 @@
{{/*
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 }}

View File

@@ -0,0 +1,10 @@
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

View 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/

View File

@@ -0,0 +1,6 @@
apiVersion: v2
name: exem-jaeger
description: A Helm chart for Kubernetes
type: application
version: 0.1.0
appVersion: "1.0"

View File

@@ -0,0 +1,3 @@
//helm uninstall cmoa-jaeger-tpcc
helm install cmoa-jaeger-tpcc .

View File

@@ -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

View File

@@ -0,0 +1,25 @@
apiVersion: v1
kind: Service
metadata:
name: postgres
labels:
app: postgres
spec:
ports:
- port: 5432
targetPort: 5432
selector:
app: postgres
---
apiVersion: v1
kind: Service
metadata:
name: postgres-exporter
labels:
app: postgres-exporter
spec:
ports:
- port: 9187
targetPort: 9187
selector:
app: postgres

View File

@@ -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

View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: ConfigMap
metadata:
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_MANAGER_HOST_PORT: cloudmoa-trace-agent.{{ .Values.global.AGENT_NAMESPACE }}:5778

View File

@@ -0,0 +1,108 @@
kind: Service
apiVersion: v1
metadata:
name: tpcc-main
spec:
selector:
app: tpcc-main
ports:
- protocol: TCP
port: 30080
targetPort: 30080
---
kind: Service
apiVersion: v1
metadata:
name: tpcc-neworder
spec:
selector:
app: tpcc-neworder
ports:
- protocol: TCP
port: 30081
targetPort: 30081
---
kind: Service
apiVersion: v1
metadata:
name: tpcc-delivery
spec:
selector:
app: tpcc-delivery
ports:
- protocol: TCP
port: 30083
targetPort: 30083
---
kind: Service
apiVersion: v1
metadata:
name: tpcc-orderstatus
spec:
selector:
app: tpcc-orderstatus
ports:
- protocol: TCP
port: 30084
targetPort: 30084
---
kind: Service
apiVersion: v1
metadata:
name: tpcc-payment
spec:
selector:
app: tpcc-payment
ports:
- protocol: TCP
port: 30082
targetPort: 30082
---
kind: Service
apiVersion: v1
metadata:
name: tpcc-stocklevel
spec:
selector:
app: tpcc-stocklevel
ports:
- protocol: TCP
port: 30085
targetPort: 30085
---
kind: Service
apiVersion: v1
metadata:
name: tpcc-sendmail
spec:
selector:
app: tpcc-sendmail
ports:
- protocol: TCP
port: 30086
targetPort: 30086
---
kind: Service
apiVersion: v1
metadata:
name: tpcc-user
spec:
selector:
app: tpcc-user
ports:
- protocol: TCP
port: 30087
targetPort: 30087
---
kind: Service
apiVersion: v1
metadata:
name: tpcc-shipping
spec:
selector:
app: tpcc-shipping
ports:
- protocol: TCP
port: 30088
targetPort: 30088
---

View File

@@ -0,0 +1,485 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: tpcc-main
labels:
app: tpcc-main
trace_agent_type: jaeger
spec:
replicas: 1
selector:
matchLabels:
app: tpcc-main
template:
metadata:
labels:
app: tpcc-main
trace_agent_type: jaeger
spec:
containers:
- name: tpcc-main
image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-main:R30020210216
imagePullPolicy: IfNotPresent
ports:
- containerPort: 30080
env:
- name: CLST_ID
value: {{ .Values.global.CLUSTER_ID }}
- name: NODE_ID
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_ID
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: JAEGER_SERVICE_NAME
valueFrom:
fieldRef:
fieldPath: metadata.labels['app']
- name: JAEGER_AGENT_HOST
value: cloudmoa-trace-agent.{{ .Values.global.AGENT_NAMESPACE }}
- name: JAEGER_AGENT_PORT
value: "6831"
- name: JAEGER_TAGS
value: xm_clst_id=$(CLST_ID),xm_node_id=$(NODE_ID),xm_namespace=$(NAMESPACE),xm_pod_id=$(POD_ID)
envFrom:
- configMapRef:
name: tpcc-config
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: tpcc-neworder
labels:
app: tpcc-neworder
trace_agent_type: jaeger
spec:
replicas: 1
selector:
matchLabels:
app: tpcc-neworder
template:
metadata:
labels:
app: tpcc-neworder
trace_agent_type: jaeger
spec:
containers:
- name: tpcc-neworder
image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-neworder:R30020210216
#image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-neworder:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 30081
env:
- name: CLST_ID
value: {{ .Values.global.CLUSTER_ID }}
- name: NODE_ID
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_ID
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: JAEGER_SERVICE_NAME
valueFrom:
fieldRef:
fieldPath: metadata.labels['app']
- name: JAEGER_AGENT_HOST
value: cloudmoa-trace-agent.{{ .Values.global.AGENT_NAMESPACE }}
- name: JAEGER_AGENT_PORT
value: "6831"
- name: JAEGER_TAGS
value: xm_clst_id=$(CLST_ID),xm_node_id=$(NODE_ID),xm_namespace=$(NAMESPACE),xm_pod_id=$(POD_ID)
envFrom:
- configMapRef:
name: tpcc-config
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: tpcc-delivery
labels:
app: tpcc-delivery
trace_agent_type: jaeger
spec:
replicas: 1
selector:
matchLabels:
app: tpcc-delivery
template:
metadata:
labels:
app: tpcc-delivery
trace_agent_type: jaeger
spec:
containers:
- name: tpcc-delivery
image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-delivery:R30020210216
#image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-delivery:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 30083
env:
- name: CLST_ID
value: {{ .Values.global.CLUSTER_ID }}
- name: NODE_ID
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_ID
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: JAEGER_SERVICE_NAME
valueFrom:
fieldRef:
fieldPath: metadata.labels['app']
- name: JAEGER_AGENT_HOST
value: cloudmoa-trace-agent.{{ .Values.global.AGENT_NAMESPACE }}
- name: JAEGER_AGENT_PORT
value: "6831"
- name: JAEGER_TAGS
value: xm_clst_id=$(CLST_ID),xm_node_id=$(NODE_ID),xm_namespace=$(NAMESPACE),xm_pod_id=$(POD_ID)
envFrom:
- configMapRef:
name: tpcc-config
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: tpcc-orderstatus
labels:
app: tpcc-orderstatus
trace_agent_type: jaeger
spec:
replicas: 1
selector:
matchLabels:
app: tpcc-orderstatus
template:
metadata:
labels:
app: tpcc-orderstatus
trace_agent_type: jaeger
spec:
containers:
- name: tpcc-orderstatus
image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-orderstatus:R30020210216
#image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-orderstatus:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 30084
env:
- name: CLST_ID
value: {{ .Values.global.CLUSTER_ID }}
- name: NODE_ID
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_ID
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: JAEGER_SERVICE_NAME
valueFrom:
fieldRef:
fieldPath: metadata.labels['app']
- name: JAEGER_AGENT_HOST
value: cloudmoa-trace-agent.{{ .Values.global.AGENT_NAMESPACE }}
- name: JAEGER_AGENT_PORT
value: "6831"
- name: JAEGER_TAGS
value: xm_clst_id=$(CLST_ID),xm_node_id=$(NODE_ID),xm_namespace=$(NAMESPACE),xm_pod_id=$(POD_ID)
envFrom:
- configMapRef:
name: tpcc-config
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: tpcc-payment
labels:
app: tpcc-payment
trace_agent_type: jaeger
spec:
replicas: 1
selector:
matchLabels:
app: tpcc-payment
template:
metadata:
labels:
app: tpcc-payment
trace_agent_type: jaeger
spec:
containers:
- name: tpcc-payment
image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-payment:R30020210216
#image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-payment:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 30082
env:
- name: CLST_ID
value: {{ .Values.global.CLUSTER_ID }}
- name: NODE_ID
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_ID
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: JAEGER_SERVICE_NAME
valueFrom:
fieldRef:
fieldPath: metadata.labels['app']
- name: JAEGER_AGENT_HOST
value: cloudmoa-trace-agent.{{ .Values.global.AGENT_NAMESPACE }}
- name: JAEGER_AGENT_PORT
value: "6831"
- name: JAEGER_TAGS
value: xm_clst_id=$(CLST_ID),xm_node_id=$(NODE_ID),xm_namespace=$(NAMESPACE),xm_pod_id=$(POD_ID)
envFrom:
- configMapRef:
name: tpcc-config
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: tpcc-stocklevel
labels:
app: tpcc-stocklevel
trace_agent_type: jaeger
spec:
replicas: 1
selector:
matchLabels:
app: tpcc-stocklevel
template:
metadata:
labels:
app: tpcc-stocklevel
trace_agent_type: jaeger
spec:
containers:
- name: tpcc-stocklevel
image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-stocklevel:R30020210216
#image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-stocklevel:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 30085
env:
- name: CLST_ID
value: {{ .Values.global.CLUSTER_ID }}
- name: NODE_ID
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_ID
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: JAEGER_SERVICE_NAME
valueFrom:
fieldRef:
fieldPath: metadata.labels['app']
- name: JAEGER_AGENT_HOST
value: cloudmoa-trace-agent.{{ .Values.global.AGENT_NAMESPACE }}
- name: JAEGER_AGENT_PORT
value: "6831"
- name: JAEGER_TAGS
value: xm_clst_id=$(CLST_ID),xm_node_id=$(NODE_ID),xm_namespace=$(NAMESPACE),xm_pod_id=$(POD_ID)
envFrom:
- configMapRef:
name: tpcc-config
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: tpcc-sendmail
labels:
app: tpcc-sendmail
trace_agent_type: jaeger
spec:
replicas: 1
selector:
matchLabels:
app: tpcc-sendmail
template:
metadata:
labels:
app: tpcc-sendmail
trace_agent_type: jaeger
spec:
containers:
- name: tpcc-sendmail
image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-sendmail:R30020210216
#image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-sendmail:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 30086
env:
- name: CLST_ID
value: {{ .Values.global.CLUSTER_ID }}
- name: NODE_ID
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_ID
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: JAEGER_SERVICE_NAME
valueFrom:
fieldRef:
fieldPath: metadata.labels['app']
- name: JAEGER_AGENT_HOST
value: cloudmoa-trace-agent.{{ .Values.global.AGENT_NAMESPACE }}
- name: JAEGER_AGENT_PORT
value: "6831"
- name: JAEGER_TAGS
value: xm_clst_id=$(CLST_ID),xm_node_id=$(NODE_ID),xm_namespace=$(NAMESPACE),xm_pod_id=$(POD_ID)
envFrom:
- configMapRef:
name: tpcc-config
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: tpcc-user
labels:
app: tpcc-user
trace_agent_type: jaeger
spec:
replicas: 1
selector:
matchLabels:
app: tpcc-user
template:
metadata:
labels:
app: tpcc-user
trace_agent_type: jaeger
spec:
containers:
- name: tpcc-user
image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-user:R30020210216
#image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-user:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 30087
env:
- name: CLST_ID
value: {{ .Values.global.CLUSTER_ID }}
- name: NODE_ID
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_ID
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: JAEGER_SERVICE_NAME
valueFrom:
fieldRef:
fieldPath: metadata.labels['app']
- name: JAEGER_AGENT_HOST
value: cloudmoa-trace-agent.{{ .Values.global.AGENT_NAMESPACE }}
- name: JAEGER_AGENT_PORT
value: "6831"
- name: JAEGER_TAGS
value: xm_clst_id=$(CLST_ID),xm_node_id=$(NODE_ID),xm_namespace=$(NAMESPACE),xm_pod_id=$(POD_ID)
envFrom:
- configMapRef:
name: tpcc-config
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: tpcc-shipping
labels:
app: tpcc-shipping
trace_agent_type: jaeger
spec:
replicas: 1
selector:
matchLabels:
app: tpcc-shipping
template:
metadata:
labels:
app: tpcc-shipping
trace_agent_type: jaeger
spec:
containers:
- name: tpcc-shipping
image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-shipping:R30020210216
#image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-shipping:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 30088
env:
- name: CLST_ID
value: {{ .Values.global.CLUSTER_ID }}
- name: NODE_ID
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_ID
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: JAEGER_SERVICE_NAME
valueFrom:
fieldRef:
fieldPath: metadata.labels['app']
- name: JAEGER_AGENT_HOST
value: cloudmoa-trace-agent.{{ .Values.global.AGENT_NAMESPACE }}
- name: JAEGER_AGENT_PORT
value: "6831"
- name: JAEGER_TAGS
value: xm_clst_id=$(CLST_ID),xm_node_id=$(NODE_ID),xm_namespace=$(NAMESPACE),xm_pod_id=$(POD_ID)
envFrom:
- configMapRef:
name: tpcc-config
---

View File

@@ -0,0 +1,10 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: tpcc-client-config
labels:
app: tpcc-client
data:
ADDRESS: "tpcc-main:30080"
TPS: "10"

View File

@@ -0,0 +1,11 @@
kind: Service
apiVersion: v1
metadata:
name: tpcc-client
spec:
selector:
app: tpcc-client
ports:
- protocol: TCP
port: 30000
targetPort: 30000

View File

@@ -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

View File

@@ -0,0 +1,7 @@
global:
# cluster variables
CLUSTER_ID: bE06QBaN4XAbpf3z9g1CjF
AGENT_NAMESPACE: imxc-agent
IMXC_IN_REGISTRY: 10.10.31.243:5000/cmoa3

View 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]

View 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']

View 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: jaeger tpcc delete
kubernetes.core.helm:
chart_ref: "/root/jaeger-tpcc"
name: jaeger-tpcc
namespace: default
state: absent
wait: true
when:
- inventory_hostname == groups['agent-master'][0]
- name: jaeger client delete
kubernetes.core.helm:
chart_ref: "/root/jaeger-client"
name: jaeger-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 jaeger-client directory delete
ignore_errors: true
file:
path: /root/jaeger-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 jaeger-tpcc directory delete
ignore_errors: true
file:
path: /root/jaeger-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']

View 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']

View 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']

View File

@@ -0,0 +1,36 @@
---
- name: old host-agent dir delete - all
include: delete.yaml
when:
- delete_enabled
- name: jaeger-tpcc install
include: tpcc.yaml
when:
- jaeger_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

View 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']

View File

@@ -0,0 +1,57 @@
---
- 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/jaeger-client"
dest: /root/
when:
- inventory_hostname == groups['agent-master'][0]
- name: Jaeger TPCC Chart copy
copy:
src: "{{ role_path }}/files/jaeger-tpcc"
dest: /root/
when:
- inventory_hostname == groups['agent-master'][0]
- name: Deploy Jaeger Client
kubernetes.core.helm:
name: jaeger-client
chart_ref: "/root/jaeger-client"
release_namespace: "{{ NAMESAPCE }}"
values:
global:
CLUSTER_ID: "{{ CLUSTER_ID }}"
IMXC_IN_REGISTRY: "10.10.31.243:5000/cmoa3"
DATAGATE: "{{ DATAGATE }}"
TRACE_AGENT_VERSION: "rel{{ VERSION }}"
when:
- inventory_hostname == groups['agent-master'][0]
- name: Deploy Jaeger TPCC
kubernetes.core.helm:
name: jaeger-tpcc
chart_ref: "/root/jaeger-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"
when:
- inventory_hostname == groups['agent-master'][0]