I have some weird problems on Azure Kubernetes calling outside services, that may either be caused
by Kubernetes, Microsoft or my ignorance.
I am trying to call some other services on AWS and I need to whitelist the IP address of my kubernetes pod calling it. I used the external IP address of the service/deployment named “tomcat” and it worked just fine.
-
But then I added a second service also with a public external IP address named “pydro”. Suddenly my tomcat pods could not access the AWS services from tomcat anymore, unless I whitelisted pydros external IP address.
-
Now I created an additional development cluster. It only has the tomcat service. Whitelisting the external IP address did not work for some reason. Then I looked around in the configuration generated by Azure and found 2 “Frontend IP configurations” associated with the Load Balancer “kubernetes” in Azure. After white listing the 2nd IP address on AWS everything worked again. I could not see the other IP address with “kubectl get services”
Is there something wrong with kubernetes, Azure or with me?
I am not really an IT guy so, I don’t take offense if you tell me what I should change…
Thanks,
Klaus
I thought I add the yaml file for what its is worth - in case it helps:
apiVersion: v1
kind: Service
metadata:
name: tomcat
spec:
type: LoadBalancer
ports:
- port: 443
targetPort: 8443
selector:
app: tomcat
apiVersion: apps/v1
kind: Deployment
metadata:
name: tomcat
labels:
app: tomcat
spec:
replicas: 2
selector:
matchLabels:
app: tomcat
template:
metadata:
labels:
app: tomcat
deployment: test
spec:
containers:
- name: tomcat
image: fourtwentysevenregistry.azurecr.io/application:v1.93
ports:
- containerPort: 8443
env:
- name: JNDI427
value: “demo427”
- name: ENV427
value: “prod”
imagePullSecrets:
- name: yadayadayada
Cluster information:
Kubernetes version: 1.13.12
Cloud being used: Azure
Installation method: Kubernetes wizard
You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.