generated from edgexfoundry-holding/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add support in helm for ds-modbus
Signed-off-by: Kyle Morton <[email protected]>
- Loading branch information
Kyle Morton
committed
Nov 29, 2022
1 parent
b8e113c
commit caa80d5
Showing
3 changed files
with
130 additions
and
3 deletions.
There are no files selected for viewing
94 changes: 94 additions & 0 deletions
94
deployment/helm/templates/edgex-device-modbus/edgex-device-modbus-deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# Copyright (C) 2022 Intel Corporation | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
org.edgexfoundry.service: {{.Values.edgex.app.device.modbus}} | ||
name: {{.Values.edgex.app.device.modbus}} | ||
spec: | ||
replicas: {{.Values.edgex.replicas.device.modbus}} | ||
selector: | ||
matchLabels: | ||
org.edgexfoundry.service: {{.Values.edgex.app.device.modbus}} | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
org.edgexfoundry.service: {{.Values.edgex.app.device.modbus}} | ||
spec: | ||
{{- if and (eq .Values.edgex.security.enabled true) (or (eq .Values.edgex.storage.sharedVolumesAccessMode "ReadWriteOnce") (eq .Values.edgex.storage.useHostPath true))}} | ||
affinity: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchLabels: | ||
org.edgexfoundry.service: {{ .Values.edgex.app.secretstoresetup}} | ||
topologyKey: "kubernetes.io/hostname" | ||
{{- end}} | ||
automountServiceAccountToken: false | ||
containers: | ||
- name: {{.Values.edgex.app.device.modbus}} | ||
image: {{.Values.edgex.image.device.modbus.repository}}:{{.Values.edgex.image.device.modbus.tag}} | ||
imagePullPolicy: {{.Values.edgex.image.device.modbus.pullPolicy}} | ||
{{- if .Values.edgex.security.enabled }} | ||
command: ["/edgex-init/ready_to_run_wait_install.sh"] | ||
args: ["/device-modbus", "-cp=consul.http://edgex-core-consul:8500", "--registry", "--confdir=/res"] | ||
{{- end}} | ||
ports: | ||
- containerPort: {{.Values.edgex.port.device.modbus}} | ||
{{- if not .Values.edgex.security.enabled }} | ||
hostPort: {{.Values.edgex.port.device.modbus}} | ||
hostIP: {{.Values.edgex.hostPortInternalBind}} | ||
{{- end}} | ||
env: | ||
- name: SERVICE_HOST | ||
value: {{.Values.edgex.app.device.modbus}} | ||
envFrom: | ||
- configMapRef: | ||
name: edgex-common-variables | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
readOnlyRootFilesystem: true | ||
startupProbe: | ||
tcpSocket: | ||
port: {{.Values.edgex.port.device.modbus}} | ||
periodSeconds: 1 | ||
failureThreshold: 120 | ||
livenessProbe: | ||
tcpSocket: | ||
port: {{.Values.edgex.port.device.modbus}} | ||
{{- if .Values.edgex.security.enabled }} | ||
volumeMounts: | ||
- mountPath: /edgex-init | ||
name: edgex-init | ||
- mountPath: /tmp/edgex/secrets | ||
name: edgex-secrets | ||
{{- end }} | ||
{{- if .Values.edgex.resources.device.modbus.enforceLimits }} | ||
resources: | ||
limits: | ||
memory: {{ .Values.edgex.resources.device.modbus.limits.memory }} | ||
cpu: {{ .Values.edgex.resources.device.modbus.limits.cpu }} | ||
requests: | ||
memory: {{ .Values.edgex.resources.device.modbus.requests.memory }} | ||
cpu: {{ .Values.edgex.resources.device.modbus.requests.cpu }} | ||
{{- end}} | ||
hostname: {{.Values.edgex.app.device.modbus}} | ||
restartPolicy: Always | ||
securityContext: | ||
runAsNonRoot: true | ||
runAsUser: {{ .Values.edgex.security.runAsUser }} | ||
runAsGroup: {{ .Values.edgex.security.runAsGroup }} | ||
{{- if .Values.edgex.security.enabled }} | ||
volumes: | ||
- name: edgex-init | ||
persistentVolumeClaim: | ||
claimName: edgex-init | ||
- name: edgex-secrets | ||
persistentVolumeClaim: | ||
claimName: edgex-secrets | ||
{{- end}} |
18 changes: 18 additions & 0 deletions
18
deployment/helm/templates/edgex-device-modbus/edgex-device-modbus-service.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright (C) 2022 Intel Corporation | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
org.edgexfoundry.service: {{.Values.edgex.app.device.modbus}} | ||
name: {{.Values.edgex.app.device.modbus}} | ||
spec: | ||
ports: | ||
- name: "{{.Values.edgex.port.device.modbus}}" | ||
port: {{.Values.edgex.port.device.modbus}} | ||
selector: | ||
org.edgexfoundry.service: {{.Values.edgex.app.device.modbus}} | ||
type: {{.Values.expose.type}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters