Skip to content

Latest commit

 

History

History

azure-storageclass

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Setup Prometheus

Follow instructions in that repo : https://github.com/coreos/prometheus-operator/tree/master/contrib/kube-prometheus

Azure Disk

To reuse a disk, in the volumes section, instead of azureFile, first delete the pv already generated by the storage class, then use :

Setup Storage class

Reference : https://github.com/kubernetes/examples/blob/master/staging/volumes/azure_disk/claim/managed-disk/managed-hdd/storageclass-managed-hdd.yaml

Reusing a disk

          azureDisk:
            diskName: kubernetes-dynamic-pvc-xxxxxxx
            diskURI: /subscriptions/[sub-id]/resourcegroups/[rg-name/]providers/microsoft.Compute/disks/[disk-name]

Ref : https://github.com/kubernetes/examples/blob/master/staging/volumes/azure_disk/azure.yaml

Azure File

Note : It doesn't work with gitlab as a volume because gitlab wants to change permissions and it's apparently not possible with storage account. Use a Azure Disk instead.

Setup storage class

Create a storage account on Azure named, say, testttauveron Ref : https://docs.microsoft.com/en-us/azure/storage/blobs/storage-how-to-use-blobs-cli

It must use the same resource-group than AKS-agentpool in Azure

Reusing Azure volume

To reuse the volume storageclass has created, for example, if we have deleted the pvc, we have to delete first the pv with kubectl. The volume is still available in Storage account on Azure. Then we want to reuse that volume.

apiVersion: v1
kind: Secret
metadata:
  name: azure-secret
type: Opaque
data:
  azurestorageaccountname: [base64encoded storageaccountname]
  azurestorageaccountkey: [base64encoded storageaccountkey]

Note : On azure, Storage account > Access key > Choose a Key The key seems already encoded, but you still have to encode it in base64

Then in the gitlab pod :

      volumes:
        - name: "data"
#          persistentVolumeClaim:
#            claimName: mypvc
          azureFile:
            secretName: azure-storage-account-testttauveron-secret
            shareName: kubernetes-dynamic-pvc-xxxxxxxx
            readOnly: false
  • secretName should be created by storageclass
kubectl get secret [secretname] -o yaml