Skip to content

Conversation

@galiacheng
Copy link
Contributor

@galiacheng galiacheng commented Jan 21, 2022

This pr includes script changes to v3.3 for Azure NFS share in the domain on a PV sample of AKS.

Workflow to test the script: https://github.com/galiacheng/weblogic-kubernetes-operator/runs/4916604379?check_suite_focus=true

A live doc for review: https://zealous-dune-0dac9090f.1.azurestaticapps.net/samples/azure-kubernetes-service/domain-on-pv

Changes to be committed:
modified: kubernetes/samples/scripts/common/utility.sh
new file: kubernetes/samples/scripts/create-weblogic-domain-on-azure-kubernetes-service/azure-csi-storageaccount-template.yaml
deleted: kubernetes/samples/scripts/create-weblogic-domain-on-azure-kubernetes-service/azure-file-pv-template.yaml
modified: kubernetes/samples/scripts/create-weblogic-domain-on-azure-kubernetes-service/azure-file-pvc-template.yaml
modified: kubernetes/samples/scripts/create-weblogic-domain-on-azure-kubernetes-service/create-domain-on-aks-inputs.yaml
modified: kubernetes/samples/scripts/create-weblogic-domain-on-azure-kubernetes-service/create-domain-on-aks.sh
modified: kubernetes/samples/scripts/create-weblogic-domain-on-azure-kubernetes-service/validate.sh

Signed-off-by: galiacheng haixia.cheng@microsoft.com

 Changes to be committed:
	modified:   kubernetes/samples/scripts/common/utility.sh
	new file:   kubernetes/samples/scripts/create-weblogic-domain-on-azure-kubernetes-service/azure-csi-storageaccount-template.yaml
	deleted:    kubernetes/samples/scripts/create-weblogic-domain-on-azure-kubernetes-service/azure-file-pv-template.yaml
	modified:   kubernetes/samples/scripts/create-weblogic-domain-on-azure-kubernetes-service/azure-file-pvc-template.yaml
	modified:   kubernetes/samples/scripts/create-weblogic-domain-on-azure-kubernetes-service/create-domain-on-aks-inputs.yaml
	modified:   kubernetes/samples/scripts/create-weblogic-domain-on-azure-kubernetes-service/create-domain-on-aks.sh
	modified:   kubernetes/samples/scripts/create-weblogic-domain-on-azure-kubernetes-service/validate.sh

Signed-off-by: galiacheng <haixia.cheng@microsoft.com>
@galiacheng galiacheng changed the title Update aks sample script with azure NFS share for storage Update aks sample script with Azure NFS share for storage Jan 21, 2022
@robertpatrick
Copy link
Member

@galiacheng Please assign reviewers for this PR...

@galiacheng
Copy link
Contributor Author

Hello @robertpatrick I cannot select any reviewer, could you assign the pr to @rjeberhard and @mriccell, thank you!

Copy link

@tbarnes-us tbarnes-us left a comment

Choose a reason for hiding this comment

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

I only have minor comments. They don't need to block the pull, but you may want to follow up on them.

attempts=$((attempts + 1))
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.

nameAvailable=$(echo "$ret" | grep "nameAvailable" | grep "false")
if [ -n "$nameAvailable" ]; then
echo $ret
fail "Storage account ${aksClusterName} is unavaliable."

Choose a reason for hiding this comment

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

Minor: unavaliable --> unavailable

--name ${azureStorageShareName} \
--enabled-protocol NFS \
--root-squash NoRootSquash \
--quota 100
Copy link

@tbarnes-us tbarnes-us Jan 24, 2022

Choose a reason for hiding this comment

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

Minor: If you want to aid with tracing/debugging throughout, maybe consider pattern like:

local cmd="az storage share-rm create ... --quota 100"
echo "Running cmd '$cmd'"
$cmd

Since az is used so frequently, you could make a helper function that does this:

runCmd () {
  echo "about to run '$*'"
  $*
}

runCmd ls /tmp/*.log ~/*.sh

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a very useful idea to deal with the commands in a same pattern.

local cmd="..." get the output message, while we want to keep the progress message during the az command is running, I will keep the script as it's.


function configureStorageAccountNetwork {
# get the resource group name of the AKS managed resources
aksMCRGName=$(az aks show --name $aksClusterName --resource-group $azureResourceGroupName -o tsv --query "nodeResourceGroup")

Choose a reason for hiding this comment

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

minor: define all local variables as "local"

attempts=0
svcState="running"
while [ ! "$svcState" == "completed" ] && [ ! $attempts -eq 30 ]; do
attempts=0

Choose a reason for hiding this comment

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

minor: local

Signed-off-by: galiacheng <haixia.cheng@microsoft.com>

 Changes to be committed:
	modified:   samples/scripts/common/utility.sh
	modified:   samples/scripts/create-weblogic-domain-on-azure-kubernetes-service/create-domain-on-aks.sh
Signed-off-by: galiacheng <haixia.cheng@microsoft.com>

 Changes to be committed:
	modified:   samples/scripts/common/utility.sh
@galiacheng
Copy link
Contributor Author

@robertpatrick robertpatrick merged commit 13c3959 into oracle:release/3.3 Jan 26, 2022
rjeberhard pushed a commit to rjeberhard/weblogic-kubernetes-operator that referenced this pull request Jun 7, 2023
Update aks sample script with Azure NFS share for storage
rjeberhard pushed a commit to rjeberhard/weblogic-kubernetes-operator that referenced this pull request Jun 7, 2023
Update aks sample script with Azure NFS share for storage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants