Add global.enabled to disable all components by default

This commit is contained in:
Mitchell Hashimoto 2018-09-02 16:19:11 -07:00
parent 7ff71983f1
commit 3a61646b1d
No known key found for this signature in database
GPG key ID: 744E147AA52F5B0A
10 changed files with 21 additions and 14 deletions

View file

@ -1,5 +1,5 @@
# DaemonSet to run the Consul clients on every node.
{{- if .Values.client.enabled }}
{{- if (default .Values.client.enabled .Values.global.enabled) }}
apiVersion: apps/v1
kind: DaemonSet
metadata:

View file

@ -1,5 +1,5 @@
# The deployment for running the Connect sidecar injector
{{- if .Values.connectInject.enabled }}
{{- if (default .Values.connectInject.enabled .Values.global.enabled) }}
apiVersion: apps/v1
kind: Deployment
metadata:

View file

@ -1,5 +1,5 @@
# The MutatingWebhookConfiguration to enable the Connect injector.
{{- if (.Values.connectInject.enabled) and (.Values.connectInject.caBundle) }}
{{- if (default .Values.connectInject.enabled .Values.global.enabled) }}
apiVersion: admissionregistration.k8s.io/v1beta1
kind: MutatingWebhookConfiguration
metadata:

View file

@ -1,5 +1,5 @@
# The service for the Connect sidecar injector
{{- if .Values.connectInject.enabled }}
{{- if (default .Values.connectInject.enabled .Values.global.enabled) }}
apiVersion: v1
kind: Service
metadata:

View file

@ -1,5 +1,5 @@
# StatefulSet to run the actual Consul server cluster.
{{- if .Values.server.enabled }}
{{- if (default .Values.server.enabled .Values.global.enabled) }}
apiVersion: v1
kind: ConfigMap
metadata:

View file

@ -1,6 +1,6 @@
# PodDisruptionBudget to prevent degrading the server cluster through
# voluntary cluster changes.
{{- if (.Values.server.enabled) and (.Values.server.disruptionBudget.enabled) }}
{{- if (and (default .Values.server.enabled .Values.global.enabled) (default .Values.server.disruptionBudget.enabled .Values.global.enabled)) }}
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:

View file

@ -3,7 +3,7 @@
# the agent is installed locally on the node and the NODE_IP should be used.
# If the node can't run a Consul agent, then this service can be used to
# communicate directly to a server agent.
{{- if .Values.server.enabled }}
{{- if (default .Values.server.enabled .Values.global.enabled) }}
apiVersion: v1
kind: Service
metadata:

View file

@ -1,5 +1,5 @@
# StatefulSet to run the actual Consul server cluster.
{{- if .Values.server.enabled }}
{{- if (default .Values.server.enabled .Values.global.enabled) }}
apiVersion: apps/v1
kind: StatefulSet
metadata:

View file

@ -3,7 +3,7 @@
# the agent is installed locally on the node and the NODE_IP should be used.
# If the node can't run a Consul agent, then this service can be used to
# communicate directly to a server agent.
{{- if (.Values.server.enabled) and (.Values.ui.enabled) and (.Values.ui.service) }}
{{- if (and (default .Values.server.enabled .Values.global.enabled) (default .Values.ui.enabled .Values.global.enabled) (default .Values.ui.service .Values.global.enabled)) }}
apiVersion: v1
kind: Service
metadata:

View file

@ -4,12 +4,19 @@
# be disabled if you plan on connecting to a Consul cluster external to
# the Kube cluster.
global:
# enabled is the master enabled switch. Setting this to true or false
# will enable or disable all the components within this chart by default.
# Each component can be overridden using the component-specific "enabled"
# value.
enabled: true
common:
# Domain to register the Consul DNS server to listen for.
domain: consul
server:
enabled: true
enabled: null
image: "consul:1.2.2"
replicas: 3
bootstrapExpect: 3 # Should <= replicas count
@ -39,7 +46,7 @@ server:
# disruptionBudget enables the creation of a PodDisruptionBudget to
# prevent voluntary degrading of the Consul server cluster.
disruptionBudget:
enabled: true
enabled: null
# maxUnavailable will default to (n/2)-1 where n is the number of
# replicas. If you'd like a custom value, you can specify an override here.
@ -54,13 +61,13 @@ server:
# within the Kube cluster. The current deployment model follows a traditional
# DC where a single agent is deployed per node.
client:
enabled: true
enabled: null
image: "consul:1.2.2"
join: null
# ConnectInject will enable the automatic Connect sidecar injector.
connectInject:
enabled: true
enabled: null
image: "us.gcr.io/mitchellh-k8s/consul-k8s:latest"
default: false # true will inject by default, otherwise requires annotation
caBundle: "" # empty will auto generate the bundle
@ -97,7 +104,7 @@ ui:
# on the server nodes. This makes UI access via the service below (if
# enabled) predictable rather than "any node" if you're running Consul
# clients as well.
enabled: true
enabled: null
# True if you want to create a Service entry for the Consul UI.
#