#!/bin/sh

ifname=`/usr/bin/grep host_interface /etc/criwpard/criwpard.conf | /usr/bin/cut -d\" -f4`
[ -z "$ifname" ] && exit 1
ipaddr=`/usr/sbin/lsattr -El $ifname -a netaddr -F value`
[ -z "$ipaddr" ] && exit 1

export GOMAXPROCS=3
exec /opt/freeware/bin/kubelet \
	--feature-gates Accelerators=true,ExperimentalCriticalPodAnnotation=true \
	--allow-privileged=true \
	--cadvisor-port=0 \
	--kubeconfig=/var/lib/kubelet/kubelet-config \
	--read-only-port=0 \
	--client-ca-file=/var/lib/kubelet/ca.crt \
	--authentication-token-webhook \
	--anonymous-auth=false \
	--network-plugin=cni \
	--pod-manifest-path=/etc/cfc/pods \
	--hostname-override=$ipaddr \
	--node-ip=$ipaddr \
	--cluster-dns=10.0.0.10 \
	--cluster-domain=cluster.local \
	--enforce-node-allocatable="" \
	--cgroups-per-qos=false \
	--image-gc-high-threshold=100 \
	--image-gc-low-threshold=100 \
	--fail-swap-on=false \
	--container-runtime=remote \
	--container-runtime-endpoint=unix:///var/run/criwpard.sock \
	--runtime-request-timeout=10m \
	--register-with-taints=ibm.com/aix=true:NoSchedule \
	--v=2 \
	--logtostderr=false \
	--logtosyslog=kubelet
