-
Notifications
You must be signed in to change notification settings - Fork 26
/
iot-simulator.yml
131 lines (126 loc) · 3.76 KB
/
iot-simulator.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#*******************************************************************************
# Copyright (c) 2017 Red Hat, Eurotech, Inc and others
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Red Hat, Inc. - initial implementation
# Eurotech - initial implementation of Kapua components
#
#******************************************************************************
apiVersion: v1
kind: Template
metadata:
name: kura-simulator
annotations:
openshift.io/display-name: "Eclipse Kura™ simulator"
description: "An IoT gateway simulator, simulating Eclipse Kura™ instances"
labels:
kapua: simulator
parameters:
- name: IMAGE_VERSION
description: The version of the image to use
value: latest
- name: DOCKER_ACCOUNT
description: The docker hub account name to pull from
value: redhatiot
- description: MQ Broker username
name: BROKER_USERNAME
value: "demo-gw2"
required: true
- description: MQ Broker password
name: BROKER_PASSWORD
value: "RedHat123"
required: true
- description: Number of Kura Simulators to run
name: KSIM_NUM_GATEWAYS
value: "2"
required: true
- description: Kapua Account Name
name: KSIM_ACCOUNT_NAME
value: "Red-Hat"
required: true
- description: Simulator Name Factory
name: KSIM_NAME_FACTORY
# value: "host:addr"
- description: Simulator Name Custom Prefix
name: KSIM_BASE_NAME
value: "truck-"
objects:
# Image streams
# - apiVersion: v1
# kind: ImageStream
# metadata:
# name: kura-simulator
# spec:
# tags:
# - from:
# kind: DockerImage
# name: kura-simulator:${IMAGE_VERSION}
# name: ${IMAGE_VERSION}
# importPolicy:
# scheduled: true
# Deployment configs
- apiVersion: v1
kind: DeploymentConfig
metadata:
name: simulator
spec:
replicas: 1
selector:
app: simulator
deploymentconfig: simulator
strategy:
type: Recreate
template:
metadata:
labels:
app: simulator
deploymentconfig: simulator
spec:
containers:
- name: simulator
image: ${DOCKER_ACCOUNT}/kura-simulator:${IMAGE_VERSION}
imagePullPolicy: Always
restartPolicy: Always
dnsPolicy: ClusterFirst
env:
- name: KSIM_BROKER_PROTO
value: $(KAPUA_BROKER_PORT_1883_TCP_PROTO)
- name: KSIM_BROKER_HOST
value: $(KAPUA_BROKER_SERVICE_HOST)
- name: KSIM_BROKER_PORT
value: $(KAPUA_BROKER_PORT_1883_TCP_PORT)
- name: KSIM_BROKER_USER
value: ${BROKER_USERNAME}
- name: KSIM_BROKER_PASSWORD
value: ${BROKER_PASSWORD}
- name: KSIM_BASE_NAME
value: ${KSIM_BASE_NAME}
- name: KSIM_NAME_FACTORY
value: ${KSIM_NAME_FACTORY}
- name: KSIM_NUM_GATEWAYS
value: ${KSIM_NUM_GATEWAYS}
- name: KSIM_ACCOUNT_NAME
value: ${KSIM_ACCOUNT_NAME}
- name: KSIM_SIMULATION_CONFIGURATION
valueFrom:
configMapKeyRef:
name: data-simulator-config
key: ksim.simulator.configuration
# triggers:
# - type: ConfigChange
# - type: ImageChange
# imageChangeParams:
# automatic: true
# containerNames:
# - simulator
# from:
# kind: ImageStreamTag
# name: kura-simulator:${IMAGE_VERSION}
# paused: false
# revisionHistoryLimit: 2
# minReadySeconds: 0