netbox-kubernetes icon indicating copy to clipboard operation
netbox-kubernetes copied to clipboard

netbox and nginx stuck in Pending

Open haji-haji-haji opened this issue 6 years ago • 14 comments

Hi there,

I have netbox and nginx stuck in Pending, its stating files not found? Is there something missing in the steps?

Events: Type Reason Age From Message


Warning FailedScheduling 64s (x3 over 64s) default-scheduler persistentvolumeclaim "netbox-static-files" not found Warning FailedScheduling 63s (x3 over 64s) default-scheduler pod has unbound immediate PersistentVolumeClaims (repeated 2 times)

Events: Type Reason Age From Message


Warning FailedScheduling 63s (x3 over 63s) default-scheduler pod has unbound immediate PersistentVolumeClaims (repeated 2 times)

Kind regards,

Haji

haji-haji-haji avatar Dec 26 '18 04:12 haji-haji-haji

Hi @vishnoisuresh,

Just wondering if you have had a chance to see this? Is it something simple that can be fixed?

Kind regards,

Haji

haji-haji-haji avatar Jan 03 '19 23:01 haji-haji-haji

Hi @haji-haji-haji , Sorry for the delay, Would it be possible for you to upload the result of the following command ?

kubectl get pods
kubectl describe pods $NETBOX_POD_NAME
kubectl get pvc 
kubectl describe pvc $PVC_NAME

regards, Suresh

vishnoisuresh avatar Jan 04 '19 08:01 vishnoisuresh

Hey @vishnoisuresh,

Thank you for your reply, highly appreciated!

netbox.txt

attached are the results of your request :)

Please let me know your thoughts?

Kind regards,

Haji

haji-haji-haji avatar Jan 07 '19 05:01 haji-haji-haji

Hi @haji-haji-haji,

The logs say there is no PVC persistentvolumeclaim "netbox-static-files" not found .

can you check if there is a pvc and with the following command? kubebctl get pvc

are you running these app of minikube ? As If you want to run it on normal k8s cluster there needs to be some modification as nginx and netapp need to be running on the same node or both of these containers inside a same pod.

vishnoisuresh avatar Jan 07 '19 08:01 vishnoisuresh

Hey @vishnoisuresh,

Thanks for that, actually they are running on a proper K8's cluster, what modifications are required to the files and I will make it happen :)

Kind regards,

Haji

haji-haji-haji avatar Jan 07 '19 23:01 haji-haji-haji

Okay I pinned it with nodeName: ${node_name} this got both containers to spin but they are stuck with the storage right now:

[root@lab-sdn-tungsten01 netbox-kubernetes]# kubectl describe pvc -n netbox Name: netbox-static-files Namespace: netbox StorageClass: Status: Pending Volume: Labels: pvcname=netbox-static-files Annotations: kubectl.kubernetes.io/last-applied-configuration: {"apiVersion":"v1","kind":"PersistentVolumeClaim","metadata":{"annotations":{},"labels":{"pvcname":"netbox-static-files"},"name":"netbox-s... Finalizers: [kubernetes.io/pvc-protection] Capacity: Access Modes: VolumeMode: Filesystem Events: Type Reason Age From Message


Normal FailedBinding 4m22s (x5842 over 24h) persistentvolume-controller no persistent volumes available for this claim and no storage class is set Mounted By: netbox-78dcf6b84f-z9hj2 nginx-65b6dbf8c-fs9q8 [root@lab-sdn-tungsten01 netbox-kubernetes]# kubectl describe pvc -n netbox Name: netbox-static-files Namespace: netbox StorageClass: Status: Pending Volume: Labels: pvcname=netbox-static-files Annotations: kubectl.kubernetes.io/last-applied-configuration: {"apiVersion":"v1","kind":"PersistentVolumeClaim","metadata":{"annotations":{},"labels":{"pvcname":"netbox-static-files"},"name":"netbox-s... Finalizers: [kubernetes.io/pvc-protection] Capacity: Access Modes: VolumeMode: Filesystem Events: Type Reason Age From Message


Normal FailedBinding 8s (x5862 over 24h) persistentvolume-controller no persistent volumes available for this claim and no storage class is set Mounted By: netbox-78dcf6b84f-z9hj2 nginx-65b6dbf8c-fs9q8 [root@lab-sdn-tungsten01 netbox-kubernetes]#

haji-haji-haji avatar Jan 08 '19 05:01 haji-haji-haji

Hi @haji-haji-haji , It seems there is no default storage class in your cluster, When you provide a PVC in the behind there is a PV created which is gonna bound to PVC.

If you are a cluster admin of the cluster then you can cross check storage class with the following command oc get storageclass there will be a default storage class. If not you can change it with this link https://kubernetes.io/docs/tasks/administer-cluster/change-default-storage-class/

vishnoisuresh avatar Jan 08 '19 08:01 vishnoisuresh

Hey @vishnoisuresh ,

Thank you for your assistance on this, its all resolved now.

one last quick question, if I wanted to integrate napalm into your container what is required. Have you tried to add it on?

Kind regards,

Haji

haji-haji-haji avatar Jan 11 '19 04:01 haji-haji-haji

Hi @vishnoisuresh,

Any updates here please? Is it something I can assist with? As to build manually and add other components are mostly pip and apk commands that I have run manually :) as a workaround.

Kind regards,

Haji

haji-haji-haji avatar Jan 16 '19 05:01 haji-haji-haji

Hi @haji-haji-haji PRs are welcome. :) Thanks

vishnoisuresh avatar Jan 16 '19 07:01 vishnoisuresh

No problem @vishnoisuresh, I will do. Please share where and how you define the image to be downloaded from the repo.

haji-haji-haji avatar Jan 16 '19 07:01 haji-haji-haji

Found it @vishnoisuresh!

Is there a reason why you are only pulling image 2.2.6? versus the current master? the current master has Napalm built in. and I can get a pull request to ninech/netbox to possibly add other network switch vendors too.

haji-haji-haji avatar Jan 16 '19 08:01 haji-haji-haji

Hi @haji-haji-haji ,

thanks for evaluating the content. I did this project for learning purpose (k8s, openshift), thus it still in old phase. Now I have moved to different company thus I did not have opportunity to follow the timeline of Netbox.

The image is build and managed by ninech thus we just need to write kubernetes manifest files with correct configuration contents and resources dependencies.

If you like to contribute and reconcile it to the current phase that would be highly appreciated. we need to

thanks

vishnoisuresh avatar Jan 16 '19 08:01 vishnoisuresh

Thanks @vishnoisuresh Ill see what can be done and how much breaks :) ill post the PR once I am done.

haji-haji-haji avatar Jan 16 '19 08:01 haji-haji-haji