deployment.yaml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. # Copyright (c) 2020 TriggerMesh Inc.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. apiVersion: apps/v1
  15. kind: Deployment
  16. metadata:
  17. name: {{ include "aws-event-sources.fullname" . }}-controller
  18. labels:
  19. {{- include "aws-event-sources.labels" . | nindent 4 }}
  20. spec:
  21. replicas: 1
  22. selector:
  23. matchLabels:
  24. {{- include "aws-event-sources.selectorLabels" . | nindent 6}}
  25. template:
  26. metadata:
  27. labels:
  28. {{- include "aws-event-sources.labels" . | nindent 8 }}
  29. {{- with .Values.podAnnotations }}
  30. annotations:
  31. {{- toYaml . | nindent 8 }}
  32. {{- end }}
  33. spec:
  34. {{- with .Values.imagePullSecrets }}
  35. imagePullSecrets:
  36. {{- toYaml . | nindent 8 }}
  37. {{- end }}
  38. serviceAccountName: {{ template "aws-event-sources.serviceAccountName" . }}
  39. securityContext:
  40. {{- toYaml .Values.podSecurityContext | nindent 8 }}
  41. containers:
  42. - name: controller
  43. image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}"
  44. imagePullPolicy: {{ .Values.image.pullPolicy}}
  45. terminationMessagePolicy: FallbackToLogsOnError
  46. env:
  47. - name: SYSTEM_NAMESPACE
  48. valueFrom:
  49. fieldRef:
  50. fieldPath: metadata.namespace
  51. # Logging/observability configuration
  52. - name: CONFIG_LOGGING_NAME
  53. value: config-logging
  54. - name: CONFIG_OBSERVABILITY_NAME
  55. value: config-observability
  56. - name: METRICS_DOMAIN
  57. value: triggermesh.io/sources
  58. # Global settings
  59. - name: KNATIVE_URL_SCHEME
  60. value: {{ .Values.knative.urlScheme }}
  61. - name: KNATIVE_DOMAIN
  62. value: {{ .Values.knative.domain }}
  63. # Source adapters
  64. - name: AWSCODECOMMITSOURCE_IMAGE
  65. value: "{{ .Values.image.registry }}/{{ .Values.adapters.awscodecommit.repository }}:{{ default .Values.image.tag .Values.adapters.awscodecommit.tag }}"
  66. - name: AWSCOGNITOIDENTITYSOURCE_IMAGE
  67. value: "{{ .Values.image.registry }}/{{ .Values.adapters.awscognitoidentity.repository }}:{{ default .Values.image.tag .Values.adapters.awscognitoidentity.tag }}"
  68. - name: AWSCOGNITOUSERPOOLSOURCE_IMAGE
  69. value: "{{ .Values.image.registry }}/{{ .Values.adapters.awscognitouserpool.repository }}:{{ default .Values.image.tag .Values.adapters.awscognitouserpool.tag }}"
  70. - name: AWSDYNAMODBSOURCE_IMAGE
  71. value: "{{ .Values.image.registry }}/{{ .Values.adapters.awsdynamodb.repository }}:{{ default .Values.image.tag .Values.adapters.awsdynamodb.tag }}"
  72. - name: AWSKINESISSOURCE_IMAGE
  73. value: "{{ .Values.image.registry }}/{{ .Values.adapters.awskinesis.repository }}:{{ default .Values.image.tag .Values.adapters.awskinesis.tag }}"
  74. - name: AWSSNSSOURCE_IMAGE
  75. value: "{{ .Values.image.registry }}/{{ .Values.adapters.awssns.repository }}:{{ default .Values.image.tag .Values.adapters.awssns.tag }}"
  76. - name: AWSSQSSOURCE_IMAGE
  77. value: "{{ .Values.image.registry }}/{{ .Values.adapters.awssqs.repository }}:{{ default .Values.image.tag .Values.adapters.awssqs.tag }}"
  78. ports:
  79. - name: metrics
  80. containerPort: 9090
  81. - name: profiling
  82. containerPort: 8008
  83. securityContext:
  84. allowPrivilegeEscalation: false
  85. {{- with .Values.securityContext }}
  86. {{- toYaml . | nindent 12 }}
  87. {{- end }}
  88. resources:
  89. {{- toYaml .Values.resources | nindent 12 }}
  90. {{- with .Values.nodeSelector }}
  91. nodeSelector:
  92. {{- toYaml . | nindent 8 }}
  93. {{- end }}
  94. {{- with .Values.affinity }}
  95. affinity:
  96. {{- toYaml . | nindent 8 }}
  97. {{- end }}
  98. {{- with .Values.tolerations }}
  99. tolerations:
  100. {{- toYaml . | nindent 8 }}
  101. {{- end }}