Skip to content

Commit af30011

Browse files
Merge pull request #2726 from galiacheng/release/3.3
Update aks sample script with Azure NFS share for storage
2 parents e6f52e5 + 740d956 commit af30011

File tree

7 files changed

+233
-275
lines changed

7 files changed

+233
-275
lines changed

kubernetes/samples/scripts/common/utility.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,23 @@ function checkPvState {
185185
fi
186186
}
187187

188+
#
189+
# Check the state of a persistent volume claim.
190+
# $1 - name of volume claim
191+
# $2 - expected state of volume claim
192+
function checkPvcState {
193+
echo "Checking if the persistent volume claim ${1:?} is ${2:?}"
194+
local end_secs=$((SECONDS + 30))
195+
local pvc_state=`kubectl get pvc $1 -o jsonpath='{.status.phase}'`
196+
while [ ! "$pvc_state" = "$2" ] && [ $SECONDS -le $end_secs ]; do
197+
sleep 1
198+
pvc_state=`kubectl get pvc $1 -o jsonpath='{.status.phase}'`
199+
done
200+
if [ "$pvc_state" != "$2" ]; then
201+
fail "The persistent volume state should be $2 but is $pvc_state"
202+
fi
203+
}
204+
188205
#
189206
# Function to check if a persistent volume exists
190207
# $1 - name of volume
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
apiVersion: storage.k8s.io/v1
5+
kind: StorageClass
6+
metadata:
7+
name: %STORAGE_CLASS_NAME%
8+
provisioner: file.csi.azure.com
9+
parameters:
10+
protocol: nfs
11+
resourceGroup: %STORAGE_ACCOUNT_RESOURCE_GROUP_NAME%
12+
storageAccount: %STORAGE_ACCOUNT_NAME%
13+
shareName: %AZURE_FILE_SHARE_NAME%
14+
reclaimPolicy: Delete
15+
volumeBindingMode: Immediate
16+
allowVolumeExpansion: true

kubernetes/samples/scripts/create-weblogic-domain-on-azure-kubernetes-service/azure-file-pv-template.yaml

Lines changed: 0 additions & 27 deletions
This file was deleted.

kubernetes/samples/scripts/create-weblogic-domain-on-azure-kubernetes-service/azure-file-pvc-template.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,4 @@ spec:
1111
storageClassName: %STORAGE_CLASS_NAME%
1212
resources:
1313
requests:
14-
storage: 10Gi
15-
selector:
16-
matchLabels:
17-
usage: %PERSISTENT_VOLUME_CLAIM_NAME%
14+
storage: 100Gi

kubernetes/samples/scripts/create-weblogic-domain-on-azure-kubernetes-service/create-domain-on-aks-inputs.yaml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,6 @@ azureKubernetesNodeVMSize: Standard_DS2_v2
5353
# The suffix of azure kubernetes node pool name, the azure kubernetes node pool name will be${azureKubernetesNodepoolNamePrefix} ${namePrefix}.
5454
azureKubernetesNodepoolNamePrefix: pool1
5555

56-
# SKU of azure storage account, used to create storage account.
57-
azureStorageAccountSku: Standard_LRS
58-
59-
# Name of Azure Storage Class. We will use initial StorageClasses azurefile.
60-
# If you want to create new class, follow the document: https://docs.microsoft.com/en-us/azure/aks/azure-files-dynamic-pv#create-a-storage-class.
61-
# Go to this page for more details: https://docs.microsoft.com/en-us/azure/aks/concepts-storage#storage-classes
62-
azureStorageClassName: azurefile
63-
64-
# The suffix of azure storage file share name, the complete value is ${namePrefix}-${azureStorageShareNameSuffix}-<timestamp>, used to create file share, and mount file share.
65-
azureStorageShareNameSuffix: weblogic
66-
6756
#Java Option for WebLogic Server
6857
javaOptions: -Dweblogic.StdoutDebugEnabled=false -XX:MinRAMPercentage=25.0 -XX:MaxRAMPercentage=50.0
6958

@@ -72,6 +61,12 @@ javaOptions: -Dweblogic.StdoutDebugEnabled=false -XX:MinRAMPercentage=25.0 -XX:M
7261
# Parameter "imagePullSecretName" will be overwritten with this field in kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain-inputs.yaml
7362
imagePullSecretNameSuffix: regcred
7463

64+
# Storage class name for Azure Files using Container Storage Interface driver, see https://docs.microsoft.com/en-us/azure/aks/azure-files-csi#nfs-file-shares
65+
azureFileCsiNfsClassName: azurefile-csi-nfs
66+
67+
# The suffix of azure storage file share name, the complete value is ${namePrefix}-${azureStorageShareNameSuffix}-<timestamp>, used to create file share, and mount file share.
68+
azureStorageShareNameSuffix: weblogic
69+
7570
# Resource request for each server pod (Memory and CPU). This is minimum amount of compute
7671
# resources required for each server pod. Edit value(s) below as per pod sizing requirements.
7772
# These are optional

0 commit comments

Comments
 (0)