Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

policy/v1beta1 deprecated on k8s v1.25+ #2602

Closed
cliddlebd opened this issue Jul 20, 2023 · 5 comments
Closed

policy/v1beta1 deprecated on k8s v1.25+ #2602

cliddlebd opened this issue Jul 20, 2023 · 5 comments
Labels
type/bug Something isn't working

Comments

@cliddlebd
Copy link

cliddlebd commented Jul 20, 2023

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Overview of the Issue

In the latest version of this helm chart, disruptionBudget is enabled by default and the templates all use policy/v1beta1 api which is deprecated as of k8s v1.25+.
https://kubernetes.io/docs/reference/using-api/deprecation-guide/#poddisruptionbudget-v125

Reproduction Steps

When running helm install with the default values on kubernetes version 1.25+ i get the server could not find the requested resource on policy/v1beta1/PodDisruptionBudget.

The chart also checks for {{- if .Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget" }} however the api version is actually policy/v1 when printing {{ .Capabilities.APIVersions }}

Expected behavior

Helm chart installs successfully.

Environment details

If not already included, please provide the following:

  • consul-k8s version: 1.2.0
  • values.yaml used to deploy the helm chart: default

Additionally, please provide details regarding the Kubernetes Infrastructure, as shown below:

  • Kubernetes version: 1.25.10-gke.1200
  • Cloud Provider (If self-hosted, the Kubernetes provider utilized): GKE
@cliddlebd cliddlebd added the type/bug Something isn't working label Jul 20, 2023
@david-yu
Copy link
Contributor

david-yu commented Sep 5, 2023

Hi @cliddlebd We tried to replicate this issue but was not able to. Could you tell us if this still exists on consul-k8s 1.2.1?

@david-yu
Copy link
Contributor

Will close as it is not reproducible.

@rejochandran
Copy link

Hi @david-yu ,

This issus still persists when using helm from here

Chart Version:

version: 1.4.0-dev
appVersion: 1.18-dev

My environment:

Client Version: v1.25.2
Kustomize Version: v4.5.7
Server Version: v1.27.4

Error:

Build Failed: kubernetes apply: error mapping policy/PodDisruptionBudget: no matches for kind "PodDisruptionBudget" in version "policy/v1beta1"

@david-yu
Copy link
Contributor

david-yu commented Dec 8, 2023

We may need more info on your values.yaml file as I'm not seeing this on k8s 1.27.3

dyu@dyu-JRXHVGG467 kind-consulk8s % helm install --values values.yaml consul hashicorp/consul --create-namespace --namespace consul --version "1.3.0"
NAME: consul
LAST DEPLOYED: Fri Dec  8 11:06:04 2023
NAMESPACE: consul
STATUS: deployed
REVISION: 1
NOTES:
Thank you for installing HashiCorp Consul!

Your release is named consul.

To learn more about the release, run:

  $ helm status consul --namespace consul
  $ helm get all consul --namespace consul

Consul on Kubernetes Documentation:
https://www.consul.io/docs/platform/k8s

Consul on Kubernetes CLI Reference:
https://www.consul.io/docs/k8s/k8s-cli
dyu@dyu-JRXHVGG467 kind-consulk8s % kubectl get pods --namespace consul
NAME                                          READY   STATUS    RESTARTS   AGE
consul-connect-injector-685cd7cd46-bmswc      1/1     Running   0          37s
consul-server-0                               1/1     Running   0          37s
consul-webhook-cert-manager-9d7cc8cc5-dq8jv   1/1     Running   0          37s

values.yaml

# Contains values that affect multiple components of the chart.
global:
  # The main enabled/disabled setting.
  # If true, servers, clients, Consul DNS and the Consul UI will be enabled.
  enabled: true
  # The prefix used for all resources created in the Helm chart.
  name: consul
  image: hashicorp/consul:1.17.0
  # The name of the datacenter that the agents should register as.
  datacenter: dc1
  # Enables TLS across the cluster to verify authenticity of the Consul servers and clients.
  tls:
    enabled: true
  # Enables ACLs across the cluster to secure access to data and APIs.
  acls:
    # If true, automatically manage ACL tokens and policies for all Consul components.
    manageSystemACLs: true
# Configures values that configure the Consul server cluster.
server:
  enabled: true
  # The number of server agents to run. This determines the fault tolerance of the cluster.
  replicas: 1
# Contains values that configure the Consul UI.
ui:
  enabled: true
  # Registers a Kubernetes Service for the Consul UI as a NodePort.
  service:
    type: NodePort
connectInject:
  initContainer:
    resources:
      requests:
        memory: "25Mi"
        cpu: "50m"
      limits:
         memory: "150Mi"
         cpu: null

@PavelPikat
Copy link

PavelPikat commented Feb 17, 2024

I have the same issue with 1.3.3 Helm chart using ArgoCD.
Seems to be related to argoproj/argo-cd#7291

As a workaround, I've disabled PDBs in values.yaml:

server:
  disruptionBudget
    enabled: false
connectInject:
  disruptionBudget:
    enabled: false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants