Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

486
Views
How to write correct yaml for deploying kubernetes cluster in Azure devops?

I am trying to establish Dockerized Angular application in azure cloud by using kubernetes but I can not do that. Everything looks fine but I can not see angular application when I enter web url on browser.What is wrong in my Dockerfile or yml files? Can you give me some advises? I made lots of search in 2 days but I didn't find a solution.

deployment.yml :


apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: xxx-pod
  name: xxx-deployment
spec:
  replicas: 5
  selector:
    matchLabels:
      app: xxx-pod
  strategy: {}
  template:
    metadata:
     labels:
        app: xxx-pod
    spec:
      containers:
      - image: xxx.azurecr.io/cm-webui:v1
        name: webapp
        imagePullPolicy: Always
        resources: {}
        ports:
          - containerPort: 3080 
status: {}

service.yml:


apiVersion: v1
kind: Service
metadata:
  name: xxx-service
  labels:
    run: xxx-pod
spec:
  selector:
    app: xxx-pod
  ports:
  - port: 3080
    targetPort: 80
  type: LoadBalancer

Dockerfile:


FROM node:10 AS ui-build
WORKDIR /usr/src/app
COPY my-app/ ./my-app/
RUN cd my-app && npm install @angular/cli && npm install && npm run build

FROM node:10 AS server-build
WORKDIR /root/
COPY --from=ui-build /usr/src/app/my-app/dist ./my-app/dist
COPY package*.json ./
RUN npm install
COPY server.js .

EXPOSE 3080

CMD ["node", "server.js"]

My Logs :


8m13s       Normal    EnsuredLoadBalancer            service/xxx-service                    Ensured load balancer
8m17s       Warning   FailedToUpdateEndpoint         endpoints/xxx-service                  Failed to update endpoint default/xxx-service: Operation cannot be fulfilled on endpoints "xxx-service": the object has been modified; please apply your changes to the latest version and try again
8m17s       Warning   FailedToUpdateEndpointSlices   service/xxx-service                    Error updating Endpoint Slices for Service default/xxx-service: failed to update xxx-service-p429q EndpointSlice for Service default/xxx-service: Operation cannot be fulfilled on endpointslices.discovery.k8s.io "xxx-service-p429q": the object has been modified; please apply your changes to the latest version and try again
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

In the service definition you exchanged port and targetPort values. port should be 80 and targetPort 3080.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!