How do I resolve permission issue with K8s

I am running an AdonisJs app using K8s deployment,
and I am using a package called Adonis Responsive Attachment. https://github.com/ndianabasi/adonis-responsive-attachment which depends on AWS s3 buckets ( I have tried same with Linode buckets as well )

I am getting this error anytime I do file upload.

{
    "message": "E_CANNOT_WRITE_FILE: Cannot write file at location \"gallery/cljd6qihn000107m6ead73s92.jpg\""
}

I tried deploying on a different server , and it worked without this error,

I seem to only have this error on Linode K8s. or maybe I am not configuring my Deployments well,

See a sample of the deployment codes I am using

apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp
  labels:
    app.kubernetes.io/name: myapp
    app.kubernetes.io/version: '1.0.0'
    app.kubernetes.io/managed-by: kubectl
spec:
  replicas: 1
  selector:
    matchLabels:
      app: myapp
  template:
    metadata:
      labels:
        app: myapp
    spec:
      securityContext:
        runAsUser: 2500
        runAsGroup: 3000
        fsGroup: 2000
        fsGroupChangePolicy: "OnRootMismatch"
      containers:
        - name: myapp
          image: roqkabel/myapp-app:$TAG
          envFrom:
            - secretRef:
                name: myapp-secret
          ports:
            - containerPort: 3000
          securityContext:
            capabilities:
              add: ["NET_ADMIN"]
            allowPrivilegeEscalation: false

      volumes:
      - name: cache-volume
        emptyDir:
          sizeLimit: 500Mi

1 Reply

Solved!,
this was due to an issue with a wrong ENV configuration for AWS S3buckets.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct