google / cadvisor

Analyzes resource usage and performance characteristics of running containers.
Other
17.23k stars 2.33k forks source link

The deployment method for kubernetes isn't effective #3617

Open lengcangche-gituhub opened 4 weeks ago

lengcangche-gituhub commented 4 weeks ago

I deploy cadvisor following the instructions in https://github.com/google/cadvisor/tree/master/deploy/kubernetes. However, after "kustomize build "https://github.com/google/cadvisor/deploy/kubernetes/base?ref=${VERSION}" | kubectl apply -f -", there is no pod for cadvisor.

Additionally, the output is:

Warning: 'commonLabels' is deprecated. Please use 'labels' instead. Run 'kustomize edit fix' to update your Kustomization automatically. namespace/cadvisor created serviceaccount/cadvisor created daemonset.apps/cadvisor created

Creatone commented 4 weeks ago

Hello, that's strange. Could you give me output of kubectl -n cadvisor get pods ?

λ ~/ echo $VERSION                                                                                                  

λ ~/ kustomize build "https://github.com/google/cadvisor/deploy/kubernetes/base?ref=${VERSION}" | kubectl apply -f -
# Warning: 'commonLabels' is deprecated. Please use 'labels' instead. Run 'kustomize edit fix' to update your Kustomization automatically.
namespace/cadvisor created
serviceaccount/cadvisor created
daemonset.apps/cadvisor created
λ ~/ kubectl -n cadvisor get daemonsets.apps                                                                        
NAME       DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
cadvisor   1         1         1       1            1           <none>          5s
λ ~/ kubectl -n cadvisor get pods           
NAME             READY   STATUS    RESTARTS   AGE
cadvisor-2p4rj   1/1     Running   0          9s
lengcangche-gituhub commented 4 weeks ago

v0.49.0

No resources found in cadvisor namespace.

Creatone commented 3 weeks ago

Could you give me output of kubectl -n cadvisor describe daemonsets.apps ?

lengcangche-gituhub commented 1 week ago

Hello, that's strange. Could you give me output of kubectl -n cadvisor get pods ?

λ ~/ echo $VERSION

λ ~/ kustomize build "https://github.com/google/cadvisor/deploy/kubernetes/base?ref=${VERSION}" | kubectl apply -f -

Warning: 'commonLabels' is deprecated. Please use 'labels' instead. Run 'kustomize edit fix' to update your Kustomization automatically.

namespace/cadvisor created serviceaccount/cadvisor created daemonset.apps/cadvisor created λ ~/ kubectl -n cadvisor get daemonsets.apps
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE cadvisor 1 1 1 1 1 5s λ ~/ kubectl -n cadvisor get pods
NAME READY STATUS RESTARTS AGE cadvisor-2p4rj 1/1 Running 0 9s

Another strange thing: I haven't do anything, and this time I input "kubectl -n cadvisor get pods", the output is: NAME READY STATUS RESTARTS AGE cadvisor-6tmn5 0/1 ContainerCreating 0 97s

However, I input "kubectl -n cadvisor get daemonsets.apps", the output is: Name: cadvisor Selector: app=cadvisor,name=cadvisor Node-Selector: <none> Labels: app=cadvisor Annotations: deprecated.daemonset.template.generation: 1 seccomp.security.alpha.kubernetes.io/pod: docker/default Desired Number of Nodes Scheduled: 1 Current Number of Nodes Scheduled: 1 Number of Nodes Scheduled with Up-to-date Pods: 1 Number of Nodes Scheduled with Available Pods: 0 Number of Nodes Misscheduled: 0 Pods Status: 0 Running / 1 Waiting / 0 Succeeded / 0 Failed Pod Template: Labels: app=cadvisor name=cadvisor Service Account: cadvisor Containers: cadvisor: Image: gcr.io/cadvisor/cadvisor:v0.45.0 Port: 8080/TCP Host Port: 0/TCP Limits: cpu: 800m memory: 2000Mi Requests: cpu: 400m memory: 400Mi Environment: <none> Mounts: /dev/disk from disk (ro) /rootfs from rootfs (ro) /sys from sys (ro) /var/lib/docker from docker (ro) /var/run from var-run (ro) Volumes: rootfs: Type: HostPath (bare host directory volume) Path: / HostPathType:
var-run: Type: HostPath (bare host directory volume) Path: /var/run HostPathType:
sys: Type: HostPath (bare host directory volume) Path: /sys HostPathType:
docker: Type: HostPath (bare host directory volume) Path: /var/lib/docker HostPathType:
disk: Type: HostPath (bare host directory volume) Path: /dev/disk HostPathType:
Events: Type Reason Age From Message


Normal SuccessfulCreate 38s daemonset-controller Created pod: cadvisor-6tmn5

and I input "kubectl -n cadvisor describe pods cadvisor-6tmn5", part of the output is: Warning FailedCreatePodSandBox <invalid> kubelet (combined from similar events): Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "7730077d97a7b82247f09092dd7ad98093abf2b9bcb5b6b784d04251354ae75e": plugin type="flannel" failed (add): loadFlannelSubnetEnv failed: open /run/flannel/subnet.env: no such file or directory