I create a service which type is loadbalancer, kubernetes create an ELB and listen protocol is tcp 80--->tcp 80
, then I modified the ELB by changing the protocol to http 80--->http 80
, but after a few days, I find that the protocol went back to tcp 80--->tcp 80
again, how could this happen? Any answers would be appreciated
I modified the ELB
If you touch kubernetes resources from outside, kubernetes will find out and restore/reconcile the cluster to the desired state.
Here is more info about k8s ELB.
If you connect your kubernetes cluster to your AWS account and create a service with type: Loadbalancer
Kubernetes will create and configure an ELB pointing to your service for you.
Since this ELB instance is managed by Kubernetes every change to it from outside Kubernetes will be resetted after some time.
By default kubernetes will add, TCP protocol in loadbalancer. If we modify manually, It will get changed automatically by kubernetes. If you wish to keep HTTP protocol in kubernets. Please add below annotations in your service yaml.
apiVersion: v1
kind: Service
metadata:
annotations:
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http