green-i
green-i

Reputation: 315

Unable to create a PodPreset on EKS cluster

Environment: AWS managed Kubernetes cluster (EKS)

Action: Create a PodPreset object by applying the following:

apiVersion: settings.k8s.io/v1alpha1
kind: PodPreset
meta data:
  name: sample
  spec:
    selector:
      matchLabels:
        app: microservice
    env:
      - name: test_env
        value: "6379"
    volumeMounts:
      - name: shared
        mountPath: /usr/shared
    volumes:
      - name: shared
        emptyDir: {}

Observation:

unable to recognize "podpreset.yaml": no matches for kind "PodPreset" in version "settings.k8s.io/v1alpha1"

Upvotes: 0

Views: 1103

Answers (3)

Alex
Alex

Reputation: 81

As of 03.11.2020 there is still an open GitHub request for this.

Upvotes: 0

EKS does not enable any k8s Alpha feature and as of today, PodPreset is a k8s Alpha feature. So if you want to achieve something like above, you have will have to create a Mutating Admission webhook which is supported by EKS now. But it is not sure simple use cases, PodPreset can handle most of the simple use cases hopefully it will enter Beta Phase soon.

Upvotes: 0

nicor88
nicor88

Reputation: 1553

Looks like that the API version settings.k8s.io/v1alpha1 is not supported by default by EKS. I'm using EKS as well, I just run this commands to check it out:

$ kubectl proxy
Starting to serve on 127.0.0.1:8001

The I run

curl localhost:8001/apis

And clearly in my case settings.k8s.io/v1alpha1 was not supported. I recommend running the same checks. Also checking here it's mentioned that

You should have enabled the API type settings.k8s.io/v1alpha1/podpreset

I don't know how can the settings.k8s.io/v1alpha1 can be enabled in EKS.

Upvotes: 1

Related Questions