Skip to content

Commit

Permalink
Merge pull request #188 from vovtz/patch-1
Browse files Browse the repository at this point in the history
#187 Check `Capabilities` to render `PodDisruptionBudget` manifest
  • Loading branch information
joejulian authored Dec 1, 2022
2 parents d5580e1 + 2c6e5b2 commit d50fa93
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 1 addition & 5 deletions charts/redpanda/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,9 @@ type: application
# The chart version and the app version are not the same and will not track
# together. The chart version is a semver representation of changes to this
# chart.
version: 2.3.8
version: 2.3.9
# The app version is the default version of Redpanda to install.
appVersion: v22.3.3
# kubeVersion must be suffixed with "-0" to be able to match cloud providers
# kubernetes versions like "v1.23.8-gke.1900". Their suffix is interpreted as a
# pre-release. Our "-0" allows pre-releases to be matched.
kubeVersion: "^1.21.0-0"
icon: https://images.ctfassets.net/paqvtpyf8rwu/3cYHw5UzhXCbKuR24GDFGO/73fb682e6157d11c10d5b2b5da1d5af0/skate-stand-panda.svg
sources:
- https://github.com/redpanda-data/helm-charts
Expand Down
4 changes: 4 additions & 0 deletions charts/redpanda/templates/poddisruptionbudget.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/}}

{{- if .Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget" }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
Expand All @@ -35,3 +36,6 @@ spec:
app.kubernetes.io/name: {{ template "redpanda.name" . }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
maxUnavailable: {{ .Values.statefulset.budget.maxUnavailable | int64 }}
{{- else if (not .Values.ephemeralUsage.enabled) }}
{{- fail "You must use Kubernetes 1.21+ for a production cluster. If you're not using this in production and you know why doing this is a bad idea, you can set 'ephemeralUsage.enabled=false' to continue." }}
{{- end }}
7 changes: 7 additions & 0 deletions charts/redpanda/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,13 @@ listeners:
# This listener port will be used for the external port if this is not included
nodePort: 30081

### Non-production usage
#
# ephemeralUsage - Enabling this key relaxes some properties related to high availability, like the
# implementation of a PodDisruptionBudget (this enables deployment onto older K8s versions as well)
ephemeralUsage:
enabled: false

# Expert Config

# This section contains various settings supported by Redpanda that may not work
Expand Down

0 comments on commit d50fa93

Please sign in to comment.