You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ minikube service spring-boot-service -n example-k8s --url
Access the application
$ curl http://192.168.64.2:32352/k8s/sidara
Response
HTTP/1.1 200
Content-Type: text/plain;charset=UTF-8
Content-Length: 62
Date: Sun, 01 Sep 2019 05:48:36 GMT
Hi sidara- I am a SpringBoot Application run inside Kubernetes
Delete service
$ kubectl delete service spring-boot-k8s
Create service access outside the cluster
Create create-service.yaml file
apiVersion: v1kind: Servicemetadata:
labels:
app: spring-boot-k8s-servicename: spring-boot-k8s-servicenamespace: example-k8sspec:
ports:
- nodePort: 30001# Port access outside the clusterport: 9977# Port access inside the clusterprotocol: TCPtargetPort: 9977# Port forward to inside the port which container runningselector:
app: spring-boot-k8stype: NodePort