Lab 3.3 Helm does not create a pod
Hello,
I am having trouble creating a pod in the third lab exercise for the 3rd unit.
Steps I followed:
1) Command: helm create myapp
2) Command: helm install demo myapp
Output:NAME: demo LAST DEPLOYED: Fri Oct 18 11:10:58 2024 NAMESPACE: default STATUS: deployed REVISION: 1 NOTES: 1. Get the application URL by running these commands: export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=myapp,app.kubernetes.io/instance=demo" -o jsonpath="{.items[0].metadata.name}") export CONTAINER_PORT=$(kubectl get pod --namespace default $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") echo "Visit http://127.0.0.1:8080 to use your application" kubectl --namespace default port-forward $POD_NAME 8080:$CONTAINER_PORT
3) Command: kubectl get pods
Output: No resources found in default namespace
4) Command: kubectl get deployments -o wide
Output: NAME READY UP-TO-DATE AVAILABLE AGE CONTAINERS IMAGES SELECTOR demo-myapp 0/1 0 0 49s myapp nginx:1.16.0 app.kubernetes.io/instance=demo,app.kubernetes.io/name=myapp
Steps for diagnostics:
1) I have verified that microk8s is running.
Command : microk8s status
Output:microk8s is running high-availability: no datastore master nodes: 127.0.0.1:19001 datastore standby nodes: none addons: enabled: dns # (core) CoreDNS ha-cluster # (core) Configure high availability on the current node helm # (core) Helm - the package manager for Kubernetes helm3 # (core) Helm 3 - the package manager for Kubernetes disabled: cert-manager # (core) Cloud native certificate management cis-hardening # (core) Apply CIS K8s hardening community # (core) The community addons repository dashboard # (core) The Kubernetes dashboard gpu # (core) Alias to nvidia add-on host-access # (core) Allow Pods connecting to Host services smoothly hostpath-storage # (core) Storage class; allocates storage from host directory ingress # (core) Ingress controller for external access kube-ovn # (core) An advanced network fabric for Kubernetes mayastor # (core) OpenEBS MayaStor metallb # (core) Loadbalancer for your Kubernetes cluster metrics-server # (core) K8s Metrics Server for API access to service metrics minio # (core) MinIO object storage nvidia # (core) NVIDIA hardware (GPU and network) support observability # (core) A lightweight observability stack for logs, traces and metrics prometheus # (core) Prometheus operator for monitoring and logging rbac # (core) Role-Based Access Control for authorisation registry # (core) Private image registry exposed on localhost:32000 rook-ceph # (core) Distributed Ceph storage using Rook storage # (core) Alias to hostpath-storage add-on, deprecated
2) I checked the status of the deployment:
Command: kubectl logs deployment.apps/demo-myapp
Output: error: watch closed before UntilWithoutRetry timeout
Does anyone have any suggestions as to why I am receiving the timeout error? Thanks.
Best Answer
-
Okay, I fixed the problem. Turns out it was related to
microk8s.I went to the troubleshooting page for
microk8s: https://microk8s.io/docs/troubleshooting#heading--common-issues.The following command was useful:
sudo microk8s inspect.The command gave an error of the following form:
... Inspecting dqlite Inspect dqlite cp: cannot stat '/var/snap/microk8s/7229/var/kubernetes/backend/localnode.yaml': No such file or directoryI came across this discussion on github: https://github.com/canonical/microk8s/issues/4361
I tried the solution provided by one of the users(specifically: https://github.com/canonical/microk8s/issues/4361#issuecomment-2200521421)
I ran the
microk8s inspectcommand again and there were no errors.Subsequently, I re ran all the helm commands I tried earlier and now I can see the pod and the deployment in the default namespace (and more importantly it is available and running).
0
Categories
- All Categories
- 177 LFX Mentorship
- 177 LFX Mentorship: Linux Kernel
- 750 Linux Foundation IT Professional Programs
- 373 Cloud Engineer IT Professional Program
- 169 Advanced Cloud Engineer IT Professional Program
- 74 DevOps IT Professional Program - Discontinued
- 4 DevOps & GitOps IT Professional Program
- 99 Cloud Native Developer IT Professional Program
- 7.6K Training Courses & Learning Paths
- 2 AI & ML Training
- 1 Blockchain & Decentralized Identity Training
- 5 Cloud & Containers Training
- 1 Cybersecurity Training
- 2 DevOps & Site-Reliability Training
- 1 Linux Kernel Development Training
- 1 Networking Training
- 2 Open Source Best Practice Training
- 1 System Administration Training
- 1 System Engineering Training
- 1 Web & Application Development Training
- 792 Hardware
- 202 Drivers
- 68 I/O Devices
- 37 Monitors
- 95 Multimedia
- 173 Networking
- 91 Printers & Scanners
- 87 Storage
- 769 Linux Distributions
- 81 Debian
- 68 Fedora
- 22 Linux Mint
- 13 Mageia
- 24 openSUSE
- 150 Red Hat Enterprise
- 31 Slackware
- 13 SUSE Enterprise
- 356 Ubuntu
- 465 Linux System Administration
- 31 Cloud Computing
- 73 Command Line/Scripting
- Github systems admin projects
- 98 Linux Security
- 78 Network Management
- 101 System Management
- 46 Web Management
- 107 Mobile Computing
- 18 Android
- 74 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 393 Off Topic
- 121 Introductions
- 182 Small Talk
- 29 Study Material
- 959 Programming and Development
- 310 Kernel Development
- 631 Software Development
- 986 Software
- 378 Applications
- 182 Command Line
- 5 Compiling/Installing
- 68 Games
- 317 Installation
- Archived
- 2 LFD140 Class Forum
- 1.4K LFS258 Class Forum
Upcoming Training
-
August 20, 2018
Kubernetes Administration (LFS458)
-
August 20, 2018
Linux System Administration (LFS301)
-
August 27, 2018
Open Source Virtualization (LFS462)
-
August 27, 2018
Linux Kernel Debugging and Security (LFD440)