-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Validation does not catch invalid capacity-type values #1141
Comments
Could you also share your deployment.yaml? I'd like to see what the pod was requesting for. Also if you run
you might be able to see more verbose logging for our controller which might help as well. |
@suket22 shure
Also in debug mod i get two new debug logs:
|
Ok, I have new error... |
Keep in mind, this is an instance profile, not a role. Can you verify with |
I ran into this original error I had
And the correct value is "on-demand". So I just needed to double check my values. FWIW, I turned on debug logs in the karpenter controller and did not see any validation errors when it starts and discovers the Provisioner to help identify which value was incorrect. |
@ellistarn Thanks for the tip! Resolve using instance profile claster. |
Reopening so we can include this value validation. |
We will need the new requirement implementation to print out meaningful error messages at runtime. I will submit a fix after PR #1155 is merged. |
EDIT: Hello, I'm having a similar error where im seeing the following. Seems to be an issue where i have defined one node selector, but karpenter seems to require all to be defined on the workload? 2022-02-02T02:50:20.699Z INFO controller.provisioning Batched 1 pods in 1.000990569s {"commit": "62c4546", "provisioner": "cicd-workload-windows-20h2-build-provisioner"} My Provisioner Config is: ---
apiVersion: karpenter.sh/v1alpha5
kind: Provisioner
metadata:
name: cicd-workload-windows-20h2-build-provisioner
spec:
# If nil, the feature is disabled, nodes will never expire
ttlSecondsUntilExpired: 604800 # 7 days in seconds = 7 * 24 * 60 * 60 Seconds;
# If nil, the feature is disabled, nodes will never scale down due to low utilization
ttlSecondsAfterEmpty: 3600
taints:
- key: <my-org-name>.ci-node-type/windows-build
effect: NoSchedule
labels:
capacity-type: on-demand
<my-org-name>-ci-node-type: windows-build
# Requirements that constrain the parameters of provisioned nodes.
# These requirements are combined with pod.spec.affinity.nodeAffinity rules.
# Operators { In, NotIn } are supported to enable including or excluding values
requirements:
- key: "node.kubernetes.io/instance-type"
operator: In
values: ["m5.large", "m5.xlarge", "m5.2xlarge"]
- key: "topology.kubernetes.io/zone"
operator: In
values: ["ap-southeast-2a", "ap-southeast-2b", "ap-southeast-2c"]
- key: "kubernetes.io/arch"
operator: In
values: ["amd64"]
- key: "karpenter.sh/capacity-type" # If not included, the webhook for the AWS cloud provider will default to on-demand
operator: In
values: ["on-demand"]
- key: "kubernetes.io/os"
operator: In
values: ["windows"]
# Resource limits constrain the total size of the cluster.
# Limits prevent Karpenter from creating new instances once the limit is exceeded.
limits:
resources:
cpu: 32
memory: 128Gi
# These fields vary per cloud provider, see your cloud provider specific documentation
provider:
instanceProfile: "{{ stack_outputs['karpenter-infra']['KarpenterNodeInstanceProfileArn'] }}"
launchTemplate: "lt-{{ cluster_name }}-windows-20H2-amd64"
subnetSelector:
kubernetes.io/cluster/{{ cluster_name }}: shared
securityGroupSelector:
kubernetes.io/cluster/{{ cluster_name }}: owned
tags:
Name: "ec2-{{ cluster_name }}-windows-20h2-build-node"
technical:name: "ec2-{{ cluster_name }}-windows-20h2-build-node"
{% for key, value in common_tags.items() %}
{{ key }}: "{{ value }}"
{% endfor %} the workload config is: ---
apiVersion: apps/v1
kind: Deployment
metadata:
name: inflate
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: inflate
template:
metadata:
labels:
app: inflate
spec:
terminationGracePeriodSeconds: 0
containers:
- name: inflate
image: public.ecr.aws/eks-distro/kubernetes/pause:3.2
resources:
requests:
cpu: 1
tolerations:
- key: "<my-org-name>.ci-node-type/windows-build"
operator: "Exists"
effect: "NoSchedule"
nodeSelector:
<my-org-name>-ci-node-type: windows-build |
Commenting to follow thread as this issue is of interest to me |
https://github.com/aws/karpenter/issues/1131👀 👀 👀 👀 👀
|
i didnt even considder that this was a windows issue - just assumed that it would work since it uses launch templates under the hood.. ill check it out. Thankyou! |
PR #1155 introduces stricter requirement validation and now it will catch typos in provisioner spec without calling any EC2 APIs. The idea is that the requirement values from instanceTypes and from the provisioner will conflict due to typo. For example, - key: karpenter.sh/capacity-type operator: In values: - ondemand will conflict with value |
Version
Karpenter: v0.5.3
Kubernetes: v1.20.0
Hi all!
When apply provisioner and scale test deployment i get some error in logs controller:
Use Provisioner:
Deploy karpenter chart by ansible:
Can u help my?
The text was updated successfully, but these errors were encountered: