My Problem: When I run
kubectl -n test scale --replicas=5 -f web-api-deployment.yaml
- It scales the deployment, one POD per node, even though the nodes have plenty of capacity, why doesnt it scale more than one POD per node
- At present only one POD per node gets port 443 access, what if i wanted to run three nginx pods on same node all hosting the same web app on 443 and wanted the load balancer to load balance between the 3 PODS on the same node?
Kubernetes Cluster: 3 Masters 5 worker nodes
AWS: Elastic loadbalancer points port 443 to each Kubernetes worker node
POD DEPLOYMENT:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
namespace: test
name: WEB-API
spec:
replicas: 1
template:
metadata:
labels:
app: WEB-API
spec:
containers:
- name: WEB-API
image: WEB-API:latest
env:
- name: NGINX_WORKER_PROCESSES
value: "1"
- name: KEEPALIVETIMEOUT
value: "0"
- name: NGINX_WORKER_CONNECTIONS
value: "2048"
resources:
requests:
cpu: 500m
memory: 500Mi
ports:
- containerPort: 443
volumeMounts:
- name: config-volume
mountPath: /opt/config/
- name: aws-volume
mountPath: /root/.aws
apiVersion: v1
kind: Service
metadata:
namespace: prd
name: WEB-API
annotations:
external-dns.alpha.kubernetes.io/hostname: someaddress
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: arn:aws:acm:us-east-1:xxxxxxxxxxxxxxxx:certificate/xxxxxxxxxxxxxxxxxxxxxxx
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "443"
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
labels:
app: WEB-API
spec:
externalTrafficPolicy: Cluster
ports:
- name: https
port: 443
targetPort: 80
protocol: TCP
selector:
app: WEB-API
sessionAffinity: None
type: LoadBalancer