diff --git a/OWNERS b/OWNERS index c149c5721d2..616fc22aff0 100644 --- a/OWNERS +++ b/OWNERS @@ -1,5 +1,3 @@ approvers: -- jberkhahn -- mhbauer - piotrmiskiewicz - jhvhs diff --git a/charts/catalog/Chart.yaml b/charts/catalog/Chart.yaml index cb0705a6fc1..72051d399d4 100644 --- a/charts/catalog/Chart.yaml +++ b/charts/catalog/Chart.yaml @@ -1,4 +1,4 @@ apiVersion: v1 name: catalog description: service-catalog webhook server and controller-manager helm chart -version: 0.3.1 +version: 0.3.2 diff --git a/charts/catalog/README.md b/charts/catalog/README.md index 32c79fca5ea..23c52a89d1c 100644 --- a/charts/catalog/README.md +++ b/charts/catalog/README.md @@ -76,9 +76,13 @@ chart and their default values. | `rbacEnable` | If true, create & use RBAC resources | `true` | | `originatingIdentityEnabled` | Whether the OriginatingIdentity feature should be enabled | `true` | | `persistence.storageClass` | Define the storageclass use by pvc | `null` | +| `affinity` | Affinity settings ([docs](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity)) | `{}` | | `asyncBindingOperationsEnabled` | Whether or not alpha support for async binding operations is enabled | `false` | | `namespacedServiceBrokerDisabled` | Whether or not alpha support for namespace scoped brokers is disabled | `false` | +| `nodeSelector` | Node labels for pod assignment (global parameter for all pods) | `{}` | +| `podLabels` | Additional pod labels to include for all pods | `{}` | | `priorityClassName` | Define PriorityClass for pods | "" | +| `tolerations` | Tolerations for pod assignment | `[]` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. diff --git a/charts/catalog/templates/cleaner-job.yaml b/charts/catalog/templates/cleaner-job.yaml index da173efbda7..329ac3e88c7 100644 --- a/charts/catalog/templates/cleaner-job.yaml +++ b/charts/catalog/templates/cleaner-job.yaml @@ -90,12 +90,18 @@ spec: template: metadata: labels: + {{- if .Values.podLabels }} + {{- tpl (toYaml .Values.podLabels) $ | nindent 8 }} + {{- end }} cleaner-job: "true" app: {{ template "fullname" . }}-clean-job chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: + {{- if .Values.priorityClassName }} + priorityClassName: {{ .Values.priorityClassName | quote }} + {{- end }} {{- with .Values.securityContext }} securityContext: {{ toYaml . | indent 8 }} @@ -118,3 +124,14 @@ spec: - {{ template "fullname" . }}-controller-manager - --webhook-configurations - {{ template "fullname" . }}-webhook {{ template "fullname" . }}-validating-webhook +{{- with .Values.affinity }} + affinity: {{- tpl (toYaml .) $ | nindent 8 }} +{{- end }} +{{- with .Values.nodeSelector }} + nodeSelector: +{{ toYaml . | indent 8 }} +{{- end }} +{{- with .Values.tolerations }} + tolerations: +{{ toYaml . | indent 8 }} +{{- end }} diff --git a/charts/catalog/templates/controller-manager-deployment.yaml b/charts/catalog/templates/controller-manager-deployment.yaml index d91fa919498..8a438094719 100644 --- a/charts/catalog/templates/controller-manager-deployment.yaml +++ b/charts/catalog/templates/controller-manager-deployment.yaml @@ -18,10 +18,13 @@ spec: metadata: annotations: prometheus.io/scrape: "{{ .Values.controllerManager.enablePrometheusScrape }}" - {{ if .Values.controllerManager.annotations }} + {{- if .Values.controllerManager.annotations }} {{ toYaml .Values.controllerManager.annotations | indent 8 }} {{- end }} labels: + {{- if .Values.podLabels }} + {{- tpl (toYaml .Values.podLabels) $ | nindent 8 }} + {{- end }} app: {{ template "fullname" . }}-controller-manager chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" @@ -131,7 +134,14 @@ spec: successThreshold: 1 timeoutSeconds: 5 {{- end }} - {{ if .Values.controllerManager.nodeSelector }} +{{- with .Values.affinity }} + affinity: {{- tpl (toYaml .) $ | nindent 8 }} +{{- end }} + {{- if or .Values.controllerManager.nodeSelector .Values.nodeSelector }} nodeSelector: -{{ toYaml .Values.controllerManager.nodeSelector | indent 8 }} - {{ end }} +{{ toYaml (mustMerge .Values.controllerManager.nodeSelector .Values.nodeSelector) | indent 8 }} + {{- end }} +{{- with .Values.tolerations }} + tolerations: +{{ toYaml . | indent 8 }} +{{- end }} diff --git a/charts/catalog/templates/migration-job.yaml b/charts/catalog/templates/migration-job.yaml index f2d60cc67a5..c98d76c3881 100644 --- a/charts/catalog/templates/migration-job.yaml +++ b/charts/catalog/templates/migration-job.yaml @@ -106,12 +106,18 @@ spec: template: metadata: labels: + {{- if .Values.podLabels }} + {{- tpl (toYaml .Values.podLabels) $ | nindent 8 }} + {{- end }} migration-job: "true" app: {{ template "fullname" . }}-migration-job chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: + {{- if .Values.priorityClassName }} + priorityClassName: {{ .Values.priorityClassName | quote }} + {{- end }} {{- with .Values.securityContext }} securityContext: {{ toYaml . | indent 8 }} @@ -146,3 +152,14 @@ spec: volumeMounts: - name: storage mountPath: /data +{{- with .Values.affinity }} + affinity: {{- tpl (toYaml .) $ | nindent 8 }} +{{- end }} +{{- with .Values.nodeSelector }} + nodeSelector: +{{ toYaml . | indent 8 }} +{{- end }} +{{- with .Values.tolerations }} + tolerations: +{{ toYaml . | indent 8 }} +{{- end }} diff --git a/charts/catalog/templates/pre-migration-job.yaml b/charts/catalog/templates/pre-migration-job.yaml index b42fa463c14..84f783f10f2 100644 --- a/charts/catalog/templates/pre-migration-job.yaml +++ b/charts/catalog/templates/pre-migration-job.yaml @@ -120,12 +120,18 @@ spec: template: metadata: labels: + {{- if .Values.podLabels }} + {{- tpl (toYaml .Values.podLabels) $ | nindent 8 }} + {{- end }} migration-job: "true" app: {{ template "fullname" . }}-pre-migration-job chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: + {{- if .Values.priorityClassName }} + priorityClassName: {{ .Values.priorityClassName | quote }} + {{- end }} {{- with .Values.securityContext }} securityContext: {{ toYaml . | indent 8 }} @@ -156,3 +162,14 @@ spec: volumeMounts: - name: storage mountPath: /data +{{- with .Values.affinity }} + affinity: {{- tpl (toYaml .) $ | nindent 8 }} +{{- end }} +{{- with .Values.nodeSelector }} + nodeSelector: +{{ toYaml . | indent 8 }} +{{- end }} +{{- with .Values.tolerations }} + tolerations: +{{ toYaml . | indent 8 }} +{{- end }} diff --git a/charts/catalog/templates/webhook-deployment.yaml b/charts/catalog/templates/webhook-deployment.yaml index 10ee16070ef..60afdbec9d7 100644 --- a/charts/catalog/templates/webhook-deployment.yaml +++ b/charts/catalog/templates/webhook-deployment.yaml @@ -17,12 +17,15 @@ spec: template: metadata: labels: + {{- if .Values.podLabels }} + {{- tpl (toYaml .Values.podLabels) $ | nindent 8 }} + {{- end }} app: {{ template "fullname" . }}-webhook chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" releaseRevision: "{{ .Release.Revision }}" heritage: "{{ .Release.Service }}" - {{ if .Values.webhook.annotations }} + {{- if .Values.webhook.annotations }} annotations: {{ toYaml .Values.webhook.annotations | indent 8 }} {{- end }} @@ -87,10 +90,17 @@ spec: successThreshold: 1 timeoutSeconds: 5 {{- end }} - {{ if .Values.webhook.nodeSelector }} +{{- with .Values.affinity }} + affinity: {{- tpl (toYaml .) $ | nindent 8 }} +{{- end }} + {{- if or .Values.webhook.nodeSelector .Values.nodeSelector }} nodeSelector: -{{ toYaml .Values.webhook.nodeSelector | indent 8 }} - {{ end }} +{{ toYaml (mustMerge .Values.webhook.nodeSelector .Values.nodeSelector) | indent 8 }} + {{- end }} +{{- with .Values.tolerations }} + tolerations: +{{ toYaml . | indent 8 }} +{{- end }} volumes: - name: service-catalog-webhook-cert secret: diff --git a/charts/catalog/values.yaml b/charts/catalog/values.yaml index b83ef6a7647..50b1ee86333 100644 --- a/charts/catalog/values.yaml +++ b/charts/catalog/values.yaml @@ -20,7 +20,7 @@ webhook: # annotations is a collection of annotations to add to the webhook pods. annotations: {} # nodeSelector to apply to the webhook pods - nodeSelector: + nodeSelector: {} # healthcheck configures the readiness and liveliness probes for the webhook pod. healthcheck: enabled: true @@ -59,7 +59,7 @@ controllerManager: # annotations is a collection of annotations to add to the controllerManager pod. annotations: {} # nodeSelector to apply to the controllerManager pods - nodeSelector: + nodeSelector: {} # healthcheck configures the readiness and liveliness probes for the controllerManager pod. healthcheck: enabled: true @@ -108,6 +108,9 @@ controllerManager: # Available port in allowable range (e.g. 30000 - 32767 on minikube) # The TLS-enabled endpoint will be exposed here securePort: 30444 + +affinity: {} + # Whether the OriginatingIdentity feature should be enabled originatingIdentityEnabled: true # Whether the AsyncBindingOperations alpha feature should be enabled @@ -132,7 +135,13 @@ persistence: ## storageClass: +nodeSelector: {} + +podLabels: {} + # Leverage a PriorityClass to ensure your pods survive resource shortages # ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ # PriorityClass: system-cluster-critical priorityClassName: "" + +tolerations: [] \ No newline at end of file diff --git a/docs/walkthrough.md b/docs/walkthrough.md index 7ffdb0614a8..4287399ef95 100644 --- a/docs/walkthrough.md +++ b/docs/walkthrough.md @@ -31,6 +31,13 @@ Otherwise, to install with sensible defaults, run the following command: ```console helm repo add minibroker https://minibroker.blob.core.windows.net/charts +``` +If you are using Helm v3, run this command: +```console +helm install minibroker minibroker/minibroker --namespace minibroker --create-namespace +``` +For older versions of Helm, use the --name option: +```console helm install --name minibroker --namespace minibroker minibroker/minibroker ``` @@ -459,7 +466,14 @@ No resources found. # Step 9 - Final Cleanup -To clean up minibroker deployment, delete the helm release: +To clean up minibroker deployment, delete the helm release. + +If you are using Helm v3, run this command: + +```console +helm delete minibroker +``` +For older versions of Helm, use the --purge option: ```console helm delete --purge minibroker diff --git a/pkg/controller/controller_instance.go b/pkg/controller/controller_instance.go index 36bd0e8ed30..4250634995b 100644 --- a/pkg/controller/controller_instance.go +++ b/pkg/controller/controller_instance.go @@ -89,7 +89,7 @@ const ( asyncDeprovisioningReason string = "Deprovisioning" asyncDeprovisioningMessage string = "The instance is being deprovisioned asynchronously" serviceBindingsDeletionReason string = "ServiceBindingsDeletion" - serviceBindingsDeletionMessage string = "The instance's service bindings is beaing deleted" + serviceBindingsDeletionMessage string = "The instance's service bindings are being deleted" provisioningInFlightReason string = "ProvisionRequestInFlight" provisioningInFlightMessage string = "Provision request for ServiceInstance in-flight to Broker" instanceUpdatingInFlightReason string = "UpdateInstanceRequestInFlight" @@ -3007,6 +3007,9 @@ func (c *controller) triggerServiceBindingReconciliation(instance *v1beta1.Servi } klog.V(4).Infof("ServiceBinding %s/%s triggered to reconciliation", binding.Namespace, binding.Name) toUpdate := binding.DeepCopy() + if toUpdate.Annotations == nil { + toUpdate.Annotations = make(map[string]string, 0) + } toUpdate.ObjectMeta.Annotations["reconciliationTriggered"] = metav1.Now().String() if _, err := c.serviceCatalogClient.ServiceBindings(toUpdate.Namespace).Update(context.Background(), toUpdate, metav1.UpdateOptions{}); err != nil { klog.Errorf("Couldn't update ServiceBinding %q status for instance %q. Bindings will be triggered after set delay. error: %v", binding.Name, binding.Spec.InstanceRef.Name, err) diff --git a/pkg/controller/controller_instance_test.go b/pkg/controller/controller_instance_test.go index 1b96566dd72..5c93df4e5e2 100644 --- a/pkg/controller/controller_instance_test.go +++ b/pkg/controller/controller_instance_test.go @@ -624,6 +624,8 @@ func TestReconcileServiceInstanceWithParameters(t *testing.T) { sharedInformers.ClusterServiceBrokers().Informer().GetStore().Add(getTestClusterServiceBroker()) sharedInformers.ClusterServiceClasses().Informer().GetStore().Add(getTestClusterServiceClass()) sharedInformers.ClusterServicePlans().Informer().GetStore().Add(getTestClusterServicePlan()) + credentials := getTestServiceBinding() + sharedInformers.ServiceBindings().Informer().GetStore().Add(credentials) for _, s := range tc.secrets { fakeKubeClient.PrependReactor("get", "secrets", func(action clientgotesting.Action) (bool, runtime.Object, error) { @@ -739,7 +741,8 @@ func TestReconcileServiceInstanceWithParameters(t *testing.T) { }) actions = fakeCatalogClient.Actions() - assertNumberOfActions(t, actions, 1) + assertNumberOfActions(t, actions, 2) + assertUpdate(t, actions[1], credentials) updatedServiceInstance = assertUpdateStatus(t, actions[0], instance) assertServiceInstanceOperationSuccessWithParameters(t, updatedServiceInstance,