This commit is contained in:
24
.drone.yml
24
.drone.yml
@ -5,17 +5,17 @@ name: default
|
|||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: release
|
- name: release
|
||||||
image: cr.grachevko.ru/drone/helm:RELEASE.2023-03-01T13-46-55Z
|
image: cr.grachevko.ru/drone/helm:RELEASE.2023-03-01T13-46-55Z
|
||||||
settings:
|
settings:
|
||||||
username:
|
username:
|
||||||
from_secret: HELM_REPO_USERNAME
|
from_secret: HELM_REPO_USERNAME
|
||||||
password:
|
password:
|
||||||
from_secret: HELM_REPO_PASSWORD
|
from_secret: HELM_REPO_PASSWORD
|
||||||
when:
|
when:
|
||||||
branch:
|
branch:
|
||||||
- master
|
- master
|
||||||
- rc
|
- rc
|
||||||
|
54
.github/workflows/main.yaml
vendored
54
.github/workflows/main.yaml
vendored
@ -1,6 +1,6 @@
|
|||||||
name: Build
|
name: Build
|
||||||
|
|
||||||
on: [push]
|
on: [ push ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
@ -8,15 +8,15 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Install Helm
|
- name: Install Helm
|
||||||
run: |
|
run: |
|
||||||
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
|
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
|
||||||
helm plugin install https://github.com/hayorov/helm-gcs
|
helm plugin install https://github.com/hayorov/helm-gcs
|
||||||
- name: Lint chart
|
- name: Lint chart
|
||||||
run: |
|
run: |
|
||||||
helm lint .
|
helm lint .
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: lint
|
needs: lint
|
||||||
@ -24,22 +24,22 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Install Helm
|
- name: Install Helm
|
||||||
run: |
|
run: |
|
||||||
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
|
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
|
||||||
helm plugin install https://github.com/hayorov/helm-gcs
|
helm plugin install https://github.com/hayorov/helm-gcs
|
||||||
- name: Dump GCloud auth key
|
- name: Dump GCloud auth key
|
||||||
run: |
|
run: |
|
||||||
cat <<'EOF' > gcloud_auth_key.json
|
cat <<'EOF' > gcloud_auth_key.json
|
||||||
${{ secrets.GCLOUD_AUTH_KEY }}
|
${{ secrets.GCLOUD_AUTH_KEY }}
|
||||||
EOF
|
EOF
|
||||||
- name: Release chart
|
- name: Release chart
|
||||||
env:
|
env:
|
||||||
GOOGLE_APPLICATION_CREDENTIALS: ${{ github.workspace }}/gcloud_auth_key.json
|
GOOGLE_APPLICATION_CREDENTIALS: ${{ github.workspace }}/gcloud_auth_key.json
|
||||||
run: |
|
run: |
|
||||||
helm repo add hahow gs://hahow-helm-charts
|
helm repo add hahow gs://hahow-helm-charts
|
||||||
helm repo update
|
helm repo update
|
||||||
PACKAGE_FILE_PATH=$(helm package . | sed 's/^Successfully packaged chart and saved it to: //')
|
PACKAGE_FILE_PATH=$(helm package . | sed 's/^Successfully packaged chart and saved it to: //')
|
||||||
helm gcs push $(basename ${PACKAGE_FILE_PATH}) hahow --public
|
helm gcs push $(basename ${PACKAGE_FILE_PATH}) hahow --public
|
||||||
|
12
README.md
12
README.md
@ -19,7 +19,8 @@ dependencies:
|
|||||||
repository: https://harbor.grachevko.ru/chartrepo/helm
|
repository: https://harbor.grachevko.ru/chartrepo/helm
|
||||||
```
|
```
|
||||||
|
|
||||||
Once you have defined dependencies, you should run the following command to download this chart into your `charts/` directory:
|
Once you have defined dependencies, you should run the following command to download this chart into your `charts/`
|
||||||
|
directory:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ helm dep build
|
$ helm dep build
|
||||||
@ -61,13 +62,15 @@ helm.sh/chart: foo-1.2.3-beta.55_1234
|
|||||||
|
|
||||||
### `common.fullname`
|
### `common.fullname`
|
||||||
|
|
||||||
The `common.fullname` template generates a name suitable for the `name:` field in Kubernetes metadata. It is used like this:
|
The `common.fullname` template generates a name suitable for the `name:` field in Kubernetes metadata. It is used like
|
||||||
|
this:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
name: { { include "common.fullname" . } }
|
name: { { include "common.fullname" . } }
|
||||||
```
|
```
|
||||||
|
|
||||||
This prints the value of `{{ .Release.Name }}-{{ .Chart.Name }}` by default, but can be overridden with `.Values. fullnameOverride`:
|
This prints the value of `{{ .Release.Name }}-{{ .Chart.Name }}` by default, but can be overridden
|
||||||
|
with `.Values. fullnameOverride`:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
fullnameOverride: some-name
|
fullnameOverride: some-name
|
||||||
@ -142,7 +145,8 @@ metadata:
|
|||||||
name: release-name-mychart
|
name: release-name-mychart
|
||||||
```
|
```
|
||||||
|
|
||||||
Most of the common templates that define a resource type (e.g. `common.configMap` or `common.cronJob`) use this to generate the metadata, which means they inherit the same `labels` and `name` fields.
|
Most of the common templates that define a resource type (e.g. `common.configMap` or `common.cronJob`) use this to
|
||||||
|
generate the metadata, which means they inherit the same `labels` and `name` fields.
|
||||||
|
|
||||||
### `common.name`
|
### `common.name`
|
||||||
|
|
||||||
|
@ -31,40 +31,40 @@ 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: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
envFrom:
|
envFrom:
|
||||||
- configMapRef:
|
- configMapRef:
|
||||||
name: {{ include "common.fullname" . }}
|
name: {{ include "common.fullname" . }}
|
||||||
{{- if .Values.extraEnvVarsSecret }}
|
{{- if .Values.extraEnvVarsSecret }}
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: {{ .Values.extraEnvVarsSecret }}
|
name: {{ .Values.extraEnvVarsSecret }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: {{ include "common.fullname" . }}
|
name: {{ include "common.fullname" . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
containerPort: 5678
|
containerPort: 5678
|
||||||
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
|
||||||
startupProbe:
|
startupProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /healthz
|
path: /healthz
|
||||||
port: http
|
port: http
|
||||||
failureThreshold: 30
|
failureThreshold: 30
|
||||||
periodSeconds: 10
|
periodSeconds: 10
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.resources | nindent 12 }}
|
{{- toYaml .Values.resources | nindent 12 }}
|
||||||
{{- with .Values.nodeSelector }}
|
{{- with .Values.nodeSelector }}
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
|
@ -16,26 +16,26 @@ 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:
|
||||||
service:
|
service:
|
||||||
name: {{ $fullName }}
|
name: {{ $fullName }}
|
||||||
port:
|
port:
|
||||||
number: {{ $svcPort }}
|
number: {{ $svcPort }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- 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 "common.selectorLabels" . | nindent 4 }}
|
{{- include "common.selectorLabels" . | nindent 4 }}
|
||||||
|
@ -8,8 +8,8 @@ metadata:
|
|||||||
"helm.sh/hook": test-success
|
"helm.sh/hook": test-success
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: wget
|
- name: wget
|
||||||
image: busybox
|
image: busybox
|
||||||
command: ['wget']
|
command: [ 'wget' ]
|
||||||
args: ['{{ include "common.fullname" . }}:{{ .Values.service.port }}']
|
args: [ '{{ include "common.fullname" . }}:{{ .Values.service.port }}' ]
|
||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
|
Reference in New Issue
Block a user