2

Using Kubernetes on Azure Container Service (not the new AKS though).

I'm deploying a front-end up like this:

apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: frontend-deployment
spec:
  selector:
    matchLabels:
      app: frontend
  replicas: 2
  template:
    metadata:
      labels:
        app: frontend
    spec:
      containers:
      - name: frontend
        image: etc/etc
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 3000
---
apiVersion: v1
kind: Service
metadata:
  name: frontend
spec:
  type: LoadBalancer
  ports:
  - port: 80
    targetPort: 3000
  selector:
    app: frontend

I can see that it's started correctly from the logs.

From kubectl get services I can see that it has been assigned an External IP. But when I try to access that via HTTP it just hangs.

I also can see in the Azure Portal that the Azure Load Balancer was created and is pointing to the correct external IP and backend pool.

Can anyone tell me if I somehow messed up the port assignments in the pod definition?

--

Update: Somehow it started working on it's own (or seemed like). But when I tried to re-create it as a Service instead of Deployment it stopped working

Here's my Service:

This is my config:

apiVersion: v1
kind: Service
metadata:
  creationTimestamp: null
  name: meteor
spec:
  externalTrafficPolicy: Cluster
  ports:
  - port: 80
    protocol: TCP
    targetPort: http-server
  selector:
    app: frontend
  sessionAffinity: ClientIP
  type: LoadBalancer

It creates the external IP for the load balancer, and I can see that it is properly matching the pods. but I get a timeout when I try to connect to the external IP. Meanwhile the load balancer that was created as part of the deployment continues to work just fine.

Jordan Baker
  • 4,103
  • 1
  • 20
  • 18

2 Answers2

1

do you know how to change the agent VM size in an existing ACS deployment?

We can change k8s agent via Azure portal, the agent in Azure is a VM, we should resize the VM :

enter image description here

enter image description here

Hope this helps.

Jason Ye
  • 13,710
  • 2
  • 16
  • 25
  • hey actually I'm still having the same issue as the original question. It stopped working again and I can't figure out why ;) – Jordan Baker Nov 14 '17 at 06:39
1

It looks like the problem was a mis-specification of the targetPort. Adjusting it to the correct value and replacing the Service definition solved the problem.

Jordan Baker
  • 4,103
  • 1
  • 20
  • 18