I trying out kubernetes and have been trying to deploy a simple tomcat image
apiVersion: apps/v1
kind: Deployment
metadata:
name: simple-hello
labels:
app: hello-tomcat
spec:
replicas: 1
selector:
matchLabels:
app: hello-tomcat
template:
metadata:
labels:
app: hello-tomcat
spec:
containers:
- name: helloworld
image: tomcat:8.0.52-jre8
ports:
- containerPort: 8080
protocol: TCP
After the deployment, I simply expose it
kubectl expose deployment simple-hello --type=LoadBalancer --name=my-service
I have also tried
kubectl expose deployment simple-hello --type=LoadBalancer --name=my-service --port 80 --target-port 8080
I see the pods are up and I get the URL as well but when I try to hit the URL I don't get any response.
The my-service output description is as follows
Name: my-service
Namespace: default
Labels: app=hello-tomcat
Annotations: <none>
Selector: app=hello-tomcat
Type: LoadBalancer
IP: 100.64.42.168
LoadBalancer Ingress: a5c67f4526eb811e881a24e712271c17-2052164901.eu-central-1.elb.amazonaws.com
Port: <unset> 8080/TCP
TargetPort: 8080/TCP
NodePort: <unset> 31545/TCP
Endpoints: 100.96.0.14:8080
Session Affinity: None
External Traffic Policy: Cluster
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal EnsuringLoadBalancer 45s service-controller Ensuring load balancer
Normal EnsuredLoadBalancer 43s service-controller Ensured load balancer
I was expecting to see at least tomcats landing page which I get if I run this image in docker.
What am I missing?