diff --git a/.drone.yml b/.drone.yml index 8265b9f..ddcc58a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -5,17 +5,17 @@ name: default trigger: event: - - push + - push steps: - - name: release - image: cr.grachevko.ru/drone/helm:RELEASE.2023-03-01T13-46-55Z - settings: - username: - from_secret: HELM_REPO_USERNAME - password: - from_secret: HELM_REPO_PASSWORD - when: - branch: - - master - - rc +- name: release + image: cr.grachevko.ru/drone/helm:RELEASE.2023-03-01T13-46-55Z + settings: + username: + from_secret: HELM_REPO_USERNAME + password: + from_secret: HELM_REPO_PASSWORD + when: + branch: + - master + - rc diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 33c90b8..7dc81bc 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,6 +1,6 @@ name: Build -on: [push] +on: [ push ] jobs: @@ -8,15 +8,15 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: Install Helm - run: | - curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash - helm plugin install https://github.com/hayorov/helm-gcs - - name: Lint chart - run: | - helm lint . + - name: Install Helm + run: | + curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash + helm plugin install https://github.com/hayorov/helm-gcs + - name: Lint chart + run: | + helm lint . release: needs: lint @@ -24,22 +24,22 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: Install Helm - run: | - curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash - helm plugin install https://github.com/hayorov/helm-gcs - - name: Dump GCloud auth key - run: | - cat <<'EOF' > gcloud_auth_key.json - ${{ secrets.GCLOUD_AUTH_KEY }} - EOF - - name: Release chart - env: - GOOGLE_APPLICATION_CREDENTIALS: ${{ github.workspace }}/gcloud_auth_key.json - run: | - helm repo add hahow gs://hahow-helm-charts - helm repo update - PACKAGE_FILE_PATH=$(helm package . | sed 's/^Successfully packaged chart and saved it to: //') - helm gcs push $(basename ${PACKAGE_FILE_PATH}) hahow --public + - name: Install Helm + run: | + curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash + helm plugin install https://github.com/hayorov/helm-gcs + - name: Dump GCloud auth key + run: | + cat <<'EOF' > gcloud_auth_key.json + ${{ secrets.GCLOUD_AUTH_KEY }} + EOF + - name: Release chart + env: + GOOGLE_APPLICATION_CREDENTIALS: ${{ github.workspace }}/gcloud_auth_key.json + run: | + helm repo add hahow gs://hahow-helm-charts + helm repo update + PACKAGE_FILE_PATH=$(helm package . | sed 's/^Successfully packaged chart and saved it to: //') + helm gcs push $(basename ${PACKAGE_FILE_PATH}) hahow --public diff --git a/README.md b/README.md index c49f331..9f92ede 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,8 @@ dependencies: 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 $ helm dep build @@ -61,13 +62,15 @@ helm.sh/chart: foo-1.2.3-beta.55_1234 ### `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 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 fullnameOverride: some-name @@ -142,7 +145,8 @@ metadata: 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` diff --git a/starter/templates/deployment.yaml b/starter/templates/deployment.yaml index 91bb19f..f3865ca 100644 --- a/starter/templates/deployment.yaml +++ b/starter/templates/deployment.yaml @@ -31,40 +31,40 @@ spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - - name: {{ .Chart.Name }} - securityContext: + - name: {{ .Chart.Name }} + securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - envFrom: - - configMapRef: - name: {{ include "common.fullname" . }} + image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + envFrom: + - configMapRef: + name: {{ include "common.fullname" . }} {{- if .Values.extraEnvVarsSecret }} - - secretRef: - name: {{ .Values.extraEnvVarsSecret }} + - secretRef: + name: {{ .Values.extraEnvVarsSecret }} {{- else }} - - secretRef: - name: {{ include "common.fullname" . }} + - secretRef: + name: {{ include "common.fullname" . }} {{- end }} - ports: - - name: http - containerPort: 5678 - protocol: TCP - livenessProbe: - httpGet: - path: /healthz - port: http - readinessProbe: - httpGet: - path: /healthz - port: http - startupProbe: - httpGet: - path: /healthz - port: http - failureThreshold: 30 - periodSeconds: 10 - resources: + ports: + - name: http + containerPort: 5678 + protocol: TCP + livenessProbe: + httpGet: + path: /healthz + port: http + readinessProbe: + httpGet: + path: /healthz + port: http + startupProbe: + httpGet: + path: /healthz + port: http + failureThreshold: 30 + periodSeconds: 10 + resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} nodeSelector: diff --git a/starter/templates/ingress.yaml b/starter/templates/ingress.yaml index af22a80..67e1064 100644 --- a/starter/templates/ingress.yaml +++ b/starter/templates/ingress.yaml @@ -16,26 +16,26 @@ spec: {{- if .Values.ingress.tls }} tls: {{- range .Values.ingress.tls }} - - hosts: + - hosts: {{- range .hosts }} - - {{ . | quote }} + - {{ . | quote }} {{- end }} - secretName: {{ .secretName }} + secretName: {{ .secretName }} {{- end }} {{- end }} rules: {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: + - host: {{ .host | quote }} + http: + paths: {{- range .paths }} - - path: {{ .path }} - pathType: {{ default "ImplementationSpecific" .pathType }} - backend: - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} + - path: {{ .path }} + pathType: {{ default "ImplementationSpecific" .pathType }} + backend: + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} {{- end }} {{- end }} {{- end }} diff --git a/starter/templates/service.yaml b/starter/templates/service.yaml index a8549a7..ce84e3a 100644 --- a/starter/templates/service.yaml +++ b/starter/templates/service.yaml @@ -7,9 +7,9 @@ metadata: spec: type: {{ .Values.service.type }} ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - name: http + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http selector: {{- include "common.selectorLabels" . | nindent 4 }} diff --git a/starter/templates/tests/test-connection.yaml b/starter/templates/tests/test-connection.yaml index cb5e8d4..cf570a1 100644 --- a/starter/templates/tests/test-connection.yaml +++ b/starter/templates/tests/test-connection.yaml @@ -8,8 +8,8 @@ metadata: "helm.sh/hook": test-success spec: containers: - - name: wget - image: busybox - command: ['wget'] - args: ['{{ include "common.fullname" . }}:{{ .Values.service.port }}'] + - name: wget + image: busybox + command: [ 'wget' ] + args: [ '{{ include "common.fullname" . }}:{{ .Values.service.port }}' ] restartPolicy: Never diff --git a/values.yaml b/values.yaml deleted file mode 100644 index e69de29..0000000