Lab 8.2. Horizontal Pod Autoscaler (HPA)
Hi!
In question 3 of lab 8.2, I'm supposed to run the following YAML, but I'm getting the following error and the pods aren't deploying.
Any ideas?
hpa-deploy.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: hpa-app
spec:
replicas: 2
selector:
matchLabels:
app: hpa-app
template:
metadata:
labels:
app: hpa-app
spec:
containers:
- name: web
image: registry.k8s.io/hpa-example
ports:
- containerPort: 80
resources:
requests:
cpu: 5m
limits:
cpu: 10m
apiVersion: v1
kind: Service
metadata:
name: hpa-app
spec:
type: ClusterIP
selector:
app: hpa-app
ports:
- port: 80
targetPort: 80
k get po
NAME READY STATUS RESTARTS AGE
hpa-app-689bbdc665-5zlvx 0/1 Error 1 (3s ago) 7s
hpa-app-689bbdc665-vwswl 0/1 Error 1 (4s ago) 7s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 44s default-scheduler Successfully assigned default/hpa-app-689bbdc665-5zlvx to ubuntu24worker
Normal Pulled 41s kubelet spec.containers{web}: Successfully pulled image "registry.k8s.io/hpa-example" in 406ms (819ms including waiting). Image size: 164030864 bytes.
Normal Pulled 39s kubelet spec.containers{web}: Successfully pulled image "registry.k8s.io/hpa-example" in 430ms (853ms including waiting). Image size: 164030864 bytes.
Normal Pulled 27s kubelet spec.containers{web}: Successfully pulled image "registry.k8s.io/hpa-example" in 456ms (456ms including waiting). Image size: 164030864 bytes.
Normal Pulling 2s (x4 over 42s) kubelet spec.containers{web}: Pulling image "registry.k8s.io/hpa-example"
Normal Created 2s (x4 over 41s) kubelet spec.containers{web}: Container created
Normal Pulled 2s kubelet spec.containers{web}: Successfully pulled image "registry.k8s.io/hpa-example" in 424ms (424ms including waiting). Image size: 164030864 bytes.
Normal Started 1s (x4 over 40s) kubelet spec.containers{web}: Container started
Warning BackOff 1s (x4 over 38s) kubelet spec.containers{web}: Back-off restarting failed container web in pod hpa-app-689bbdc665-5zlvx_default(c9e69060-db88-45f5-8d3c-5b80d74c3fcb)
Thanks!
Answers
-
Any advice?
0 -
Hi @alvarocana85,
I attempted to reproduce the issue, but unfortunately my every attempt yields a working deployment, no errors.
What type of infrastructure is hosting your Kubernetes cluster (cloud - which provider, local - which hypervisor)?
What are the sizes of the 2 VMs, what guest OS is running them?What are the outputs of:
kubectl get nodes -o wide kubectl get pods -o wide -A kubectl top nodes kubectl top nodes --show-capacity kubectl top pods -A --containers --sum
I also recommend using the code-block formatting option for better readability - from the top action ribbon. It was missing from your OP and it is impossible to tell if the manifest has any indentation issues that may impact the launching of the hpa-app deployment.
Regards,
-Chris0 -
My solution was to replace the image: registry.k8s.io/hpa-example with nginx
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
- 1 AI & ML Training
- 1 Blockchain & Decentralized Identity Training
- 3 Cloud & Containers Training
- 1 Cybersecurity Training
- 2 DevOps & Site-Reliability Training
- 1 Linux Kernel Development Training
- 1 Networking Training
- 1 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
- 106 Mobile Computing
- 18 Android
- 73 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 392 Off Topic
- 121 Introductions
- 181 Small Talk
- 29 Study Material
- 955 Programming and Development
- 310 Kernel Development
- 627 Software Development
- 983 Software
- 375 Applications
- 182 Command Line
- 5 Compiling/Installing
- 68 Games
- 317 Installation
- Archived
- 2 LFD140 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)