Because of issues discovered with AzureFile and RabbitMQ, it is necessary to create a new custom StorageClass and configure the security context for RabbitMQ when upgrading to Black Duck 2021.2.1.

1. Create a new custom storageClass for rabbitmq using the following yaml file.

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: bd-rabbitmq-azurefile
provisioner: kubernetes.io/azure-file
mountOptions:
  - dir_mode=0700
  - file_mode=0700
  - uid=100
  - gid=101
  - mfsymlinks
  - cache=strict
  - actimeo=30
parameters:
  skuName: Standard_LRS

2.  Scale rabbitmq replicas to 0

kubectl scale deploy <install-name>-blackduck-rabbitmq --replicas=0

3.  Delete the existing PVC for RabbitMQ 

kubectl delete pvc <pvc id of rabbitmq>

4.  Configure the securityContext and storage class defined in the T-Shirt file provided with the Synopsys Helm charts. 

rabbitmq:
  storageClass: "bd-rabbitmq-azurefile"
  podSecurityContext:
    runAsUser: 100
    fsGroup: 101

5.  Run helm upgrade  

helm upgrade <release_name> . -f values.yaml -f medium.yaml

 If you don't delete the PVC you'll get an expected error: Error: UPGRADE FAILED: cannot patch " "hub-k8s-blackduck-rabbitmq" with kind PersistentVolumeClaim: PersistentVolumeClaim "hub-k8s-blackduck-rabbitmq" is invalid: spec: Forbidden: is immutable after creation except resources.requests for bound claims