mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-27 19:35:32 +00:00
tools.kata-webhook: Specify runtime class using configMap
The kata webhook requires a configmap to define what runtime class it should set for the newly created pods. Additionally, the configmap allows others to modify the default runtime class name we wish to set (in case the handler is kata but the name of the runtimeclass is different). Finally, this PR changes the webhook-check to compare the runtime of the newly created pod against the specific runtime class in the configmap, if said confimap doesn't exist, then it will default to "kata". Signed-off-by: Martin <mheberling@microsoft.com>
This commit is contained in:
parent
5402f2c637
commit
b9d88f74ed
@ -67,3 +67,10 @@ spec:
|
||||
targetPort: 8080
|
||||
selector:
|
||||
app: pod-annotate-webhook
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: kata-webhook
|
||||
data:
|
||||
runtime_class: kata
|
||||
|
@ -16,7 +16,7 @@ source "${webhook_dir}/common.bash"
|
||||
|
||||
readonly hello_pod="hello-kata-webhook"
|
||||
# The Pod RuntimeClassName for Kata Containers.
|
||||
RUNTIME_CLASS="${RUNTIME_CLASS:-"kata"}"
|
||||
RUNTIME_CLASS="${RUNTIME_CLASS:-$(kubectl get configmap kata-webhook -o jsonpath='{.data.runtime_class}' 2>/dev/null || echo "kata")}"
|
||||
|
||||
cleanup() {
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user