Skip to content
This repository was archived by the owner on Feb 22, 2022. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stable/gcloud-endpoints/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: gcloud-endpoints
version: 0.1.0
version: 0.2.0
description: Develop, deploy, protect and monitor your APIs with Google Cloud Endpoints.
keywords:
- google
Expand Down
8 changes: 4 additions & 4 deletions stable/gcloud-endpoints/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ Google's documentation: https://cloud.google.com/endpoints/docs/quickstart-compu

{{- if contains "NodePort" .Values.serviceType }}

export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fullname" . }})
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "gcloud-endpoints.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.serviceType }}

NOTE: It may take a few minutes for the LoadBalancer IP to be available.
Watch the status with: 'kubectl get svc -w {{ template "fullname" . }}'
Watch the status with: 'kubectl get svc -w {{ template "gcloud-endpoints.fullname" . }}'

export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "gcloud-endpoints.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP/
{{- else if contains "ClusterIP" .Values.serviceType }}

export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "fullname" . }}" -o jsonpath="{.items[0].metadata.name}")
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "gcloud-endpoints.fullname" . }}" -o jsonpath="{.items[0].metadata.name}")
echo http://127.0.0.1:8080/
kubectl port-forward $POD_NAME 8080:80
{{- end }}
8 changes: 4 additions & 4 deletions stable/gcloud-endpoints/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "name" -}}
{{- define "gcloud-endpoints.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 24 -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "fullname" -}}
{{- define "gcloud-endpoints.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 24 -}}
{{- end -}}

{{- define "toYaml" -}}
{{- define "gcloud-endpoints.toYaml" -}}
{{- range $key, $value := . -}}
{{- $map := kindIs "map" $value -}}
{{- if $map }}
{{ $key }}:
{{- include "toYaml" $value | indent 2 }}
{{- include "gcloud-endpoints.toYaml" $value | indent 2 }}
{{- else }}
{{ $key }}: {{ $value }}
{{- end }}
Expand Down
8 changes: 4 additions & 4 deletions stable/gcloud-endpoints/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "fullname" . }}
name: {{ template "gcloud-endpoints.fullname" . }}
labels:
app: {{ template "fullname" . }}
app: {{ template "gcloud-endpoints.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
Expand All @@ -12,7 +12,7 @@ spec:
template:
metadata:
labels:
app: {{ template "fullname" . }}
app: {{ template "gcloud-endpoints.fullname" . }}
spec:
containers:
- name: endpoints
Expand Down Expand Up @@ -80,4 +80,4 @@ spec:
timeoutSeconds: 1
{{- end }}
resources:
{{ include "toYaml" .Values.resources | indent 12 }}
{{ include "gcloud-endpoints.toYaml" .Values.resources | indent 12 }}
4 changes: 2 additions & 2 deletions stable/gcloud-endpoints/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "fullname" . }}
name: {{ template "gcloud-endpoints.fullname" . }}
spec:
ports:
{{- if (.Values.httpPort) }}
Expand All @@ -28,6 +28,6 @@ spec:
name: https
{{- end }}
selector:
app: {{ template "fullname" . }}
app: {{ template "gcloud-endpoints.fullname" . }}
type: {{ .Values.serviceType }}

20 changes: 10 additions & 10 deletions stable/gcloud-endpoints/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Google Cloud Endpoints Runtime image
## ref: https://cloud.google.com/endpoints/docs/quickstart-container-engine#deploying_the_sample_api_to_the_cluster
image: b.gcr.io/endpoints/endpoints-runtime:1
image: gcr.io/endpoints-release/endpoints-runtime:1

## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
Expand All @@ -11,18 +11,18 @@ image: b.gcr.io/endpoints/endpoints-runtime:1
## Set the application server address to which ESP proxies the requests. For
## GRPC backends, please use grpc:// prefix, e.g. grpc://localhost:8081.
## (default: localhost:8081)
##
# backend:
##
# backend:

## Set the name of the Endpoints service. If omitted and serviceConfigURL not
## specified, ESP contacts the metadata service to fetch the service name.
## (default: None)
##
# service:
##
# service:

## Specify the URL to fetch the service configuration. (default: None)
##
# serviceConfigURL:
# serviceConfigURL:

## Expose a port to accept HTTP/1.x connections. Note that if you do not
## specify httpPort, http2Port, and sslPort, then the default httpPort 8080 is
Expand All @@ -38,7 +38,7 @@ image: b.gcr.io/endpoints/endpoints-runtime:1
## Expose a port for HTTPS requests. Accepts both HTTP/1.x and HTTP/2
## connections. (default: None)
##
# sslPort:
# sslPort:

## Set the ESP status port. Status information is available at
## /endpoints_status location over HTTP/1.x. (default: 8090)
Expand All @@ -49,17 +49,17 @@ statusPort: 8090
## serviceConfigURL not specified, ESP contacts the metadata service to fetch
## the service version. (default: None)
##
# version:
# version:

## Set the service account key JSON file. Used to access the service control
## and the service management. If the option is omitted, ESP contacts the
## metadata service to fetch an access token. (default: None)
##
# serviceAccountKey:
# serviceAccountKey:

## Set a custom nginx config file. (default: None)
##
# nginxConfig:
# nginxConfig:

## Kubernetes configuration
## For minikube, set this to NodePort, elsewhere use LoadBalancer
Expand Down