123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- # Copyright 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- - name: Get timescaleDB svc IP
- command: kubectl get svc "{{ timescaledb_k8s_name }}" -n "{{ namespace }}" -o=jsonpath='{.spec.clusterIP}'
- changed_when: false
- register: timescale_svc_ip
- - name: Get mysqlDB svc IP
- command: kubectl get svc "{{ mysqldb_k8s_name }}" -n "{{ namespace }}" -o=jsonpath='{.spec.clusterIP}'
- changed_when: false
- register: mysql_svc_ip
- - name: Deploy idrac-telemetry pod
- kubernetes.core.k8s:
- state: present
- definition:
- apiVersion: apps/v1
- kind: Deployment
- metadata:
- name: "{{ idrac_telemetry_k8s_name }}"
- namespace: "{{ namespace }}"
- labels:
- app: "{{ idrac_telemetry_k8s_name }}"
- spec:
- selector:
- matchLabels:
- app: "{{ idrac_telemetry_k8s_name }}"
- replicas: 1
- strategy:
- type: RollingUpdate
- template:
- metadata:
- labels:
- app: "{{ idrac_telemetry_k8s_name }}"
- spec:
- volumes:
- - name: telemetry-reference-tools
- hostPath:
- path: "{{ mount_location + idrac_telemetry_folder_name }}"
- type: Directory
- hostAliases:
- - ip: "127.0.0.1"
- hostnames:
- - "activemq"
- - ip: "{{ timescale_svc_ip.stdout }}"
- hostnames:
- - "timescale"
- - ip: "{{ mysql_svc_ip.stdout }}"
- hostnames:
- - "mysqldb"
- containers:
- - name: activemq
- image: rmohr/activemq:5.10.0
- imagePullPolicy: "Always"
- ports:
- - containerPort: "{{ activemq_http_port_1 }}"
- - containerPort: "{{ activemq_http_port_2 }}"
- - name: telemetry-receiver
- image: golang:1.17
- imagePullPolicy: "IfNotPresent"
- volumeMounts:
- - mountPath: /go/src/github.com/telemetry-reference-tools
- name: telemetry-reference-tools
- workingDir: /go/src/github.com/telemetry-reference-tools
- env:
- - name: MESSAGEBUS_HOST
- value: activemq
- - name: MESSAGEBUS_PORT
- value: "{{ messagebus_http_port }}"
- - name: CONFIGUI_HTTP_PORT
- value: "{{ configui_http_port }}"
- - name: MYSQL_DATABASE
- value: "{{ mysqldb_name }}"
- - name: MYSQL_USER
- valueFrom:
- secretKeyRef:
- name: "{{ secrets_name }}"
- key: sqldb_user
- - name: MYSQL_PASSWORD
- valueFrom:
- secretKeyRef:
- name: "{{ secrets_name }}"
- key: sqldb_password
- - name: MYSQL_HOST
- value: mysqldb
- - name: MYSQL_HOST_PORT
- value: "{{ mysqldb_port1 }}"
- command:
- - "/bin/sh"
- - "-c"
- args: ["./cmd/idrac-telemetry-receiver.sh"]
- - name: timescale-ingester
- image: golang:1.17
- imagePullPolicy: "IfNotPresent"
- volumeMounts:
- - mountPath: /go/src/github.com/telemetry-reference-tools
- name: telemetry-reference-tools
- workingDir: /go/src/github.com/telemetry-reference-tools
- env:
- - name: MESSAGEBUS_HOST
- value: activemq
- - name: MESSAGEBUS_PORT
- value: "{{ messagebus_http_port }}"
- - name: POSTGRES_USER
- valueFrom:
- secretKeyRef:
- name: "{{ secrets_name }}"
- key: timescaledb_user
- - name: POSTGRES_DEFAULT_PWD
- valueFrom:
- secretKeyRef:
- name: "{{ secrets_name }}"
- key: timescaledb_password
- - name: TIMESCALE_SERVER
- value: timescale
- - name: TIMESCALE_DB
- value: "{{ timescaledb_name }}"
- command:
- - "/bin/sh"
- - "-c"
- args: ["go run cmd/timescalepump/timescalepump.go"]
|