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
or you can pull any other public image as pull doesn't require credentials for public images.
@@ -963,22 +969,75 @@ Further Reading:
963
969
964
970
#### 7.1 Kubernetes
965
971
966
-
**Updating instructions WIP**
972
+
Before executing below commands ensure the kubernetes cluster (Rancher, Minikube, Cloud Cluster etc) is running and kubectl CLI is able to connect.
967
973
968
-
- Standard App Deployment
974
+
> If you have your own image built and pushed to DockerHub.</br>
975
+
Then open the [kubernetes/std/deployement.yaml](./kubernetes/std/deployement.yaml) and replace "image: abhisheksr01/companieshouse:latest" at Line 17 with your DOCKERHUB_USERNAME and imagename:tag
969
976
970
-
Source files at :
977
+
For this exercise we are deploying the application on `default` namespace if you wish to change the namespace then apped `-n [NAMESPACE]` to each command executed below.
978
+
979
+
- Application Deployment through Kubernetes yaml config file.
980
+
981
+
```bash
982
+
kubectl apply -f kubernetes/std/
983
+
```
984
+
The `Ingress` will fail if you do not have it configured (which is fine for this exercise).
985
+
986
+
Check if the pod is running and status is `Running`. Capture the name of the pod.
987
+
988
+
```bash
989
+
kubectl get pods
990
+
```
991
+
992
+
Check if the service is also running.
993
+
994
+
```bash
995
+
kubectl get service
996
+
```
997
+
998
+
Expose the Service through port-forward to access the application locally.
999
+
1000
+
```bash
1001
+
kubectl port-forward [POD-NAME] 8080:8080
1002
+
```
1003
+
1004
+
or use below command to port-forward with dynamic retrieval of the pod name.
971
1005
972
1006
```bash
973
-
kubernetes/std/
1007
+
kubectl port-forward $(kubectl get pod -l app=companies-house-microservice -o jsonpath="{.items[0].metadata.name}") 8080:8080
1008
+
```
1009
+
1010
+
You should see an terminal log as below:
1011
+
```
1012
+
Forwarding from 127.0.0.1:8080 -> 8080
1013
+
Forwarding from [::1]:8080 -> 8080
974
1014
```
975
1015
1016
+
Open a web browser and open the URL: http://localhost:8080/companieshouse/swagger-ui/index.html to access the swagger UI exposed by this service.
1017
+
1018
+
Terminate the terminal to end the port forwarding and execute below command to remove the application deployment.
0 commit comments