Skip to content

Commit

Permalink
Merge pull request #1766 from paritytech/new-admission
Browse files Browse the repository at this point in the history
FIX: changed default instance type
  • Loading branch information
emamihe authored Apr 9, 2024
2 parents ce55fca + 37e7a09 commit f52c667
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions admissioncontroller/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ def deployment_webhook_mutate():
elif labels["x-infra-instance"]=="ondemand-iops":
return admission_response_patch(True, "Adding allow label", json_patch = jsonpatch.JsonPatch([{"op": "add", "path": "/spec/tolerations", "value": [{"effect":"NoExecute", "key":"workload-type",
"operator":"Equal", "value":"large-testnet-iops"}]}, {"op":"add", "path":"/spec/nodeSelector", "value": {"nodetype":"large-network-iops"}}]))
elif labels["x-infra-instance"]=="spot":
elif labels["x-infra-instance"]=="spot-iops":
return admission_response_patch(True, "Adding allow label", json_patch = jsonpatch.JsonPatch([{"op": "add", "path": "/spec/tolerations", "value": [{"effect":"NoExecute", "key":"workload-type",
"operator":"Equal", "value":"xlarge-testnet"}]}, {"op":"add", "path":"/spec/nodeSelector", "value": {"nodetype":"xlarge-network"}}]))
"operator":"Equal", "value":"xlarge-testnet-iops"}]}, {"op":"add", "path":"/spec/nodeSelector", "value": {"nodetype":"xlarge-network-iops"}}]))
else:
return admission_response_patch(True, "Adding allow label", json_patch = jsonpatch.JsonPatch([{"op": "add", "path": "/spec/tolerations", "value": [{"effect":"NoExecute", "key":"workload-type",
"operator":"Equal", "value":"xlarge-testnet-iops"}]}, {"op":"add", "path":"/spec/nodeSelector", "value": {"nodetype":"xlarge-network-iops"}}]))
"operator":"Equal", "value":"xlarge-testnet"}]}, {"op":"add", "path":"/spec/nodeSelector", "value": {"nodetype":"xlarge-network"}}]))

# return admission_response_patch(True, "Adding allow label", json_patch = jsonpatch.JsonPatch([{"op": "add", "path": "/spec/tolerations", "value": [{"operator":"Exists"}]}, {"op":"add", "path":"/spec/affinity", "value": {"nodeAffinity":{"preferredDuringSchedulingIgnoredDuringExecution":[{"weight":100,"preference":{"matchExpressions":[{"key":"nodetype","operator":"In","values":["xlarge-network"]}]}},{"weight":50,"preference":{"matchExpressions":[{"key":"nodetype","operator":"In","values":["large-network"]}]}}]}} }]))

Expand Down

0 comments on commit f52c667

Please sign in to comment.