Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
23adcf6472
|
|||
f6b709fba1
|
|||
2324e7d6e2
|
|||
2f2043e915
|
|||
a801fd1480
|
|||
8ac94f8f60
|
49
.drone.yml
49
.drone.yml
@ -1,49 +0,0 @@
|
|||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: default
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- tag
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: lint
|
|
||||||
image: cr.grachevko.ru/docker.io/alpine/helm:latest
|
|
||||||
pull: always
|
|
||||||
commands:
|
|
||||||
- helm lint .
|
|
||||||
|
|
||||||
- name: version
|
|
||||||
image: cr.grachevko.ru/docker.io/mikefarah/yq:latest
|
|
||||||
pull: always
|
|
||||||
user: root
|
|
||||||
commands:
|
|
||||||
- yq -i '.version = "'$DRONE_TAG'"' Chart.yaml
|
|
||||||
- cat Chart.yaml
|
|
||||||
depends_on:
|
|
||||||
- lint
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
|
|
||||||
- name: release
|
|
||||||
image: cr.grachevko.ru/docker.io/alpine/helm:latest
|
|
||||||
pull: always
|
|
||||||
commands:
|
|
||||||
- helm dependency build
|
|
||||||
- helm plugin install https://github.com/chartmuseum/helm-push
|
|
||||||
- helm repo add hasura $HELM_REPO --username $HELM_REPO_USERNAME --password $HELM_REPO_PASSWORD
|
|
||||||
- helm cm-push . $HELM_REPO
|
|
||||||
environment:
|
|
||||||
HELM_REPO: https://harbor.grachevko.ru/chartrepo/hasura
|
|
||||||
HELM_REPO_USERNAME:
|
|
||||||
from_secret: HELM_REPO_USERNAME
|
|
||||||
HELM_REPO_PASSWORD:
|
|
||||||
from_secret: HELM_REPO_PASSWORD
|
|
||||||
depends_on:
|
|
||||||
- version
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- tag
|
|
29
.gitea/workflows/release.yaml
Normal file
29
.gitea/workflows/release.yaml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
name: Release Chart
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: harbor.grachevko.ru
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: yokawasa/action-setup-kube-tools@v0.9.3
|
||||||
|
with:
|
||||||
|
setup-tools: helm
|
||||||
|
- name: deps and lint
|
||||||
|
run: |
|
||||||
|
helm dependency update
|
||||||
|
helm lint --strict .
|
||||||
|
- name: build
|
||||||
|
run: helm package --version ${{ gitea.ref_name }} .
|
||||||
|
- name: publish
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.REGISTRY_PASSWORD }}" | helm registry login ${{ env.REGISTRY }} --username "${{ secrets.REGISTRY_USERNAME }}" --password-stdin
|
||||||
|
helm push ./*.tgz oci://harbor.grachevko.ru/${{ gitea.repository }}
|
@ -3,10 +3,10 @@ name: hasura
|
|||||||
description: A Helm chart for Kubernetes
|
description: A Helm chart for Kubernetes
|
||||||
type: application
|
type: application
|
||||||
version: 0.2.6
|
version: 0.2.6
|
||||||
appVersion: v2.16.0
|
appVersion: 2.33.0
|
||||||
icon: https://raw.githubusercontent.com/hasura/graphql-engine/master/assets/brand/powered_by_hasura_primary_lightbg.svg
|
icon: https://raw.githubusercontent.com/hasura/graphql-engine/master/assets/brand/powered_by_hasura_primary_lightbg.svg
|
||||||
maintainers:
|
maintainers:
|
||||||
- email: me@grachevko.ru
|
- email: me@grachevko.ru
|
||||||
name: Konstantin Grachev
|
name: Konstantin Grachev
|
||||||
sources:
|
sources:
|
||||||
- https://git.grachevko.ru/hasura/chart
|
- https://git.grachevko.ru/hasura/chart
|
||||||
|
@ -60,3 +60,12 @@ Create the name of the service account to use
|
|||||||
{{- default "default" .Values.serviceAccount.name }}
|
{{- default "default" .Values.serviceAccount.name }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
{{- define "hasura.image" -}}
|
||||||
|
{{- .Values.image.registry }}/{{ .Values.image.repository }}:
|
||||||
|
{{- if .Values.image.tag }}
|
||||||
|
{{- .Values.image.tag -}}
|
||||||
|
{{- else -}}
|
||||||
|
v{{ .Chart.AppVersion }}.cli-migrations-v3
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
@ -28,29 +28,29 @@ spec:
|
|||||||
securityContext:
|
securityContext:
|
||||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- name: {{ .Chart.Name }}
|
||||||
securityContext:
|
securityContext:
|
||||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||||
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
image: {{ include "hasura.image" . }}
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
envFrom:
|
envFrom:
|
||||||
{{- if .Values.extraEnvVarsSecret }}
|
{{- if .Values.extraEnvVarsSecret }}
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: {{ .Values.extraEnvVarsSecret }}
|
name: {{ .Values.extraEnvVarsSecret }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
containerPort: 8080
|
containerPort: 8080
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /healthz
|
path: /healthz
|
||||||
port: http
|
port: http
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /healthz
|
path: /healthz
|
||||||
port: http
|
port: http
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.resources | nindent 12 }}
|
{{- toYaml .Values.resources | nindent 12 }}
|
||||||
{{- with .Values.nodeSelector }}
|
{{- with .Values.nodeSelector }}
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
|
@ -14,15 +14,15 @@ spec:
|
|||||||
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
|
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
|
||||||
metrics:
|
metrics:
|
||||||
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
|
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
|
||||||
- type: Resource
|
- type: Resource
|
||||||
resource:
|
resource:
|
||||||
name: cpu
|
name: cpu
|
||||||
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
|
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
||||||
- type: Resource
|
- type: Resource
|
||||||
resource:
|
resource:
|
||||||
name: memory
|
name: memory
|
||||||
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -29,30 +29,30 @@ spec:
|
|||||||
{{- if .Values.ingress.tls }}
|
{{- if .Values.ingress.tls }}
|
||||||
tls:
|
tls:
|
||||||
{{- range .Values.ingress.tls }}
|
{{- range .Values.ingress.tls }}
|
||||||
- hosts:
|
- hosts:
|
||||||
{{- range .hosts }}
|
{{- range .hosts }}
|
||||||
- {{ . | quote }}
|
- {{ . | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
secretName: {{ .secretName }}
|
secretName: {{ .secretName }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
rules:
|
rules:
|
||||||
{{- range .Values.ingress.hosts }}
|
{{- range .Values.ingress.hosts }}
|
||||||
- host: {{ .host | quote }}
|
- host: {{ .host | quote }}
|
||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
{{- range .paths }}
|
{{- range .paths }}
|
||||||
- path: {{ .path }}
|
- path: {{ .path }}
|
||||||
pathType: {{ default "ImplementationSpecific" .pathType }}
|
pathType: {{ default "ImplementationSpecific" .pathType }}
|
||||||
backend:
|
backend:
|
||||||
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||||
service:
|
service:
|
||||||
name: {{ $fullName }}
|
name: {{ $fullName }}
|
||||||
port:
|
port:
|
||||||
number: {{ $svcPort }}
|
number: {{ $svcPort }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
serviceName: {{ $fullName }}
|
serviceName: {{ $fullName }}
|
||||||
servicePort: {{ $svcPort }}
|
servicePort: {{ $svcPort }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -22,32 +22,32 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
volumes:
|
volumes:
|
||||||
- name: data
|
- name: data
|
||||||
emptyDir: { }
|
emptyDir: {}
|
||||||
initContainers:
|
initContainers:
|
||||||
- name: copy
|
- name: copy
|
||||||
image: "{{ .Values.migrations.image.registry }}/{{ .Values.migrations.image.repository }}:{{ .Values.migrations.image.tag | default "latest" }}"
|
image: "{{ .Values.migrations.image.registry }}/{{ .Values.migrations.image.repository }}:{{ .Values.migrations.image.tag | default "latest" }}"
|
||||||
command: ["/bin/sh", "-c", "cp -R /{{ .Values.migrations.image.path }}/* /shared-data/"]
|
command: ["/bin/sh", "-c", "cp -R /{{ .Values.migrations.image.path }}/* /shared-data/"]
|
||||||
workingDir: /data
|
workingDir: /data
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: data
|
- name: data
|
||||||
mountPath: /shared-data
|
mountPath: /shared-data
|
||||||
containers:
|
containers:
|
||||||
- name: migrate
|
- name: migrate
|
||||||
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
image: {{ include "hasura.image" . }}
|
||||||
command: [ "/bin/sh", "-c" ]
|
command: ["/bin/sh", "-c"]
|
||||||
args:
|
args:
|
||||||
- hasura-cli deploy
|
- hasura-cli deploy
|
||||||
workingDir: /data
|
workingDir: /data
|
||||||
env:
|
env:
|
||||||
- name: HASURA_GRAPHQL_ENDPOINT
|
- name: HASURA_GRAPHQL_ENDPOINT
|
||||||
value: "http://{{ include "hasura.fullname" . }}"
|
value: "http://{{ include "hasura.fullname" . }}"
|
||||||
envFrom:
|
envFrom:
|
||||||
{{- if .Values.extraEnvVarsSecret }}
|
{{- if .Values.extraEnvVarsSecret }}
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: {{ .Values.extraEnvVarsSecret }}
|
name: {{ .Values.extraEnvVarsSecret }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: data
|
- name: data
|
||||||
mountPath: /data
|
mountPath: /data
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -7,9 +7,9 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
type: {{ .Values.service.type }}
|
type: {{ .Values.service.type }}
|
||||||
ports:
|
ports:
|
||||||
- port: {{ .Values.service.port }}
|
- port: {{ .Values.service.port }}
|
||||||
targetPort: http
|
targetPort: http
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
name: http
|
name: http
|
||||||
selector:
|
selector:
|
||||||
{{- include "hasura.selectorLabels" . | nindent 4 }}
|
{{- include "hasura.selectorLabels" . | nindent 4 }}
|
||||||
|
@ -8,8 +8,8 @@ metadata:
|
|||||||
"helm.sh/hook": test
|
"helm.sh/hook": test
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: wget
|
- name: wget
|
||||||
image: busybox
|
image: busybox
|
||||||
command: [ 'wget' ]
|
command: ['wget']
|
||||||
args: [ '{{ include "hasura.fullname" . }}:{{ .Values.service.port }}' ]
|
args: ['{{ include "hasura.fullname" . }}:{{ .Values.service.port }}']
|
||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
|
40
values.yaml
40
values.yaml
@ -9,8 +9,8 @@ image:
|
|||||||
repository: hasura/graphql-engine
|
repository: hasura/graphql-engine
|
||||||
pullPolicy: IfNotPresent
|
pullPolicy: IfNotPresent
|
||||||
# Overrides the image tag whose default is the chart appVersion.
|
# Overrides the image tag whose default is the chart appVersion.
|
||||||
tag: v2.15.0.cli-migrations-v3
|
tag: ""
|
||||||
pullSecrets: [ ]
|
pullSecrets: []
|
||||||
|
|
||||||
extraEnvVarsSecret: ""
|
extraEnvVarsSecret: ""
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ migrations:
|
|||||||
registry: *registry
|
registry: *registry
|
||||||
repository: ""
|
repository: ""
|
||||||
tag: ""
|
tag: ""
|
||||||
pullSecrets: [ ]
|
pullSecrets: []
|
||||||
path: /data
|
path: /data
|
||||||
|
|
||||||
nameOverride: ""
|
nameOverride: ""
|
||||||
@ -30,22 +30,22 @@ serviceAccount:
|
|||||||
# Specifies whether a service account should be created
|
# Specifies whether a service account should be created
|
||||||
create: false
|
create: false
|
||||||
# Annotations to add to the service account
|
# Annotations to add to the service account
|
||||||
annotations: { }
|
annotations: {}
|
||||||
# The name of the service account to use.
|
# The name of the service account to use.
|
||||||
# If not set and create is true, a name is generated using the fullname template
|
# If not set and create is true, a name is generated using the fullname template
|
||||||
name: ""
|
name: ""
|
||||||
|
|
||||||
podAnnotations: { }
|
podAnnotations: {}
|
||||||
|
|
||||||
podSecurityContext: { }
|
podSecurityContext: {}
|
||||||
# fsGroup: 2000
|
# fsGroup: 2000
|
||||||
|
|
||||||
securityContext: { }
|
securityContext: {}
|
||||||
# capabilities:
|
# capabilities:
|
||||||
# drop:
|
# drop:
|
||||||
# - ALL
|
# - ALL
|
||||||
# readOnlyRootFilesystem: true
|
# readOnlyRootFilesystem: true
|
||||||
# runAsNonRoot: true
|
# runAsNonRoot: true
|
||||||
# runAsUser: 1000
|
# runAsUser: 1000
|
||||||
|
|
||||||
service:
|
service:
|
||||||
@ -55,20 +55,20 @@ service:
|
|||||||
ingress:
|
ingress:
|
||||||
enabled: false
|
enabled: false
|
||||||
className: ""
|
className: ""
|
||||||
annotations: { }
|
annotations: {}
|
||||||
# kubernetes.io/ingress.class: nginx
|
# kubernetes.io/ingress.class: nginx
|
||||||
# kubernetes.io/tls-acme: "true"
|
# kubernetes.io/tls-acme: "true"
|
||||||
hosts:
|
hosts:
|
||||||
- host: chart-example.local
|
- host: chart-example.local
|
||||||
paths:
|
paths:
|
||||||
- path: /
|
- path: /
|
||||||
pathType: ImplementationSpecific
|
pathType: ImplementationSpecific
|
||||||
tls: [ ]
|
tls: []
|
||||||
# - secretName: chart-example-tls
|
# - secretName: chart-example-tls
|
||||||
# hosts:
|
# hosts:
|
||||||
# - chart-example.local
|
# - chart-example.local
|
||||||
|
|
||||||
resources: { }
|
resources: {}
|
||||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||||
# choice for the user. This also increases chances charts run on environments with little
|
# choice for the user. This also increases chances charts run on environments with little
|
||||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||||
@ -77,7 +77,7 @@ resources: { }
|
|||||||
# cpu: 100m
|
# cpu: 100m
|
||||||
# memory: 128Mi
|
# memory: 128Mi
|
||||||
# requests:
|
# requests:
|
||||||
# cpu: 100m
|
# cpu: 100m
|
||||||
# memory: 128Mi
|
# memory: 128Mi
|
||||||
|
|
||||||
autoscaling:
|
autoscaling:
|
||||||
@ -87,8 +87,8 @@ autoscaling:
|
|||||||
targetCPUUtilizationPercentage: 80
|
targetCPUUtilizationPercentage: 80
|
||||||
# targetMemoryUtilizationPercentage: 80
|
# targetMemoryUtilizationPercentage: 80
|
||||||
|
|
||||||
nodeSelector: { }
|
nodeSelector: {}
|
||||||
|
|
||||||
tolerations: [ ]
|
tolerations: []
|
||||||
|
|
||||||
affinity: { }
|
affinity: {}
|
||||||
|
Reference in New Issue
Block a user