@@ -81,18 +81,19 @@ Session Affinity: None
81
81
Events: <none>
82
82
```
83
83
+
84
+ .. Service is accessible only inside the cluster.
84
85
.. 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.
87
87
.. Create service: `kubectl create -f lb-nodeport.yml`
88
88
.. Get service: `kubectl get svc`
89
89
+
90
90
```
91
91
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
94
94
```
95
95
+
96
+ Service is accessible using `<NodeIP>:<NodePort>`. `<NodePort>` for us is `32233`.
96
97
.. Describe service: `kubectl describe svc wildfly-service`
97
98
+
98
99
```
@@ -102,14 +103,52 @@ Labels: <none>
102
103
Annotations: <none>
103
104
Selector: app=wildfly-rc-pod
104
105
Type: NodePort
105
- IP: 100.67.218.58
106
+ IP: 100.68.222.70
106
107
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
109
110
Session Affinity: None
110
111
Events: <none>
111
112
```
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`
112
119
. *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`
113
152
. *ExternalName*: Maps the service to the contents of the external name., buy returning a `CNAME` record with its value.
114
153
115
154
== Using Maven (Service + Replication Controller + Client Pod)
0 commit comments