Skip to content

Commit

Permalink
4.x: Archetype - Kubernetes uses ClusterIP instead of NodePort (#…
Browse files Browse the repository at this point in the history
…8488)

* use ClusterIP instead of node port

Signed-off-by: tvallin <[email protected]>

* update documentation

Signed-off-by: tvallin <[email protected]>

---------

Signed-off-by: tvallin <[email protected]>
  • Loading branch information
tvallin authored Mar 23, 2024
1 parent 0e5e0c9 commit 34ab56c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ metadata:
labels:
app: {{artifactId}}
spec:
type: NodePort
type: ClusterIP
selector:
app: {{artifactId}}
ports:
- port: 8080
targetPort: 8080
name: http
- name: tcp
port: 8080
protocol: TCP
targetPort: 8080
---
kind: Deployment
apiVersion: apps/v1
Expand Down
15 changes: 7 additions & 8 deletions archetypes/archetypes/src/main/archetype/common/packaging.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
</templates>
<model>
<list key="readme-sections">
<value order="50" template="mustache">
<![CDATA[
<value order="50" template="mustache"><![CDATA[
## Run the application in Kubernetes
If you don’t have access to a Kubernetes cluster, you can [install one](https://helidon.io/docs/latest/#/about/kubernetes) on your desktop.
Expand All @@ -59,20 +58,20 @@ kubectl get pods # Verify connectivity to cluster
### Deploy the application to Kubernetes
```
kubectl create -f app.yaml # Deploy application
kubectl get pods # Wait for quickstart pod to be RUNNING
kubectl get service {{artifactId}} # Get service info
kubectl create -f app.yaml # Deploy application
kubectl get pods # Wait for quickstart pod to be RUNNING
kubectl get service {{artifactId}} # Get service info
kubectl port-forward service/{{artifactId}} 8081:8080 # Forward service port to 8081
```
Note the PORTs. You can now exercise the application as you did before but use the second
port number (the NodePort) instead of 8080.
You can now exercise the application as you did before but use the port number 8081.
After you’re done, cleanup.
```
kubectl delete -f app.yaml
```
]]>
]]>
</value>
</list>
</model>
Expand Down

0 comments on commit 34ab56c

Please sign in to comment.