-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
280 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ | ||
|
||
unittests/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: v2 | ||
name: grpc-gateway | ||
description: A Helm chart for Kubernetes | ||
|
||
# A chart can be either an 'application' or a 'library' chart. | ||
# | ||
# Application charts are a collection of templates that can be packaged into versioned archives | ||
# to be deployed. | ||
# | ||
# Library charts provide useful utilities or functions for the chart developer. They're included as | ||
# a dependency of application charts to inject those utilities and functions into the rendering | ||
# pipeline. Library charts do not define any templates and therefore cannot be deployed. | ||
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.1.0 | ||
|
||
# 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 | ||
# follow Semantic Versioning. They should reflect the version the application is using. | ||
# It is recommended to use it with quotes. | ||
appVersion: "0.1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# gRPC gateway helm chart | ||
|
||
Helm chart that deploys [grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway) to a Kubernetes cluster. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{{- define "pdb.formatValue" }} | ||
{{- $valueToFormat := . | toString }} | ||
{{- if contains "%" $valueToFormat }} | ||
{{- print $valueToFormat | quote }} | ||
{{- else }} | ||
{{- print $valueToFormat }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{.Values.name }} | ||
namespace: {{.Values.namespace | quote}} | ||
labels: | ||
app: {{.Values.name}} | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: {{.Values.name}} | ||
template: | ||
metadata: | ||
labels: | ||
app: {{.Values.name}} | ||
annotations: | ||
{{- if .Values.deployment.annotations }} | ||
{{ toYaml .Values.deployment.annotations | indent 8 }} | ||
{{ end }} | ||
spec: | ||
serviceAccountName: {{ .Values.service.serviceAccount }} | ||
{{- if .Values.spc.enabled }} | ||
volumes: | ||
- name: secrets-store-inline | ||
csi: | ||
driver: secrets-store.csi.k8s.io | ||
readOnly: true | ||
volumeAttributes: | ||
secretProviderClass: spc-{{.Values.name}} | ||
{{- end }} | ||
containers: | ||
- name: {{ .Values.name }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
{{- if .Values.deployment.resources }} | ||
resources: | ||
{{ toYaml .Values.deployment.resources | indent 12 }} | ||
{{- end }} | ||
readinessProbe: | ||
tcpSocket: | ||
port: {{.Values.http.containerPort}} | ||
initialDelaySeconds: 5 | ||
livenessProbe: | ||
tcpSocket: | ||
port: {{.Values.http.containerPort}} | ||
initialDelaySeconds: 10 | ||
ports: | ||
- name: http | ||
containerPort: {{.Values.http.containerPort}} | ||
protocol: TCP | ||
{{- if .Values.spc.enabled }} | ||
volumeMounts: | ||
- name: secrets-store-inline | ||
mountPath: {{ .Values.deployment.secretsPath }} | ||
readOnly: true | ||
{{- end }} | ||
env: | ||
- name: ENVIRONMENT | ||
value: {{.Values.environment | quote}} | ||
- name: HTTP_LISTEN_HOST | ||
value: {{.Values.http.host | quote}} | ||
- name: HTTP_LISTEN_PORT | ||
value: {{.Values.http.port | quote}} | ||
- name: GRPC_LISTEN_HOST | ||
value: {{.Values.grpc.host | quote}} | ||
- name: GRPC_LISTEN_PORT | ||
value: {{.Values.grpc.port | quote}} | ||
{{- if .Values.deployment.env }} | ||
{{ toYaml .Values.deployment.env | indent 12 }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{{- if .Values.hpa.enabled }} | ||
apiVersion: {{ ternary "autoscaling/v2" "autoscaling/v2beta2" (semverCompare ">=1.23" .Capabilities.KubeVersion.Version) }} | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: {{ .Values.name }} | ||
namespace: {{ .Values.namespace }} | ||
labels: | ||
app: {{.Values.name}} | ||
spec: | ||
maxReplicas: {{ .Values.hpa.maxReplicas }} | ||
metrics: | ||
{{- range $index, $val := .Values.hpa.metrics }} | ||
- resource: | ||
name: {{ $val.name }} | ||
target: | ||
averageUtilization: {{ $val.target.averageUtilization }} | ||
type: {{ $val.target.type }} | ||
type: {{ $val.type }} | ||
{{- end }} | ||
minReplicas: {{ .Values.hpa.minReplicas }} | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: {{ .Values.name }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
apiVersion: {{ ternary "policy/v1" "policy/v1beta1" (semverCompare ">=1.9" .Capabilities.KubeVersion.Version) }} | ||
kind: PodDisruptionBudget | ||
metadata: | ||
name: {{.Values.name }} | ||
namespace: {{ .Values.namespace | quote }} | ||
spec: | ||
{{- if and (.Values.pdb.enabled) (.Values.hpa.enabled) (gt .Values.hpa.minReplicas 1.0) (gt .Values.hpa.maxReplicas 1.0) }} | ||
{{- if .Values.pdb.maxUnavailable }} | ||
{{- $formattedValue := include "pdb.formatValue" .Values.pdb.maxUnavailable }} | ||
maxUnavailable: {{ $formattedValue }} | ||
{{- end }} | ||
{{- if .Values.pdb.minAvailable }} | ||
{{- $formattedValue := include "pdb.formatValue" .Values.pdb.minAvailable }} | ||
minAvailable: {{ $formattedValue }} | ||
{{- end }} | ||
{{- else }} | ||
minAvailable: 0 | ||
{{- end }} | ||
selector: | ||
matchLabels: | ||
app: {{ .Values.name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ .Values.name }}-internal-server | ||
namespace: {{ .Values.namespace | quote }} | ||
spec: | ||
selector: | ||
app: {{ .Values.name }} | ||
type: ClusterIP | ||
ports: | ||
- name: http | ||
protocol: TCP | ||
port: {{.Values.http.port}} | ||
targetPort: http |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{{- if .Values.spc.enabled }} | ||
apiVersion: secrets-store.csi.x-k8s.io/v1alpha1 | ||
kind: SecretProviderClass | ||
metadata: | ||
name: spc-{{ .Values.name }} | ||
namespace: {{ .Values.namespace }} | ||
spec: | ||
provider: aws | ||
{{- if .Values.spc.secretObjects }} | ||
secretObjects: {{ .Values.spc.secretObjects }} | ||
{{- end }} | ||
{{- if .Values.spc.parameters }} | ||
parameters: {{ .Values.spc.parameters }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{{- if .Values.virtualService.enabled }} | ||
apiVersion: networking.istio.io/v1alpha3 | ||
kind: VirtualService | ||
metadata: | ||
name: {{ .Values.name }} | ||
namespace: {{ .Values.virtualService.namespace }} | ||
spec: | ||
hosts: | ||
- {{ .Values.host }} | ||
gateways: | ||
- {{ .Values.gateway }} | ||
http: | ||
{{- range $key, $value := .Values.http.routes }} | ||
- route: | ||
- destination: | ||
port: | ||
number: {{ $.Values.http.port }} | ||
host: {{ $.Values.name }}-internal-server.{{ $.Values.namespace }}.svc.cluster.local | ||
match: | ||
{{- range $value.matchPrefix }} | ||
- uri: | ||
prefix: {{ . | quote }} | ||
{{- end }} | ||
{{- if $value.timeout }} | ||
timeout: {{ $value.timeout }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: | ||
namespace: | ||
environment: | ||
host: | ||
gateway: | ||
service: | ||
serviceAccount: | ||
virtualService: | ||
enabled: false | ||
namespace: "default" | ||
deployment: | ||
annotations: {} | ||
resources: {} | ||
secretsPath: "/mnt/secrets-store" | ||
env: {} | ||
spc: | ||
enabled: false | ||
secretObjects: | ||
parameters: | ||
image: | ||
repository: | ||
pullPolicy: IfNotPresent | ||
grpc: | ||
host: | ||
port: | ||
http: | ||
host: # if not empty only specified domain will be proxied | ||
port: | ||
containerPort: | ||
routes: | ||
- timeout: | ||
matchPrefix: | ||
- "/" | ||
hpa: | ||
enabled: false | ||
minReplicas: 1 | ||
maxReplicas: 2 | ||
metrics: | ||
- name: memory | ||
type: Resource | ||
target: | ||
averageUtilization: 60 | ||
type: Utilization | ||
pdb: | ||
enabled: false | ||
minAvailable: | ||
maxUnavailable: |