Skip to content

Commit

Permalink
Cleanup. Add values.yaml, skaffold.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
kostyaplis committed Apr 26, 2020
1 parent e02f98c commit 7e0e0ff
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 53 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# test-cronjob-helm
# test-cronjob-helm

```bash
helm repo add test-cronjob https://kostyaplis.github.io/test-cronjob-helm
```
2 changes: 1 addition & 1 deletion charts/basic/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: basic
version: 0.0.2
version: 0.0.3
82 changes: 41 additions & 41 deletions charts/basic/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,38 +31,38 @@ spec:
imagePullPolicy: {{ $.Values.image.pullPolicy }}
command:
{{- toYaml .command | trim | nindent 16 }}
{{- if or ($.Values.app.env) (.env) }}
env:
- name: PROMETHEUS_EXPORTER_REQUEST_STATS
value: "false"
- name: PROMETHEUS_EXPORTER_PROCESS_STATS
value: "false"
{{- range $name, $value := $.Values.app.env }}
- name: {{ $name | quote }}
value: {{ $value | quote }}
{{- end }}
{{- range $name, $value := .env }}
- name: {{ $name | quote }}
value: {{ $value | quote }}
{{- end }}
{{- end }}
{{- if or ($.Values.app.envFromSecrets) ($.Values.app.envFromConfigMaps) }}
envFrom:
{{- range $.Values.app.envFromConfigMaps }}
- configMapRef:
name: {{ . | quote }}
{{- end }}
{{- range $.Values.app.envFromSecrets }}
- secretRef:
name: {{ . | quote }}
{{- end }}
{{- end }}
volumeMounts:
{{- if $.Values.app.settingsYmlSecret.enabled }}
- mountPath: {{ $.Values.app.home }}/config/{{ $.Values.app.settingsYmlSecret.key }}
name: settings-yml-volume
subPath: {{ $.Values.app.settingsYmlSecret.key }}
{{- end }}
# {{- if or ($.Values.app.env) (.env) }}
# env:
# - name: PROMETHEUS_EXPORTER_REQUEST_STATS
# value: "false"
# - name: PROMETHEUS_EXPORTER_PROCESS_STATS
# value: "false"
# {{- range $name, $value := $.Values.app.env }}
# - name: {{ $name | quote }}
# value: {{ $value | quote }}
# {{- end }}
# {{- range $name, $value := .env }}
# - name: {{ $name | quote }}
# value: {{ $value | quote }}
# {{- end }}
# {{- end }}
# {{- if or ($.Values.app.envFromSecrets) ($.Values.app.envFromConfigMaps) }}
# envFrom:
# {{- range $.Values.app.envFromConfigMaps }}
# - configMapRef:
# name: {{ . | quote }}
# {{- end }}
# {{- range $.Values.app.envFromSecrets }}
# - secretRef:
# name: {{ . | quote }}
# {{- end }}
# {{- end }}
# volumeMounts:
# {{- if $.Values.app.settingsYmlSecret.enabled }}
# - mountPath: {{ $.Values.app.home }}/config/{{ $.Values.app.settingsYmlSecret.key }}
# name: settings-yml-volume
# subPath: {{ $.Values.app.settingsYmlSecret.key }}
# {{- end }}
{{- with .resources }}
resources:
{{- toYaml . | trim | nindent 16 }}
Expand All @@ -72,15 +72,15 @@ spec:
imagePullSecrets:
{{- toYaml . | trim | nindent 12}}
{{- end }}
volumes:
{{- if $.Values.app.settingsYmlSecret.enabled }}
- name: settings-yml-volume
secret:
secretName: {{ $.Values.app.settingsYmlSecret.name | quote }}
items:
- key: {{ $.Values.app.settingsYmlSecret.key | quote }}
path: {{ $.Values.app.settingsYmlSecret.key | quote }}
{{- end }}
# volumes:
# {{- if $.Values.app.settingsYmlSecret.enabled }}
# - name: settings-yml-volume
# secret:
# secretName: {{ $.Values.app.settingsYmlSecret.name | quote }}
# items:
# - key: {{ $.Values.app.settingsYmlSecret.key | quote }}
# path: {{ $.Values.app.settingsYmlSecret.key | quote }}
# {{- end }}
{{- with $.Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 12 }}
Expand Down
12 changes: 2 additions & 10 deletions charts/basic/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
replicaCount: 1

image:
repository:
tag: latest
repository: alpine
tag: 3.11
pullPolicy: IfNotPresent

imagePullSecrets: []
Expand All @@ -18,12 +18,6 @@ containerArgs: []
nameOverride: ""
fullnameOverride: ""

service:
enabled: false
type: ClusterIP
port: 80
annotations: {}

# environment variables, not a list of objects with keys name and value
# but directly an object of key and value
env: {}
Expand All @@ -32,8 +26,6 @@ envFromSecrets: []
# existing k8s configMaps for environment variables
envFromConfigMaps: []

# httpProbePath: /

resources: {}
# 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
Expand Down
17 changes: 17 additions & 0 deletions skaffold.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: skaffold/v2alpha4
kind: Config
profiles:
- name: test-cronjob
deploy:
helm:
flags:
install: ['--atomic']
upgrade: ['--atomic']
releases:
- name: cronjob
namespace: default
chartPath: test-cronjob/basic
remote: true
wait: true
valuesFiles:
- "values.yaml"
34 changes: 34 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
cronjobs:
- command:
- bash
- -c
- |
sleep 10s
failedJobsHistoryLimit: 1
successfulJobsHistoryLimit: 1
name: super-long-resource-name-that-exceeds-63-characters-and-should-fail
schedule: '* * * * *'
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi

- command:
- bash
- -c
- |
sleep 10s
failedJobsHistoryLimit: 1
successfulJobsHistoryLimit: 1
name: another-cronjob-name
schedule: '* * * * *'
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi

0 comments on commit 7e0e0ff

Please sign in to comment.