luxas / kubeadm-workshop

Showcasing a bare-metal multi-platform kubeadm setup with persistent storage and monitoring
MIT License
680 stars 190 forks source link

I do not see custom-metrics-apiserver pod #38

Open sdhanraj opened 6 years ago

sdhanraj commented 6 years ago

Hi @luxas, I am following the sample provided @ https://docs.bitnami.com/kubernetes/how-to/configure-autoscaling-custom-metrics/ to try horizontal scaling of pods. During the creation of custom API server when I do "kubectl create -f custom-metrics.yaml", I see that the custom service is deployed. But I do not see the pod corresponding to it. Is there a step I am missing?

kubectl create -f custom-metrics.yaml --show-all=true namespace "custom-metrics" created serviceaccount "custom-metrics-apiserver" created clusterrolebinding "custom-metrics:system:auth-delegator" created rolebinding "custom-metrics-auth-reader" created clusterrole "custom-metrics-read" created clusterrolebinding "custom-metrics-read" created deployment "custom-metrics-apiserver" created service "api" created apiservice "v1alpha1.custom-metrics.metrics.k8s.io" created clusterrole "custom-metrics-server-resources" created clusterrolebinding "hpa-controller-custom-metrics" created

kubectl get pods -n custom-metrics No resources found.

Location of custom metrics yaml https://github.com/kubeless/kubeless/blob/master/manifests/autoscaling/custom-metrics.yaml

sdhanraj commented 6 years ago

I did a browse on cluster and in the namespace corresponding to custom metrics server I see the following error.

Error creating: pods "" is forbidden: SecurityContext.RunAsUser is forbidden

sdhanraj commented 6 years ago

I see the same issue when I follow the instructions @ https://github.com/luxas/kubeadm-workshop#deploying-the-prometheus-operator-for-monitoring-services-in-the-cluster. I am creating a ACS cluster on Azure and version of Kubernetes is 1.7.9.

StevieBowman commented 6 years ago

@sdhanraj Had the same error message on ACS (1.9.2). You need to edit the kube-apiserver.yaml (sudo vi kube-apiserver.yaml) on the Master Server (found in /etc/kubernetes/manifests). Remove the SecurityContextDeny from the --admission-control=NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,ResourceQuota,DenyEscalatingExec,AlwaysPullImages,SecurityContextDeny argument in the file. Save the file.