AWS EKS Kubernetes error: unable to recognize policy: no matches for kind "policy" in version "v1beta1"

Stack Overflow Asked by DmitrySemenov on December 2, 2020

These are my APIs available in AWS EKS 1.17

✦ ➜ k api-versions

this is my policy.yaml file

apiVersion: policy/v1beta1
kind: policy
  name: default-deny-egress
  namespace: edna
  order: 999
  - action: deny
    source: {}

When I try to apply it I get the following:

error: unable to recognize "app/base/backend/policies/deny-policy.yaml": no matches for kind "policy" in version "v1beta1"

2 Answers

From what I understand you are trying to define a network policy.

In k8s documentation you can find several examples regarding networking policies and every one of these examples is using:

kind: NetworkPolicy

I have also noticed that the yaml file content you provided is not valid. Please refer to the networking policies documentation mentioned earlier or k8s api referece guide for more detailed description of k8s yaml fields.

Answered by Matt on December 2, 2020

You should use api/v1beta1 when defining network policies , Also the kind in that case would be NetworkPolicy. I think this is what you should use.

The version policy/v1beta1 is for defining poddisruptionbudget.

The kind Policy is used for defining audit policy and version and since this is not available in your output you cannot use this and hence the error.

Heres a document that might help you.

Answered by Tarun Khosla on December 2, 2020

Add your own answers!

Related Questions

Find a cell containing a specific date

1  Asked on December 22, 2021


Jeykll file to import not found or unreadable: base

1  Asked on December 22, 2021 by kyu96


Unable to remove event listener from document

1  Asked on December 22, 2021 by prawn


Invalid result adding the number of 1s in a binary number

2  Asked on December 20, 2021 by aworeham


How to print the elements of 3 different arrays by the order?

2  Asked on December 20, 2021 by fuzzyfiso


Finding string elements of an array in another array

5  Asked on December 20, 2021 by p-emt


How to plot several columns on the same line chart in R?

2  Asked on December 20, 2021 by user13953317


Is there a way to craft URLs to fill forms faster?

1  Asked on December 20, 2021 by rosalind-goh


infinite loop while using useEffect and redux store

0  Asked on December 20, 2021 by susanta


Cannot convert textfield into string

1  Asked on December 20, 2021 by anuj-amin


Is there multiple ways to cin vector elements?

1  Asked on December 20, 2021 by 2kbummer


Ask a Question

Get help from others!

© 2023 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP