Skip to content

Commit ea85663

Browse files
committed
added samples of different service types, ExternalName coming next
1 parent 9eef078 commit ea85663

File tree

1 file changed

+46
-7
lines changed

1 file changed

+46
-7
lines changed

readme.adoc

+46-7
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,19 @@ Session Affinity: None
8181
Events: <none>
8282
```
8383
+
84+
.. Service is accessible only inside the cluster.
8485
.. Delete service: `kubectl delete -f lb-clusterip.yml`
85-
+
86-
. *NodePort*: Expose service on each node of the cluster at a static port. Service is accessible using `<NodeIP>:<NodePort>`.
86+
. *NodePort*: Expose service on each node of the cluster at a static port.
8787
.. Create service: `kubectl create -f lb-nodeport.yml`
8888
.. Get service: `kubectl get svc`
8989
+
9090
```
9191
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
92-
kubernetes 100.64.0.1 <none> 443/TCP 1h
93-
wildfly-service 100.67.218.58 <nodes> 8080:30001/TCP 16s
92+
kubernetes 100.64.0.1 <none> 443/TCP 2h
93+
wildfly-service 100.68.222.70 <nodes> 8080:32233/TCP 29m
9494
```
9595
+
96+
Service is accessible using `<NodeIP>:<NodePort>`. `<NodePort>` for us is `32233`.
9697
.. Describe service: `kubectl describe svc wildfly-service`
9798
+
9899
```
@@ -102,14 +103,52 @@ Labels: <none>
102103
Annotations: <none>
103104
Selector: app=wildfly-rc-pod
104105
Type: NodePort
105-
IP: 100.67.218.58
106+
IP: 100.68.222.70
106107
Port: web 8080/TCP
107-
NodePort: web 30001/TCP
108-
Endpoints: 100.96.1.7:8080,100.96.2.6:8080
108+
NodePort: web 32233/TCP
109+
Endpoints: 100.96.1.13:8080,100.96.2.12:8080
109110
Session Affinity: None
110111
Events: <none>
111112
```
113+
+
114+
.. Access Service
115+
... Configure the worker node firewall to create a `Custom TCP Rule` to allow port `32233` accessible from `Anywhere`.
116+
... Find IP address of the worker nodes using AWS Console.
117+
... Service is accessible at `<worker-node-ip>:32233`.
118+
.. Delete the service: `kubectl delete -f lb-nodeport.yml`
112119
. *LoadBalancer*: Expose the service using a cloud provider's load balancer.
120+
.. Create service: `kubectl create -f lb-loadbalancer.yml`
121+
.. Get service: `kubectl get svc`
122+
+
123+
```
124+
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
125+
kubernetes 100.64.0.1 <none> 443/TCP 2h
126+
wildfly-service 100.65.225.120 afa8056b14fc9... 8080:30229/TCP 4s
127+
```
128+
+
129+
.. Describe service:
130+
+
131+
```
132+
Name: wildfly-service
133+
Namespace: default
134+
Labels: <none>
135+
Annotations: <none>
136+
Selector: app=wildfly-rc-pod
137+
Type: LoadBalancer
138+
IP: 100.65.225.120
139+
LoadBalancer Ingress: afa8056b14fc911e79b1906d8a9d4b8c-1413998286.us-west-2.elb.amazonaws.com
140+
Port: web 8080/TCP
141+
NodePort: web 30229/TCP
142+
Endpoints: 100.96.1.14:8080,100.96.2.13:8080
143+
Session Affinity: None
144+
Events:
145+
FirstSeen LastSeen Count From SubObjectPath Type Reason Message
146+
--------- -------- ----- ---- ------------- -------- ------ -------
147+
11s 11s 1 service-controller Normal CreatingLoadBalancer Creating load balancer
148+
8s 8s 1 service-controller Normal CreatedLoadBalancer Created load balancer
149+
```
150+
.. Service is accessible at `<LoadBalancer-Ingress>:8080`. Wait for 3 mins for the load balancer to settle before accessing this URL.
151+
.. Delete service: `kubectl delete -f lb-loadbalancer.yml`
113152
. *ExternalName*: Maps the service to the contents of the external name., buy returning a `CNAME` record with its value.
114153

115154
== Using Maven (Service + Replication Controller + Client Pod)

0 commit comments

Comments
 (0)