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

Why does the color editor in Blend stop working?

1  Asked on December 1, 2020 by vladimir-yudin


eCharts marker line is cutting off text

2  Asked on December 1, 2020 by sanya


how do i connect my mongodb to my laptop?

2  Asked on December 1, 2020 by omojuwon-soneye


How to write text over an image?

2  Asked on December 1, 2020 by hichem-neggaz


Flutter text background with figure

1  Asked on December 1, 2020 by talisman7525


Minimum count to make equal Array

4  Asked on December 1, 2020


Trying to convert a csv to HDF5 and read it using vaex

1  Asked on December 1, 2020 by droning-hangman


Run Tree Structure in Python

1  Asked on November 30, 2020 by tianhe-xie


How iterate over a list and delete values along the way

1  Asked on November 30, 2020 by jaden-listrani-ayers


import packages from project directory

2  Asked on November 30, 2020 by will-waltrip


Ask a Question

Get help from others!

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