Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom actions ignores container volumes #9409

Open
Isakdl opened this issue May 3, 2024 · 6 comments · May be fixed by #9532
Open

Custom actions ignores container volumes #9409

Isakdl opened this issue May 3, 2024 · 6 comments · May be fixed by #9532

Comments

@Isakdl
Copy link

Isakdl commented May 3, 2024

When I run the custom action my container settings in my job manifest are overridden by the container specification in the custom actions. When I use the overrides keyword it does not seem to apply these overrides to the final yaml file.

Expected behavior

That the container mounts the volumes.

Actual behavior

The volume mounts are overridden and ignored.

Information

Similar issue: #8974

  • Skaffold version: 2.11.1
  • Operating system: MacOS Sonoma 14.4.1
  • Installed via: Homebrew
  • Contents of skaffold.yaml:
apiVersion: skaffold/v4beta7
kind: Config
metadata:
  name: gke-automation
manifests:
  rawYaml:
    - deployment.yaml
    - service.yaml
    - http-route.yaml
    - secret.yaml
    - service-account.yaml
deploy:
  kubectl: {}
customActions:
  - name: custom-job
    executionMode:
      kubernetesCluster:
        overrides: '{"spec":{"template":{"spec":{"containers":[{"volumeMounts":[{"name":"config","mountPath":"/config/config.yaml","subPath":"config.yaml"},{"name":"secrets","mountPath":"/config/secrets.yaml","subPath":"secrets.yaml"}]}]}}}}'
        jobManifestPath: ./job.yaml
    containers:
      - name: migration
        image: image

Job.yaml

apiVersion: batch/v1
kind: Job
metadata:
  name: migration
  namespace: app-space
  labels:
    app: migration
spec:
  backoffLimit: 0
  template:
    metadata:
      annotations:
        gke-gcsfuse/volumes: "true"
      labels:
        app: migration
    spec:
      serviceAccountName: service-account
      image: image
      containers:
        - name: migration
          volumeMounts:
            - name: config
              mountPath: /config/config.yaml
              subPath: config.yaml
            - name: secrets
              mountPath: /config/secrets.yaml
              subPath: secrets.yaml
      volumes:
        - name: config
          csi:
            driver: gcsfuse.csi.storage.gke.io
            readOnly: true
            volumeAttributes:
              bucketName: config-bucket
              mountOptions: "implicit-dirs"
              gcsfuseLoggingSeverity: warning
        - name: secrets
          csi:
            driver: secrets-store-gke.csi.k8s.io
            readOnly: true
            volumeAttributes:
              secretProviderClass: secrets

Steps to reproduce the behavior

Setup a volume mount for the container in a custom actions.

Run the custom action - no volume is mounted.

@jdonzallaz
Copy link

We have the same problem. Any news from the team?

@edencybellum
Copy link

Same here

@timorickli
Copy link

I have the same issue. Is there an easy and clean fix?

@gemoya
Copy link

gemoya commented Sep 12, 2024

Same here.
I'm trying to pass an envFrom list to the job but skaffold is ignoring the overrides content

@cmanzi-bestow
Copy link

cmanzi-bestow commented Sep 24, 2024

Same issue here. Why is the containers property required for using custom job manifests when it will overwrite other properties that we already have defined in our custom Job manifest? Doesn't make any sense.

FYI @cglenn36

Edit: Right now we have no workaround for this...I am going to try to see if I can debug what's going on here. From what we've seen, it looks like it does parse and validate the overrides, but they just never actually get overlayed in the resulting manifest for some reason.

@cmanzi-bestow
Copy link

In case anyone is watching, I have a PR open with a proposed fix, just working on tests and awaiting feedback. But in case anyone can't wait the fix is pretty simple, and it eliminates the need for using the overrides.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants