Closed
Description
Hi, im trying to run auto-scaling in kubernetes with metrics-server. but the target give error
ubuntu@master:~/auto-scaling$ kubectl get hpa
NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE
php-apache Deployment/php-apache <unknown>/50% 1 10 0 10s
and when im trying to get the metrics-server with
> ubuntu@master:~/auto-scaling$ kubectl get svc --all-namespaces
> NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
> default kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 1d
> default php-apache ClusterIP 10.101.201.103 <none> 80/TCP 1m
> kube-system kube-dns ClusterIP 10.96.0.10 <none> 53/UDP,53/TCP 1d
> kube-system metrics-server ClusterIP 10.110.186.18 <none> 443/TCP 1d
> ubuntu@master:~/auto-scaling$ curl https://10.110.186.18 -k
> {
> "kind": "Status",
> "apiVersion": "v1",
> "metadata": {},
> "status": "Failure",
> "message": "forbidden: User \"system:anonymous\" cannot get path \"/\".",
> "reason": "Forbidden",
> "details": {},
> "code": 403
> }
> ubuntu@master:~/auto-scaling$
i cant access the metrics-server. im deploying fresh kubernetes with kubeadm.
ubuntu@master:~/auto-scaling$ kubectl describe pod metrics-server-86bd9d7667-ghl8h -n kube-system
Name: metrics-server-86bd9d7667-ghl8h
Namespace: kube-system
Node: worker0/10.200.200.20
Start Time: Fri, 06 Jul 2018 04:48:37 +0200
Labels: k8s-app=metrics-server
pod-template-hash=4268583223
Annotations: <none>
Status: Running
IP: 10.244.1.30
Controlled By: ReplicaSet/metrics-server-86bd9d7667
Containers:
metrics-server:
Container ID: docker://7c7b6e4595225c479ae21d1075630402329c722eff93ad3534effe6bbaffea56
Image: gcr.io/google_containers/metrics-server-amd64:v0.2.1
Image ID: docker-pullable://gcr.io/google_containers/metrics-server-amd64@sha256:49a9f12f7067d11f42c803dbe61ed2c1299959ad85cb315b25ff7eef8e6b8892
Port: <none>
Host Port: <none>
Command:
/metrics-server
--source=kubernetes.summary_api:''
State: Running
Started: Fri, 06 Jul 2018 04:48:49 +0200
Ready: True
Restart Count: 0
Environment: <none>
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from metrics-server-token-8rgcx (ro)
Conditions:
Type Status
Initialized True
Ready True
ContainersReady True
PodScheduled True
Volumes:
metrics-server-token-8rgcx:
Type: Secret (a volume populated by a Secret)
SecretName: metrics-server-token-8rgcx
Optional: false
QoS Class: BestEffort
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s
Events: <none>
ubuntu@master:~/auto-scaling$ kubectl get node
NAME STATUS ROLES AGE VERSION
master Ready master 1d v1.11.0
worker0 Ready <none> 1d v1.11.0
ubuntu@master:~/auto-scaling$
Activity
zufardhiyaulhaq commentedon Jul 7, 2018
im successfully deploy the metrics-server
this is my deployment
and this is my HPA
i have trying this #40 to allaow system:anonymous, but still cant access the metrics-server via ClusterIP
zufardhiyaulhaq commentedon Jul 7, 2018
this is my kube-apiserver manifest (default created by kubeadm)
zufardhiyaulhaq commentedon Jul 7, 2018
fix with #77