I am trying to configure the ProxySQL service in Kubernetes in Google cloud to setup a a load balancer with an Internal IP address. However, in order for Google to use an internal IP, I need to add an annotation to the ProxySQL service.
I tried modifying cr.yaml with the following:
proxysql:
enabled: true
size: 3
image: percona/percona-xtradb-cluster-operator:1.7.0-proxysql
imagePullPolicy: Always
...
annotations:
cloud.google.com/load-balancer-type: Internal
loadBalancerSourceRanges:
- 10.0.0.0/8
I applied the configuration using:
bash$ kubectl -f cr.yaml
And verify with the command:
bash$ kubectl describe service cluster1-proxysql
And I don’t see the annotation:
Name: cluster1-proxysql
Namespace: default
Labels: app.kubernetes.io/instance=cluster1
app.kubernetes.io/name=percona-xtradb-cluster
Selector: app.kubernetes.io/component=proxysql,app.kubernetes.io/instance=cluster1,app.kubernetes.io/name=percona-xtradb-cluster
I can only see the annotation after editing the service manually.
Name: cluster1-proxysql
Namespace: rldb-replica
Labels: app.kubernetes.io/instance=cluster1
app.kubernetes.io/name=percona-xtradb-cluster
Annotations: cloud.google.com/load-balancer-type: Internal
Selector: app.kubernetes.io/component=proxysql,app.kubernetes.io/instance=cluster1,app.kubernetes.io/name=percona-xtradb-cluster
The parameter loadBalancerSourceRanges did not get applied either.
I tried searching the forum and the bug list but did not find anything related to this. Has anybody encountered this issue or know if this is a bug?
I also tried to use serviceAnnotations but got the same result.
I also saw this commit to fix the annotation for the pods but did not find one for the service. Is it possible that this also needs to be fixed in the service deployments?
In addition to the above, is there a way to set a static IP address by setting the loadBalancerIP so that the IP will not change if I modify the service? I did not find it in the documentation.