stefanprodan / timoni

Timoni is a package manager for Kubernetes, powered by CUE and inspired by Helm.
https://timoni.sh
Apache License 2.0
1.45k stars 66 forks source link

ERR PersistentVolumeClaim/storage not found: the server could not find the requested resource #305

Closed jmgilman closed 6 months ago

jmgilman commented 6 months ago

When attempting to apply a Deployment object that depends on a PVC, the timoni apply command fails with:

ERR PersistentVolumeClaim/my-pvc not found: the server could not find the requested resource

Example YAML:

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/name: myapp
    app.kubernetes.io/version: 0.0.0-devel
    name: myapp
  name: myapp
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      name: myapp
  template:
    metadata:
      labels:
        name: myapp
    spec:
      containers:
        - image: myimage:tag
          imagePullPolicy: IfNotPresent
          name: app
          volumeMounts:
            - mountPath: /storage
              name: storage
      volumes:
        - name: storage
          persistentVolumeClaim:
            claimName: storage
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: storage
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi
  storageClassName: class
---

When applying the manifests directly to the cluster using kubectl apply -f the same issue is not observed and the deployment waits for the PVC to be created before starting.

jmgilman commented 6 months ago

This was a misconfiguration on my end (the actual module was a lot larger and was simplified here).