Compare commits
10 Commits
42a80492ad
...
0.5.1
Author | SHA1 | Date | |
---|---|---|---|
c9f4c7eeb4
|
|||
e602d9f045
|
|||
1bbfd49265
|
|||
93c81fddb9
|
|||
964f7e9c5d
|
|||
4f80520c7e
|
|||
c850e79d2a
|
|||
eafcf8ba09
|
|||
6342d7be31
|
|||
1975611101
|
@@ -6,16 +6,17 @@ name: default
|
|||||||
trigger:
|
trigger:
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
|
- tag
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: release
|
- name: release
|
||||||
image: cr.grachevko.ru/drone/helm:RELEASE.2023-03-01T13-46-55Z
|
image: cr.grachevko.ru/drone/helm:24
|
||||||
settings:
|
settings:
|
||||||
|
tag: ${DRONE_TAG}
|
||||||
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:
|
event:
|
||||||
- master
|
- tag
|
||||||
- rc
|
|
||||||
|
16
README.md
16
README.md
@@ -5,7 +5,7 @@
|
|||||||
The following command allows you to download and install all the charts from our repository:
|
The following command allows you to download and install all the charts from our repository:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ helm repo add hahow https://harbor.grachevko.ru/chartrepo/helm
|
$ helm repo add hahow oci://cr.grachevko.ru/helm/chart
|
||||||
```
|
```
|
||||||
|
|
||||||
### Adding Dependency
|
### Adding Dependency
|
||||||
@@ -16,10 +16,11 @@ To use the library chart, `common` should be listed in `dependencies` field in y
|
|||||||
dependencies:
|
dependencies:
|
||||||
- name: common
|
- name: common
|
||||||
version: 0.4.1
|
version: 0.4.1
|
||||||
repository: https://harbor.grachevko.ru/chartrepo/helm
|
repository: oci://cr.grachevko.ru/helm/chart
|
||||||
```
|
```
|
||||||
|
|
||||||
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`
|
||||||
|
|
||||||
|
@@ -25,4 +25,4 @@ appVersion: 1.16.0
|
|||||||
dependencies:
|
dependencies:
|
||||||
- name: common
|
- name: common
|
||||||
version: "^0"
|
version: "^0"
|
||||||
repository: "https://harbor.grachevko.ru/chartrepo/helm"
|
repository: oci://cr.grachevko.ru/helm/chart
|
||||||
|
@@ -24,10 +24,6 @@ spec:
|
|||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with .Values.image.pullSecrets }}
|
|
||||||
imagePullSecrets:
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
securityContext:
|
securityContext:
|
||||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||||
containers:
|
containers:
|
||||||
@@ -37,15 +33,24 @@ spec:
|
|||||||
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:
|
||||||
|
{{- if .Values.existingConfigmap }}
|
||||||
|
- configMapRef:
|
||||||
|
name: {{ .Values.existingConfigmap }}
|
||||||
|
{{- else }}
|
||||||
- configMapRef:
|
- configMapRef:
|
||||||
name: {{ include "common.fullname" . }}
|
name: {{ include "common.fullname" . }}
|
||||||
{{- if .Values.extraEnvVarsSecret }}
|
{{- end }}
|
||||||
|
{{- if .Values.existingSecret }}
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: {{ .Values.extraEnvVarsSecret }}
|
name: {{ .Values.existingSecret }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: {{ include "common.fullname" . }}
|
name: {{ include "common.fullname" . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if .Values.extraEnvVarsSecret }}
|
||||||
|
- secretRef:
|
||||||
|
name: {{ .Values.extraEnvVarsSecret }}
|
||||||
|
{{- end }}
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
containerPort: 5678
|
containerPort: 5678
|
||||||
|
@@ -12,9 +12,9 @@ extraEnvVarsSecret:
|
|||||||
replicaCount: 1
|
replicaCount: 1
|
||||||
|
|
||||||
image:
|
image:
|
||||||
|
registry: docker.io
|
||||||
repository: nginx
|
repository: nginx
|
||||||
pullPolicy: IfNotPresent
|
pullPolicy: IfNotPresent
|
||||||
pullSecrets: []
|
|
||||||
# Overrides the image tag whose default is the chart appVersion.
|
# Overrides the image tag whose default is the chart appVersion.
|
||||||
tag: ""
|
tag: ""
|
||||||
|
|
||||||
@@ -50,6 +50,11 @@ service:
|
|||||||
|
|
||||||
ingress:
|
ingress:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
## @param ingress.ingressClassName IngressClass that will be used to implement the Ingress (Kubernetes 1.18+)
|
||||||
|
## This is supported in Kubernetes 1.18+ and required if you have more than one IngressClass marked as the default for your cluster.
|
||||||
|
## ref: https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/
|
||||||
|
##
|
||||||
|
ingressClassName: ""
|
||||||
annotations: {}
|
annotations: {}
|
||||||
# kubernetes.io/ingress.class: nginx
|
# kubernetes.io/ingress.class: nginx
|
||||||
# kubernetes.io/tls-acme: "true"
|
# kubernetes.io/tls-acme: "true"
|
||||||
|
@@ -87,7 +87,7 @@ The order in which this function returns a secret password:
|
|||||||
{{- $password := "" }}
|
{{- $password := "" }}
|
||||||
{{- $subchart := "" }}
|
{{- $subchart := "" }}
|
||||||
{{- $chartName := default "" .chartName }}
|
{{- $chartName := default "" .chartName }}
|
||||||
{{- $passwordLength := default 10 .length }}
|
{{- $passwordLength := default 32 .length }}
|
||||||
{{- $providedPasswordKey := include "common.utils.getKeyFromList" (dict "keys" .providedValues "context" $.context) }}
|
{{- $providedPasswordKey := include "common.utils.getKeyFromList" (dict "keys" .providedValues "context" $.context) }}
|
||||||
{{- $providedPasswordValue := include "common.utils.getValueFromKey" (dict "key" $providedPasswordKey "context" $.context) }}
|
{{- $providedPasswordValue := include "common.utils.getValueFromKey" (dict "key" $providedPasswordKey "context" $.context) }}
|
||||||
{{- $secretData := (lookup "v1" "Secret" (include "common.namespace" .context) .secret).data }}
|
{{- $secretData := (lookup "v1" "Secret" (include "common.namespace" .context) .secret).data }}
|
||||||
@@ -115,6 +115,8 @@ The order in which this function returns a secret password:
|
|||||||
{{- $password = randAscii $passwordLength }}
|
{{- $password = randAscii $passwordLength }}
|
||||||
{{- $password = regexReplaceAllLiteral "\\W" $password "@" | substr 5 $passwordLength }}
|
{{- $password = regexReplaceAllLiteral "\\W" $password "@" | substr 5 $passwordLength }}
|
||||||
{{- $password = printf "%s%s" $subStr $password | toString | shuffle | b64enc | quote }}
|
{{- $password = printf "%s%s" $subStr $password | toString | shuffle | b64enc | quote }}
|
||||||
|
{{- else if .hex }}
|
||||||
|
{{- $password = include "common.secrets.randHex" $passwordLength | b64enc | quote }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
{{- $password = randAlphaNum $passwordLength | b64enc | quote }}
|
{{- $password = randAlphaNum $passwordLength | b64enc | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -122,6 +124,23 @@ The order in which this function returns a secret password:
|
|||||||
{{- printf "%s" $password -}}
|
{{- printf "%s" $password -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- /*
|
||||||
|
Returns given number of random Hex characters.
|
||||||
|
- randNumeric 4 | atoi generates a random number in [0, 10^4)
|
||||||
|
This is a range evenly divisble by 16, but even if off by one,
|
||||||
|
that last partial interval offsetting randomness is only 1 part in 625.
|
||||||
|
- mod N 16 maps to the range 0-15
|
||||||
|
- printf "%x" represents a single number 0-15 as a single hex character
|
||||||
|
*/}}
|
||||||
|
{{- define "common.secrets.randHex" -}}
|
||||||
|
{{- $result := "" }}
|
||||||
|
{{- range $i := until . }}
|
||||||
|
{{- $rand_hex_char := mod (randNumeric 4 | atoi) 16 | printf "%x" }}
|
||||||
|
{{- $result = print $result $rand_hex_char }}
|
||||||
|
{{- end }}
|
||||||
|
{{- $result }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Reuses the value from an existing secret, otherwise sets its value to a default value.
|
Reuses the value from an existing secret, otherwise sets its value to a default value.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user