k8s labs
lab 3
This Service exposes pods running the vote-deployment app, which listens on port 80 internally. Externally, it exposes port 5000, which maps to node port 31000, allowing external access to the application.
Create a new service: name = vote-service
port = ‘5000’
targetPort = ‘80’
nodePort= ‘31000’
service endpoint exposes deployment ‘vote-deployment’
This Deployment ensures that one replica of the vote-deployment application (from the image kodekloud/examplevotingapp_vote:before) is always running. It uses default settings for updating pods, and it labels the pods with app: vote-deployment for management purposes. This deployment works alongside the service you previously defined, which routes traffic to this pod.
Create a deployment: name = ‘vote-deployment’
image = ‘kodekloud/examplevotingapp_vote:before’
status: ‘Running’
redis servic:
New Service, name = ‘redis’
port: ‘6379’
targetPort: ‘6379’
type: ‘ClusterIP’
service endpoint exposes deployment ‘redis-deployment’
set expandtab set tabstop=2 set shiftwidth=2