Skip to content

Commit

Permalink
Merge pull request #91 from qpoint-io/marc-barry/update-notes
Browse files Browse the repository at this point in the history
Update the NOTES.txt for qpoint-proxy.
  • Loading branch information
marc-barry authored Jun 18, 2024
2 parents ed20f2e + 95883cf commit 54885ae
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 18 deletions.
2 changes: 1 addition & 1 deletion charts/qpoint-proxy/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.3
version: 0.0.4

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
2 changes: 1 addition & 1 deletion charts/qpoint-proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The Qpoint Proxy can operate in two modes:

```sh
kubectl --namespace qpoint create secret generic token --from-literal=token="<TOKEN>"
helm install qpoint-gateway . --namespace qpoint --create-namespace --wait --timeout 20s
helm install qpoint-proxy . --namespace qpoint --create-namespace --wait --timeout 20s
```

2. Standalone mode. For this mode it depends on a config map named `config` with the file contents of a valid YAML configuration file format.
Expand Down
77 changes: 62 additions & 15 deletions charts/qpoint-proxy/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,63 @@
1. Get the application URL by running these commands:
{{- if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "qpoint.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "qpoint.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "qpoint.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "qpoint.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
- Confirm the service endpoints by running these commands:

{{- if eq .Values.service.type "NodePort" }}

echo "Waiting for the NodePort service to be available..."
wait_for_nodeport() {
local ready=true
{{- range .Values.service.ports }}
local node_port=$(kubectl get --namespace {{ $.Release.Namespace }} -o jsonpath="{.spec.ports[?(@.name=='{{ .name }}')].nodePort}" services {{ include "qpoint.fullname" $ }})
if [ -z "$node_port" ]; then
echo "waiting for service to be available..."
ready=false
else
for node_ip in $(kubectl get nodes --namespace {{ $.Release.Namespace }} -o jsonpath="{.items[*].status.addresses[?(@.type=='InternalIP')].address}"); do
echo "$node_ip:$node_port for {{ .name }} ({{ .description }})"
done
fi
{{- end }}
if [ "$ready" = true ]; then
return 0
else
return 1
fi
}
until wait_for_nodeport; do sleep 1; done

{{- else if eq .Values.service.type "LoadBalancer" }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.

echo "Waiting for the LoadBalancer IP to be available..."
wait_for_loadbalancer() {
local service_ip=$(kubectl get services --namespace {{ $.Release.Namespace }} {{ include "qpoint.fullname" $ }} -o jsonpath="{.status.loadBalancer.ingress[0].ip}")
if [ -z "$service_ip" ]; then
echo "waiting for service to be available..."
return 1
else
{{- range .Values.service.ports }}
echo "$service_ip:{{ .port }} for {{ .name }} ({{ .description }})"
{{- end }}
return 0
fi
}
until wait_for_loadbalancer; do sleep 1; done

{{- else if eq .Values.service.type "ClusterIP" }}

echo "Waiting for the ClusterIP service to be available..."
wait_for_clusterip() {
local cluster_ip=$(kubectl get services --namespace {{ $.Release.Namespace }} {{ include "qpoint.fullname" $ }} -o jsonpath="{.spec.clusterIP}")
if [ -z "$cluster_ip" ]; then
echo "waiting for service to be available..."
return 1
else
{{- range .Values.service.ports }}
echo "$cluster_ip:{{ .port }} for {{ .name }} ({{ .description }})"
{{- end }}
echo "DNS: {{ include "qpoint.fullname" $ }}.{{ $.Release.Namespace }}.svc.cluster.local"
return 0
fi
}
until wait_for_clusterip; do sleep 1; done

{{- end }}
6 changes: 5 additions & 1 deletion charts/qpoint-proxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,28 @@ middlewareTCPForwardPorts: "18080:80,18443:443"
transparentTCPForwardPorts: "10080:80,10443:443"

service:
type: ClusterIP
type: LoadBalancer
ports:
- port: 10080
containerPort: 10080
protocol: TCP
name: e-http-tr
description: "Egress HTTP, transparent proxy"
- port: 10443
containerPort: 10443
protocol: TCP
name: e-https-tr
description: "Egress HTTPS, transparent proxy"
- port: 18080
containerPort: 18080
protocol: TCP
name: e-http-mi
description: "Egress HTTP, middleware proxy"
- port: 18443
containerPort: 18443
protocol: TCP
name: e-https-mi
description: "Egress HTTPS, middleware proxy"

status:
addr: 0.0.0.0
Expand Down

0 comments on commit 54885ae

Please sign in to comment.