How to migrate windows scheduled job(exe) to AKS?

Pratim Das, Partha C 266 Reputation points
2020-11-26T10:49:48.543+00:00

One on - premise enterprise application needs to be migrated to AKS. Multiple windows scheduled jobs need to be migrated to AKS. What is the best practice?

  1. Should we keep it in AKS and schedule? if yes then how?
  2. Should use any other Azure service to accomplish? if yes then how?
  3. Can we use Control-M agent for that?
Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
1,849 questions
{count} votes

Accepted answer
  1. prmanhas-MSFT 17,886 Reputation points Microsoft Employee
    2020-12-02T11:10:41.753+00:00

    @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

    0 comments No comments

0 additional answers

Sort by: Most helpful