Welcome to the Linux Foundation Forum!

Unable to expose app/service from "Service Object Example": "frontend" not found

From the multiple exercises that I tried (perhaps all of them_ the only one that I couldn't replicate nor fix somehow is the one from 11. Services > Services >> Service Object Example

$ kubectl expose deploy frontend --name=frontend-svc \
--port=80 --target-port=5000
But I only get:
'Error from server (NotFound): deployments.apps "frontend" not found'

I tried with a fresh "minikube start" on a XUbuntu 24.04.4 LTS host, with VirtualBox 7.2.6 and minikube version v1.38.1 using the manifest that appears on the previous section from the same lesson-chapter "Accessing Application Pods"

Any suggestions or explanations?

Answers

  • chrispokorni
    chrispokorni Posts: 2,592

    Hi @rontiv,

    As the error suggests, the expose method requires a live application for successful exposure. The application should be a deployment named "frontend" managing a container listening on port 5000.

    Regards,
    -Chris

Categories

Upcoming Training