@Pratim Das, Partha C Firstly, apologies for the delay in responding on this and any inconvenience this issue may have caused.
Are workloads mentioned already running in containers as I suspect not based on the detail provided? If it isn’t then you can refer to this article.
There is not enough info to provide a good recommendation, however, have you looked at CronJob resource in k8s?
Here’s an example of such job definition:
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: {{ include "deploymentName" . }}
labels:
{{ include "labels" . | indent 4 }}
spec:
schedule: "0 */1 * * *" # Once an hour
concurrencyPolicy: Replace
jobTemplate:
spec:
{{ include "retrieve-secrets-spec" . | indent 6 }}
It includes below line:
{{- define "retrieve-secrets-spec" -}}
template:
spec:
serviceAccountName: {{ .Values.keyvaultAgent.name }}
restartPolicy: OnFailure
{{- with .Values.keyvaultAgent.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 6 }}
{{- end }}
imagePullSecrets:
- name: "{{ .Values.keyvaultAgent.image.pullSecret }}"
containers:
- name: keyvault-agent
image: "{{ .Values.keyvaultAgent.image.repository }}:{{ .Values.keyvaultAgent.image.tag }}"
imagePullPolicy: {{ .Values.keyvaultAgent.image.pullPolicy }}
env:
- name: SERVICE_PRINCIPLE_FILE_PATH
value: /host/azure.json
- name: VAULT_BASE_URL
value: "{{ .Values.keyvaultAgent.vaultBaseUrl }}"
- name: CREATE_KUBERNETES_SECRETS
value: "true"
- name: SECRETS_NAMESPACE
value: "{{ .Values.keyvaultAgent.secretsNamespace }}"
- name: SECRETS_FOLDER
value: /secrets
- name: SECRETS_KEYS
value: "{{ .Values.keyvaultAgent.secretNames}}"
- name: SECRETS_TYPE
value: "kubernetes.io/tls"
volumeMounts:
- name: host-sp
mountPath: /host
readOnly: true
volumes:
- name: host-sp
hostPath:
# this file contains the cluster service-principal, it exists on every node by default
path: /etc/kubernetes
{{- end -}}
Moreover I will recommend to open a Support Ticket with Azure Technical Support since they will have right tools and expertise to help you out with your ask. If you have a support plan, requesting you to file a support ticket, else please do let us know, we will try and help you get a one-time free technical support.
Hope it helps :)
Please 'Accept as answer' if it helped, so that it can help others in the community looking for help on similar topics