diff --git a/charts/onechart/Chart.yaml b/charts/onechart/Chart.yaml index ff54c0e..c5c9c97 100644 --- a/charts/onechart/Chart.yaml +++ b/charts/onechart/Chart.yaml @@ -15,4 +15,4 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.13.2 +version: 0.14.0 diff --git a/charts/onechart/templates/deployment.yaml b/charts/onechart/templates/deployment.yaml index 9dcfee0..92e51ef 100644 --- a/charts/onechart/templates/deployment.yaml +++ b/charts/onechart/templates/deployment.yaml @@ -103,9 +103,22 @@ spec: nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.affinity }} + {{- if or .Values.spreadAcrossNodes .Values.affinity }} affinity: - {{- toYaml . | nindent 8 }} + {{- if .Values.spreadAcrossNodes }} + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: "app.kubernetes.io/instance" + operator: In + values: + - {{ .Release.Name }} + topologyKey: "kubernetes.io/hostname" + {{- end }} + {{- if .Values.affinity }} + {{- toYaml .Values.affinity | nindent 8 }} + {{- end }} {{- end }} {{- with .Values.tolerations }} tolerations: diff --git a/charts/onechart/templates/pdb.yaml b/charts/onechart/templates/pdb.yaml new file mode 100644 index 0000000..b968463 --- /dev/null +++ b/charts/onechart/templates/pdb.yaml @@ -0,0 +1,12 @@ +{{- if and (.Values.podDisruptionBudgetEnabled) (gt (.Values.replicas | int64) 1) }} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: {{ .Release.Name }} + namespace: {{ .Release.Namespace }} +spec: + minAvailable: 1 + selector: + matchLabels: + {{- include "helm-chart.selectorLabels" . | nindent 6 }} + {{- end }} diff --git a/charts/onechart/tests/deployment_affinity_test.yaml b/charts/onechart/tests/deployment_affinity_test.yaml new file mode 100644 index 0000000..7f567ee --- /dev/null +++ b/charts/onechart/tests/deployment_affinity_test.yaml @@ -0,0 +1,27 @@ +suite: test deployment +templates: + - deployment.yaml + - configmap.yaml +tests: + - it: Should spread pods across nodes + set: + spreadAccrossNodes: true + asserts: + - equal: + path: spec.template.spec.affinity + value: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: "app.kubernetes.io/instance" + operator: In + values: + - RELEASE-NAME + topologyKey: "kubernetes.io/hostname" + - it: Should not spread pods across nodes + set: + spreadAcrossNodes: false + asserts: + - isNull: + path: spec.template.spec.affinity diff --git a/charts/onechart/tests/pdb_test.yaml b/charts/onechart/tests/pdb_test.yaml new file mode 100644 index 0000000..cb5dfd9 --- /dev/null +++ b/charts/onechart/tests/pdb_test.yaml @@ -0,0 +1,11 @@ +suite: test prometheus rule +templates: + - pdb.yaml +tests: + - it: Should set Pod Disruption budget + set: + replicas: 2 + asserts: + - equal: + path: spec.minAvailable + value: 1 diff --git a/charts/onechart/values.schema.json b/charts/onechart/values.schema.json index 0794698..8eb977a 100644 --- a/charts/onechart/values.schema.json +++ b/charts/onechart/values.schema.json @@ -96,6 +96,20 @@ 1 ] }, + "podDisruptionBudgetEnabled": { + "$id": "#/properties/podDisruptionBudgetEnabled", + "type": "boolean", + "title": "Pod Disruption Budget", + "description": "If pod disruption budgets is enabled, node maintenance won't affect the availability of your application", + "default": true + }, + "spreadAcrossNodes": { + "$id": "#/properties/spreadAcrossNodes", + "type": "boolean", + "title": "Spread pods across nodes", + "description": "This setting prevents pods to be placed on the same node", + "default": true + }, "nameOverride": { "$id": "#/properties/nameOverride", "type": "string", diff --git a/charts/onechart/values.yaml b/charts/onechart/values.yaml index ddab57c..1f4f146 100644 --- a/charts/onechart/values.yaml +++ b/charts/onechart/values.yaml @@ -29,7 +29,6 @@ nodeSelector: {} tolerations: [] -affinity: {} probe: enabled: false @@ -51,3 +50,6 @@ debugSidecar: image: debian:stable-slim shell: "/bin/bash" command: "while true; do sleep 30; done;" + +podDisruptionBudgetEnabled: true +spreadAcrossNodes: true diff --git a/docs/cron-job-0.1.2.tgz b/docs/cron-job-0.1.2.tgz index 686ecf9..27cbeca 100644 Binary files a/docs/cron-job-0.1.2.tgz and b/docs/cron-job-0.1.2.tgz differ diff --git a/docs/index.yaml b/docs/index.yaml index 6d67ebe..bf611aa 100644 --- a/docs/index.yaml +++ b/docs/index.yaml @@ -2,17 +2,17 @@ apiVersion: v1 entries: cron-job: - apiVersion: v2 - created: "2021-02-15T15:29:59.295290552+01:00" + created: "2021-02-15T16:18:02.392858444+01:00" description: One chart to rule them all. A generic Helm chart for your application deployments. Because no-one can remember the Kubernetes yaml syntax. - digest: f9fdfb3e59cc520c4ce87f10ca396391422629428d2140f1e54b79d71e9e51c5 + digest: 9f4c1dfec71c90f9075d3e9a95e5316f858c7b16148825c031635067fdd2eca2 name: cron-job type: application urls: - https://chart.onechart.dev/cron-job-0.1.2.tgz version: 0.1.2 - apiVersion: v2 - created: "2021-02-15T15:29:59.295014647+01:00" + created: "2021-02-15T16:18:02.39251633+01:00" description: One chart to rule them all. A generic Helm chart for your application deployments. Because no-one can remember the Kubernetes yaml syntax. digest: afab9ba533a4686827b54b0dad64f5bbf76f7fbc075e35fb1034689db9ab9dda @@ -22,7 +22,7 @@ entries: - https://chart.onechart.dev/cron-job-0.1.1.tgz version: 0.1.1 - apiVersion: v2 - created: "2021-02-15T15:29:59.294763711+01:00" + created: "2021-02-15T16:18:02.392261179+01:00" description: One chart to rule them all. A generic Helm chart for your application deployments. Because no-one can remember the Kubernetes yaml syntax. digest: 01f9fa40c1c4085d7688474ab00c9e9d21bd1d0793db6b75f2edda0e18456282 @@ -33,16 +33,16 @@ entries: version: 0.1.0 namespaces: - apiVersion: v2 - created: "2021-02-15T15:29:59.296159075+01:00" + created: "2021-02-15T16:18:02.393475157+01:00" description: Chart to create namespaces and their defaults - digest: ff0b56fe340951e626a66242883d1186f3816bae696fc31d6e1e50bca93d361f + digest: 78b034508140cac6f604991b0f5897c29187844fba50b31564bedcbc4b9cca7f name: namespaces type: application urls: - https://chart.onechart.dev/namespaces-0.2.0.tgz version: 0.2.0 - apiVersion: v2 - created: "2021-02-15T15:29:59.295516606+01:00" + created: "2021-02-15T16:18:02.393086595+01:00" description: Chart to create namespaces and their defaults digest: 88b06d78a9d1bda6f2ee15b1fad7f25399ac25c2320fb9a8dfa1a4fd14afdf6e name: namespaces @@ -52,17 +52,27 @@ entries: version: 0.1.0 onechart: - apiVersion: v2 - created: "2021-02-15T15:29:59.300855028+01:00" + created: "2021-02-15T16:18:02.398909524+01:00" description: One chart to rule them all. A generic Helm chart for your application deployments. Because no-one can remember the Kubernetes yaml syntax. - digest: 5c319712d975ed6e0907e478bc81f3fe7e49bf8a0a42c2773c9a4d9b08092bfd + digest: 7e61a72a3400e09c44539094558a2084621239015132d20551c4593be3b5bede + name: onechart + type: application + urls: + - https://chart.onechart.dev/onechart-0.14.0.tgz + version: 0.14.0 + - apiVersion: v2 + created: "2021-02-15T16:18:02.398408534+01:00" + description: One chart to rule them all. A generic Helm chart for your application + deployments. Because no-one can remember the Kubernetes yaml syntax. + digest: 743a9b552233770713f0c22edbe8cf4f55c890a59106e1f33055c1cb31be5a27 name: onechart type: application urls: - https://chart.onechart.dev/onechart-0.13.2.tgz version: 0.13.2 - apiVersion: v2 - created: "2021-02-15T15:29:59.300305739+01:00" + created: "2021-02-15T16:18:02.397900354+01:00" description: One chart to rule them all. A generic Helm chart for your application deployments. Because no-one can remember the Kubernetes yaml syntax. digest: 02bf9537e13cea0da9dc3bfbcdd45d51576354cb18b7c1c7cec76f829e20105f @@ -72,7 +82,7 @@ entries: - https://chart.onechart.dev/onechart-0.13.1.tgz version: 0.13.1 - apiVersion: v2 - created: "2021-02-15T15:29:59.299779016+01:00" + created: "2021-02-15T16:18:02.397427708+01:00" description: One chart to rule them all. A generic Helm chart for your application deployments. Because no-one can remember the Kubernetes yaml syntax. digest: 5183ed825c4f255ca5a4f0ffeb8c92bbad3c43b42fc1b798f1f1fc6de2a30bef @@ -82,7 +92,7 @@ entries: - https://chart.onechart.dev/onechart-0.13.0.tgz version: 0.13.0 - apiVersion: v2 - created: "2021-02-15T15:29:59.299279577+01:00" + created: "2021-02-15T16:18:02.396929129+01:00" description: One chart to rule them all. A generic Helm chart for your application deployments. Because no-one can remember the Kubernetes yaml syntax. digest: e131a502d12a6b074453f1da8d0d1ca7145e80a025f31252b24cc3d62375a4c1 @@ -92,7 +102,7 @@ entries: - https://chart.onechart.dev/onechart-0.12.2.tgz version: 0.12.2 - apiVersion: v2 - created: "2021-02-15T15:29:59.2988501+01:00" + created: "2021-02-15T16:18:02.396481706+01:00" description: One chart to rule them all. A generic Helm chart for your application deployments. Because no-one can remember the Kubernetes yaml syntax. digest: 8e1a25d18a546c4ec5e970991301a08e38495a964a8f6e0a2ee97f92c41c9691 @@ -102,7 +112,7 @@ entries: - https://chart.onechart.dev/onechart-0.12.1.tgz version: 0.12.1 - apiVersion: v2 - created: "2021-02-15T15:29:59.298409554+01:00" + created: "2021-02-15T16:18:02.396032497+01:00" description: One chart to rule them all. A generic Helm chart for your application deployments. Because no-one can remember the Kubernetes yaml syntax. digest: f38a6f2fbf5c847b00a9140ecd004e0bf667d859aa83d8dac4a2d0eecd1a361f @@ -112,7 +122,7 @@ entries: - https://chart.onechart.dev/onechart-0.12.0.tgz version: 0.12.0 - apiVersion: v2 - created: "2021-02-15T15:29:59.297981889+01:00" + created: "2021-02-15T16:18:02.395585373+01:00" description: One chart to rule them all. A generic Helm chart for your application deployments. Because no-one can remember the Kubernetes yaml syntax. digest: 75c16f84b5e99aad5aa7203f5c1ce2a9589d85b89afec4e161a2e0344a522c17 @@ -122,7 +132,7 @@ entries: - https://chart.onechart.dev/onechart-0.11.0.tgz version: 0.11.0 - apiVersion: v2 - created: "2021-02-15T15:29:59.297589152+01:00" + created: "2021-02-15T16:18:02.395163735+01:00" description: One chart to rule them all. A generic Helm chart for your application deployments. Because no-one can remember the Kubernetes yaml syntax. digest: 40f1166e858d35cb237debd1390187884641b0e8c29a80aaa195b66b0ee73516 @@ -132,7 +142,7 @@ entries: - https://chart.onechart.dev/onechart-0.10.0.tgz version: 0.10.0 - apiVersion: v2 - created: "2021-02-15T15:29:59.306437139+01:00" + created: "2021-02-15T16:18:02.404195833+01:00" description: One chart to rule them all. A generic Helm chart for your application deployments. Because no-one can remember the Kubernetes yaml syntax. digest: cb42b08b463b401f6718bba7c171ee55c173021c5101ea1b3068ef3899a6e164 @@ -142,7 +152,7 @@ entries: - https://chart.onechart.dev/onechart-0.9.0.tgz version: 0.9.0 - apiVersion: v2 - created: "2021-02-15T15:29:59.30605765+01:00" + created: "2021-02-15T16:18:02.403780337+01:00" description: One chart to rule them all. A generic Helm chart for your application deployments. Because no-one can remember the Kubernetes yaml syntax. digest: ce046d209a9e8fa07766712492cc896451473fafca129dbc9c675107d0e39c52 @@ -152,7 +162,7 @@ entries: - https://chart.onechart.dev/onechart-0.8.2.tgz version: 0.8.2 - apiVersion: v2 - created: "2021-02-15T15:29:59.305593198+01:00" + created: "2021-02-15T16:18:02.403438929+01:00" description: One chart to rule them all. A generic Helm chart for your application deployments. Because no-one can remember the Kubernetes yaml syntax. digest: 422d7e6ea1bed530d4cd5e23417b229772a6fe2e835828ca282a3e6c9b646b2b @@ -162,7 +172,7 @@ entries: - https://chart.onechart.dev/onechart-0.8.1.tgz version: 0.8.1 - apiVersion: v2 - created: "2021-02-15T15:29:59.305250062+01:00" + created: "2021-02-15T16:18:02.403082627+01:00" description: One chart to rule them all. A generic Helm chart for your application deployments. Because no-one can remember the Kubernetes yaml syntax. digest: 8001bd02fc90ad66da7941c136ee8d0e665ea90b6e1ac27d82b048f2b12b3964 @@ -172,7 +182,7 @@ entries: - https://chart.onechart.dev/onechart-0.8.0.tgz version: 0.8.0 - apiVersion: v2 - created: "2021-02-15T15:29:59.304912058+01:00" + created: "2021-02-15T16:18:02.402731828+01:00" description: One chart to rule them all. A generic Helm chart for your application deployments. Because no-one can remember the Kubernetes yaml syntax. digest: d1454b430eb7131d0d450f7c0a8a6698278893c61e03d48649a8112dfcf42b72 @@ -182,7 +192,7 @@ entries: - https://chart.onechart.dev/onechart-0.7.1.tgz version: 0.7.1 - apiVersion: v2 - created: "2021-02-15T15:29:59.304554683+01:00" + created: "2021-02-15T16:18:02.402400022+01:00" description: One chart to rule them all. A generic Helm chart for your application deployments. Because no-one can remember the Kubernetes yaml syntax. digest: 4bf90835f287917671ec40b5b395da9332cf18e70f248d250f8d5a72360dcb4e @@ -192,7 +202,7 @@ entries: - https://chart.onechart.dev/onechart-0.7.0.tgz version: 0.7.0 - apiVersion: v2 - created: "2021-02-15T15:29:59.304238255+01:00" + created: "2021-02-15T16:18:02.402003683+01:00" description: One chart to rule them all. A generic Helm chart for your application deployments. Because no-one can remember the Kubernetes yaml syntax. digest: 0cade489fc74a040f5e7f71d01c6fa00d3f68b4752a4d8234ccf2c1504b4c0a1 @@ -202,7 +212,7 @@ entries: - https://chart.onechart.dev/onechart-0.6.1.tgz version: 0.6.1 - apiVersion: v2 - created: "2021-02-15T15:29:59.303957755+01:00" + created: "2021-02-15T16:18:02.40171782+01:00" description: One chart to rule them all. A generic Helm chart for your application deployments. Because no-one can remember the Kubernetes yaml syntax. digest: d607820a7e104eaaa88c153c1f2f7f409ef4c612ad747caeb3a671cf3fce03d4 @@ -212,7 +222,7 @@ entries: - https://chart.onechart.dev/onechart-0.6.0.tgz version: 0.6.0 - apiVersion: v2 - created: "2021-02-15T15:29:59.303545218+01:00" + created: "2021-02-15T16:18:02.401373895+01:00" description: One chart to rule them all. A generic Helm chart for your application deployments. Because no-one can remember the Kubernetes yaml syntax. digest: ddf7cf87402095d62855898744b805115fdf86c4b295e0a4def0c50408fd9138 @@ -222,7 +232,7 @@ entries: - https://chart.onechart.dev/onechart-0.5.1.tgz version: 0.5.1 - apiVersion: v2 - created: "2021-02-15T15:29:59.302762339+01:00" + created: "2021-02-15T16:18:02.400639299+01:00" description: One chart to rule them all. A generic Helm chart for your application deployments. Because no-one can remember the Kubernetes yaml syntax. digest: adf3c2cf3a27e58ec75620599e0e1c2031a7410a061a590317beeff6d8a9ad69 @@ -232,7 +242,7 @@ entries: - https://chart.onechart.dev/onechart-0.5.0.tgz version: 0.5.0 - apiVersion: v2 - created: "2021-02-15T15:29:59.302482213+01:00" + created: "2021-02-15T16:18:02.400190365+01:00" description: One chart to rule them all. A generic Helm chart for your application deployments. Because no-one can remember the Kubernetes yaml syntax. digest: 8dab33263c4e632aeb4656c666871440b589497b70e76a1d6c3a5e3db1a30bba @@ -242,7 +252,7 @@ entries: - https://chart.onechart.dev/onechart-0.4.0.tgz version: 0.4.0 - apiVersion: v2 - created: "2021-02-15T15:29:59.302196957+01:00" + created: "2021-02-15T16:18:02.399917393+01:00" description: A generic Helm chart for your application deployments digest: fbaf6139e0ef8ad9a87cc1e41a97c7d25fdcf7ea17fa6364952f1a851a87480a name: onechart @@ -251,7 +261,7 @@ entries: - https://chart.onechart.dev/onechart-0.3.2.tgz version: 0.3.2 - apiVersion: v2 - created: "2021-02-15T15:29:59.301843845+01:00" + created: "2021-02-15T16:18:02.399662519+01:00" description: A generic Helm chart for your application deployments digest: bd6f5b1865ab9b05fc6925c163ab8045235bd2723dba31f09d5083d24322d1f8 name: onechart @@ -260,7 +270,7 @@ entries: - https://chart.onechart.dev/onechart-0.3.1.tgz version: 0.3.1 - apiVersion: v2 - created: "2021-02-15T15:29:59.301513548+01:00" + created: "2021-02-15T16:18:02.399411847+01:00" description: A generic Helm chart for your application deployments digest: c79cef21eceab948144a289298cdf1e20e77a0782a883d7d65f9e709ccbbc271 name: onechart @@ -269,7 +279,7 @@ entries: - https://chart.onechart.dev/onechart-0.3.0.tgz version: 0.3.0 - apiVersion: v2 - created: "2021-02-15T15:29:59.301121165+01:00" + created: "2021-02-15T16:18:02.399161758+01:00" description: A generic Helm chart for your application deployments digest: dd814ac5d08d5e6163a1b769df6803f5cb0f09d906045086dfcc5be522bb1ec3 name: onechart @@ -278,7 +288,7 @@ entries: - https://chart.onechart.dev/onechart-0.2.0.tgz version: 0.2.0 - apiVersion: v2 - created: "2021-02-15T15:29:59.29720135+01:00" + created: "2021-02-15T16:18:02.394770523+01:00" description: A generic Helm chart for your application deployments digest: e46062df8053840cbfbba26c0a66a843a79f15a0b43a145ed019327513bd5098 name: onechart @@ -287,7 +297,7 @@ entries: - https://chart.onechart.dev/onechart-0.1.2.tgz version: 0.1.2 - apiVersion: v2 - created: "2021-02-15T15:29:59.296964617+01:00" + created: "2021-02-15T16:18:02.394406906+01:00" description: A generic Helm chart for your application deployments digest: a7bbc8b7dcc008e89156cd1830282b7d39c0592e82ccdcefb77a25a42eca2a3d name: onechart @@ -296,7 +306,7 @@ entries: - https://chart.onechart.dev/onechart-0.1.1.tgz version: 0.1.1 - apiVersion: v2 - created: "2021-02-15T15:29:59.296690646+01:00" + created: "2021-02-15T16:18:02.393722153+01:00" description: A generic Helm chart for your application deployments digest: 1ed8c0645abdae6c950526e9c5410dc056847a11700dc7def5f1c55eb7de0cd4 name: onechart @@ -304,4 +314,4 @@ entries: urls: - https://chart.onechart.dev/onechart-0.1.0.tgz version: 0.1.0 -generated: "2021-02-15T15:29:59.294429604+01:00" +generated: "2021-02-15T16:18:02.39186242+01:00" diff --git a/docs/namespaces-0.2.0.tgz b/docs/namespaces-0.2.0.tgz index e822bd9..6185b98 100644 Binary files a/docs/namespaces-0.2.0.tgz and b/docs/namespaces-0.2.0.tgz differ diff --git a/docs/onechart-0.13.2.tgz b/docs/onechart-0.13.2.tgz index 126a74b..831f453 100644 Binary files a/docs/onechart-0.13.2.tgz and b/docs/onechart-0.13.2.tgz differ diff --git a/docs/onechart-0.14.0.tgz b/docs/onechart-0.14.0.tgz new file mode 100644 index 0000000..157adaa Binary files /dev/null and b/docs/onechart-0.14.0.tgz differ