Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions kubernetes/samples/scripts/common/utility.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,23 @@ function checkPvState {
fi
}

#
# Check the state of a persistent volume claim.
# $1 - name of volume claim
# $2 - expected state of volume claim
function checkPvcState {
echo "Checking if the persistent volume claim ${1:?} is ${2:?}"
local end_secs=$((SECONDS + 30))
local pvc_state=`kubectl get pvc $1 -o jsonpath='{.status.phase}'`
while [ ! "$pvc_state" = "$2" ] && [ $SECONDS -le $end_secs ]; do
sleep 1
pvc_state=`kubectl get pvc $1 -o jsonpath='{.status.phase}'`
done

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a couple of minor comments:

  1. You can check "SECONDS" checks instead of using "attempt count" math to implement timeouts in shell, since SECONDS contains the time since the script started. ("local end_secs=$(SECONDS + 10)" and "[ $SECONDS -le $end_secs]")

  2. attempts should be declared local

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, I love the SECONDS method, it will be more accurate.

if [ "$pvc_state" != "$2" ]; then
fail "The persistent volume state should be $2 but is $pvc_state"
fi
}

#
# Function to check if a persistent volume exists
# $1 - name of volume
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: %STORAGE_CLASS_NAME%
provisioner: file.csi.azure.com
parameters:
protocol: nfs
resourceGroup: %STORAGE_ACCOUNT_RESOURCE_GROUP_NAME%
storageAccount: %STORAGE_ACCOUNT_NAME%
shareName: %AZURE_FILE_SHARE_NAME%
reclaimPolicy: Delete
volumeBindingMode: Immediate
allowVolumeExpansion: true

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,4 @@ spec:
storageClassName: %STORAGE_CLASS_NAME%
resources:
requests:
storage: 10Gi
selector:
matchLabels:
usage: %PERSISTENT_VOLUME_CLAIM_NAME%
storage: 100Gi
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,6 @@ azureKubernetesNodeVMSize: Standard_DS2_v2
# The suffix of azure kubernetes node pool name, the azure kubernetes node pool name will be${azureKubernetesNodepoolNamePrefix} ${namePrefix}.
azureKubernetesNodepoolNamePrefix: pool1

# SKU of azure storage account, used to create storage account.
azureStorageAccountSku: Standard_LRS

# Name of Azure Storage Class. We will use initial StorageClasses azurefile.
# 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.
# Go to this page for more details: https://docs.microsoft.com/en-us/azure/aks/concepts-storage#storage-classes
azureStorageClassName: azurefile

# The suffix of azure storage file share name, the complete value is ${namePrefix}-${azureStorageShareNameSuffix}-<timestamp>, used to create file share, and mount file share.
azureStorageShareNameSuffix: weblogic

#Java Option for WebLogic Server
javaOptions: -Dweblogic.StdoutDebugEnabled=false -XX:MinRAMPercentage=25.0 -XX:MaxRAMPercentage=50.0

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

# 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
azureFileCsiNfsClassName: azurefile-csi-nfs

# The suffix of azure storage file share name, the complete value is ${namePrefix}-${azureStorageShareNameSuffix}-<timestamp>, used to create file share, and mount file share.
azureStorageShareNameSuffix: weblogic

# Resource request for each server pod (Memory and CPU). This is minimum amount of compute
# resources required for each server pod. Edit value(s) below as per pod sizing requirements.
# These are optional
Expand Down
Loading