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

kubectl apply equivalent #2584

Closed
KyleKotowick opened this issue Sep 10, 2024 · 1 comment
Closed

kubectl apply equivalent #2584

KyleKotowick opened this issue Sep 10, 2024 · 1 comment
Assignees
Labels

Comments

@KyleKotowick
Copy link

Terraform version, Kubernetes provider version and Kubernetes version

Terraform version: 1.9.5
Kubernetes Provider version: 2.32.0
Kubernetes version: 1.29.7

Question

I need to apply some parameters to a namespace that I've created. With kubectl, I would do this as follows:

kubectl create ns mynamespace
kubectl apply -n mynamespace -f quota.yaml

Where quota.yaml is:

apiVersion: v1
kind: ResourceQuota
metadata:
  name: quotas
spec:
  hard:
    pods: 5
  scopeSelector:
    matchExpressions:
    - operator: In
      scopeName: PriorityClass
      values:
      - myvalue1
      - myvalue2

Is there any way to achieve this same thing using the Terraform Kubernetes provider? I don't see any way to apply parameters like this in the kubernetes_namespace resource, and I don't see any other resource that would correspond to a kubectl apply.

Thanks!

@sheneska
Copy link
Contributor

Hi @KyleKotowick, an alternative solution would be to use kubernetes_namespace_v1 to create the namespace and kubernetes_resource_quotas_v1 to apply the specific quota to your namespace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants