Add ability to provide annotations to the jobs.

This commit is contained in:
2024-09-11 13:09:54 +01:00
parent bbb41681df
commit fffbae11d8
33 changed files with 143 additions and 85 deletions
+2 -2
View File
@@ -10,9 +10,9 @@ description: |
type: application
version: 0.1.18
version: 0.1.20
appVersion: "0.1.18"
appVersion: "0.1.20"
home: https://github.com/lukaszraczylo/kubernetes-images-sync-operator
+4
View File
@@ -78,6 +78,10 @@ spec:
type: string
imageNamespace:
type: string
jobAnnotations:
additionalProperties:
type: string
type: object
sha:
type: string
storage:
@@ -75,6 +75,10 @@ spec:
items:
type: string
type: array
jobAnnotations:
additionalProperties:
type: string
type: object
maxConcurrentJobs:
type: integer
name:
@@ -1,14 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "chart.fullname" . }}-cm-raczylo-com-metrics-service
labels:
control-plane: cm-raczylo-com
{{- include "chart.labels" . | nindent 4 }}
spec:
type: {{ .Values.cmRaczyloComMetricsService.type }}
selector:
control-plane: cm-raczylo-com
{{- include "chart.selectorLabels" . | nindent 4 }}
ports:
{{- .Values.cmRaczyloComMetricsService.ports | toYaml | nindent 2 }}
+15 -11
View File
@@ -1,32 +1,36 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "chart.fullname" . }}-cm-raczylo-com
name: {{ include "chart.fullname" . }}-sa
labels:
control-plane: cm-raczylo-com
control-plane: sa
{{- include "chart.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.cmRaczyloCom.replicas }}
replicas: {{ .Values.sa.replicas }}
selector:
matchLabels:
control-plane: cm-raczylo-com
control-plane: sa
{{- include "chart.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
control-plane: cm-raczylo-com
control-plane: sa
{{- include "chart.selectorLabels" . | nindent 8 }}
annotations:
kubectl.kubernetes.io/default-container: manager
spec:
containers:
- args: {{- toYaml .Values.cmRaczyloCom.manager.args | nindent 8 }}
- args: {{- toYaml .Values.sa.manager.args | nindent 8 }}
command:
- /manager
env:
- name: POD_SERVICE_ACCOUNT
valueFrom:
fieldRef:
fieldPath: spec.serviceAccountName
- name: KUBERNETES_CLUSTER_DOMAIN
value: {{ quote .Values.kubernetesClusterDomain }}
image: {{ .Values.cmRaczyloCom.manager.image.repository }}:{{ .Values.cmRaczyloCom.manager.image.tag
image: {{ .Values.sa.manager.image.repository }}:{{ .Values.sa.manager.image.tag
| default .Chart.AppVersion }}
livenessProbe:
httpGet:
@@ -41,10 +45,10 @@ spec:
port: 8081
initialDelaySeconds: 5
periodSeconds: 10
resources: {{- toYaml .Values.cmRaczyloCom.manager.resources | nindent 10 }}
securityContext: {{- toYaml .Values.cmRaczyloCom.manager.containerSecurityContext
| nindent 10 }}
resources: {{- toYaml .Values.sa.manager.resources | nindent 10 }}
securityContext: {{- toYaml .Values.sa.manager.containerSecurityContext | nindent
10 }}
securityContext:
runAsNonRoot: true
serviceAccountName: {{ include "chart.fullname" . }}-cm-raczylo-com
serviceAccountName: {{ include "chart.fullname" . }}-sa
terminationGracePeriodSeconds: 10
@@ -1,7 +1,7 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "chart.fullname" . }}-mr-raczylo-com
name: {{ include "chart.fullname" . }}-impex-mgr
labels:
{{- include "chart.labels" . | nindent 4 }}
rules:
@@ -1,14 +1,14 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "chart.fullname" . }}-mr-raczylo-combinding
name: {{ include "chart.fullname" . }}-impex-mgrbinding
labels:
{{- include "chart.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: '{{ include "chart.fullname" . }}-mr-raczylo-com'
name: '{{ include "chart.fullname" . }}-impex-mgr'
subjects:
- kind: ServiceAccount
name: '{{ include "chart.fullname" . }}-cm-raczylo-com'
name: '{{ include "chart.fullname" . }}-sa'
namespace: '{{ .Release.Namespace }}'
@@ -10,5 +10,5 @@ roleRef:
name: '{{ include "chart.fullname" . }}-metrics-auth-raczylo'
subjects:
- kind: ServiceAccount
name: '{{ include "chart.fullname" . }}-cm-raczylo-com'
name: '{{ include "chart.fullname" . }}-sa'
namespace: '{{ .Release.Namespace }}'
@@ -10,5 +10,5 @@ roleRef:
name: '{{ include "chart.fullname" . }}-raczylo-com-leader'
subjects:
- kind: ServiceAccount
name: '{{ include "chart.fullname" . }}-cm-raczylo-com'
name: '{{ include "chart.fullname" . }}-sa'
namespace: '{{ .Release.Namespace }}'
+14
View File
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "chart.fullname" . }}-sa-metrics-service
labels:
control-plane: sa
{{- include "chart.labels" . | nindent 4 }}
spec:
type: {{ .Values.saMetricsService.type }}
selector:
control-plane: sa
{{- include "chart.selectorLabels" . | nindent 4 }}
ports:
{{- .Values.saMetricsService.ports | toYaml | nindent 2 }}
+2 -2
View File
@@ -1,8 +1,8 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "chart.fullname" . }}-cm-raczylo-com
name: {{ include "chart.fullname" . }}-sa
labels:
{{- include "chart.labels" . | nindent 4 }}
annotations:
{{- toYaml .Values.cmRaczyloCom.serviceAccount.annotations | nindent 4 }}
{{- toYaml .Values.sa.serviceAccount.annotations | nindent 4 }}
+4 -4
View File
@@ -1,4 +1,5 @@
cmRaczyloCom:
kubernetesClusterDomain: cluster.local
sa:
manager:
args:
- --metrics-bind-address=:8443
@@ -11,7 +12,7 @@ cmRaczyloCom:
- ALL
image:
repository: ghcr.io/lukaszraczylo/kubernetes-images-sync-operator
tag: 0.1.18
tag: 0.1.20
resources:
limits:
cpu: 500m
@@ -22,11 +23,10 @@ cmRaczyloCom:
replicas: 1
serviceAccount:
annotations: {}
cmRaczyloComMetricsService:
saMetricsService:
ports:
- name: https
port: 8443
protocol: TCP
targetPort: 8443
type: ClusterIP
kubernetesClusterDomain: cluster.local