Skip to content

Commit 41a5cd5

Browse files
chore: service type
1 parent 68088f5 commit 41a5cd5

File tree

6 files changed

+32
-2
lines changed

6 files changed

+32
-2
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{{- if contains "NodePort" .Values.service.type }}
2+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "api.fullname" . }})
3+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
4+
echo http://$NODE_IP:$NODE_PORT
5+
{{- else if contains "LoadBalancer" .Values.service.type }}
6+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
7+
You can watch the status of by running 'kubectl get svc -w {{ template "api.fullname" . }}'
8+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "api.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
9+
echo http://$SERVICE_IP:{{ .Values.service.externalPort }}
10+
{{- else if contains "ClusterIP" .Values.service.type }}
11+
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "api.name" . }},release={{ template "api.fullname" . }}" -o jsonpath="{.items[0].metadata.name}")
12+
echo "Visit http://127.0.0.1:8080 to use your application"
13+
kubectl port-forward $POD_NAME 8080:80
14+
{{- end }}

manifests/bucketeer/charts/api/templates/service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ metadata:
1515
envoy: "true"
1616
metrics: "true"
1717
spec:
18-
type: ClusterIP
18+
type: {{ .Values.service.type }}
1919
ports:
2020
- name: service
2121
port: {{ .Values.service.externalPort }}

manifests/bucketeer/charts/api/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ envoy:
6262
maxRequests: 3500
6363
maxConnections: 3500
6464
service:
65+
type: ClusterIP
6566
externalPort: 9000
6667
ingress:
6768
name: api
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{{- if contains "NodePort" .Values.service.type }}
2+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "web.fullname" . }})
3+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
4+
echo http://$NODE_IP:$NODE_PORT
5+
{{- else if contains "LoadBalancer" .Values.service.type }}
6+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
7+
You can watch the status of by running 'kubectl get svc -w {{ template "web.fullname" . }}'
8+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "web.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
9+
echo http://$SERVICE_IP:{{ .Values.service.httpPort }}
10+
{{- else if contains "ClusterIP" .Values.service.type }}
11+
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "web.name" . }},release={{ template "web.fullname" . }}" -o jsonpath="{.items[0].metadata.name}")
12+
echo "Visit http://127.0.0.1:8080 to use your application"
13+
kubectl port-forward $POD_NAME 8080:80
14+
{{- end }}

manifests/bucketeer/charts/web/templates/service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ metadata:
1515
envoy: "true"
1616
metrics: "true"
1717
spec:
18-
type: ClusterIP
18+
type: {{ .Values.service.type }}
1919
ports:
2020
- name: grpc-service
2121
port: {{ .Values.service.grpcPort }}

manifests/bucketeer/charts/web/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ envoy:
118118
adminPort: 8001
119119
resources: {}
120120
service:
121+
type: ClusterIP
121122
grpcPort: 9000
122123
httpPort: 9003
123124
health:

0 commit comments

Comments
 (0)