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
2 changes: 1 addition & 1 deletion grabdish/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.

#MS="frontend-helidon order-helidon supplier-helidon-se inventory-helidon inventory-springboot"
MS="frontend-helidon order-helidon supplier-helidon-se inventory-helidon foodwinepairing-python"
MS="frontend-helidon order-helidon supplier-helidon-se inventory-helidon"
for s in $MS; do
echo ________________________________________
echo "Deploying $s..."
Expand Down
8 changes: 7 additions & 1 deletion infra/k8s/oke/terraform/containerengine.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ resource "oci_containerengine_node_pool" "okell_node_pool" {
compartment_id = var.ociCompartmentOcid
kubernetes_version = var.kubernetes_version
name = "Pool"
node_shape = "VM.Standard.E2.1"
node_shape = "VM.Standard.E3.Flex"
node_config_details {
placement_configs {
availability_domain = data.oci_identity_availability_domain.ad1.name
Expand All @@ -51,6 +51,12 @@ resource "oci_containerengine_node_pool" "okell_node_pool" {
image_id = local.oracle_linux_images.0 # Latest
source_type = "IMAGE"
}

node_shape_config {
memory_in_gbs = 16 # Specify the memory size in GBs
ocpus = 1 # Specify the number of OCPUs
}

}

data "oci_containerengine_node_pool_option" "okell_node_pool_option" {
Expand Down
2 changes: 1 addition & 1 deletion infra/k8s/oke/terraform/main_var.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ variable "vcnOcid" {}
variable "kubernetes_version" {
description = "OKE Version"
type = string
default = "v1.29.1"
default = "v1.31.1"
}
48 changes: 3 additions & 45 deletions workshops/dcms-oci/config/threads/k8s/apply.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fi


# Wait for dependencies
DEPENDENCIES='COMPARTMENT_OCID OCI_REGION TENANCY_OCID OKE_LIMIT_CHECK'
DEPENDENCIES='COMPARTMENT_OCID OCI_REGION TENANCY_OCID'
while ! test -z "$DEPENDENCIES"; do
echo "Waiting for $DEPENDENCIES"
WAITING_FOR=""
Expand All @@ -24,48 +24,6 @@ while ! test -z "$DEPENDENCIES"; do
DEPENDENCIES="$WAITING_FOR"
sleep 1
done


# Provision the VCN, unless live labs
if ! state_done VCN_OCID; then
if test $(state_get RUN_TYPE) != "LL"; then
# Need to provision network
STATE=$DCMS_INFRA_STATE/network
mkdir -p $STATE
cd $STATE
cat >$STATE/input.env <<!
COMPARTMENT_OCID=$(state_get COMPARTMENT_OCID)
OCI_REGION=$(state_get OCI_REGION)
VCN_DNS_LABEL=dcmsoci
!
provisioning-apply $MSDD_INFRA_CODE/network/oci
(
source $STATE/output.env
state_set VCN_OCID "$VCN_OCID"
)
else
state_set VCN_OCID "NA"
fi
fi


# Provision OKE
if test $(state_get RUN_TYPE) == "LL"; then
# OKE is already provisioned. Just need to get the OKE OCID and configure kubectl
OKE_OCID=`oci ce cluster list --compartment-id "$(state_get COMPARTMENT_OCID)" --query "join(' ',data[?"'"lifecycle-state"'"=='ACTIVE'].id)" --raw-output`
oci ce cluster create-kubeconfig --cluster-id "$OKE_OCID" --file $HOME/.kube/config --region "$REGION" --token-version 2.0.0
else
STATE=$DCMS_INFRA_STATE/k8s
mkdir -p $STATE
cd $STATE
cat >$STATE/input.env <<!
COMPARTMENT_OCID=$(state_get COMPARTMENT_OCID)
OCI_REGION=$(state_get OCI_REGION)
TENANCY_OCID=$(state_get TENANCY_OCID)
VCN_OCID=$(state_get VCN_OCID)
!
provisioning-apply $MSDD_INFRA_CODE/k8s/oke
fi

state_set VCN_OCID "NA"
echo "" > $OUTPUT_FILE
state_set_done K8S_THREAD
#state_set_done K8S_THREAD
71 changes: 71 additions & 0 deletions workshops/dcms-oci/config/threads/k8s/apply0.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/bin/bash
# Copyright (c) 2021 Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.

# Fail on error
set -e


if ! provisioning-helper-pre-apply; then
exit 1
fi


# Wait for dependencies
DEPENDENCIES='COMPARTMENT_OCID OCI_REGION TENANCY_OCID OKE_LIMIT_CHECK'
while ! test -z "$DEPENDENCIES"; do
echo "Waiting for $DEPENDENCIES"
WAITING_FOR=""
for d in $DEPENDENCIES; do
if ! state_done $d; then
WAITING_FOR="$WAITING_FOR $d"
fi
done
DEPENDENCIES="$WAITING_FOR"
sleep 1
done


# Provision the VCN, unless live labs
if ! state_done VCN_OCID; then
if test $(state_get RUN_TYPE) != "LL"; then
# Need to provision network
STATE=$DCMS_INFRA_STATE/network
mkdir -p $STATE
cd $STATE
cat >$STATE/input.env <<!
COMPARTMENT_OCID=$(state_get COMPARTMENT_OCID)
OCI_REGION=$(state_get OCI_REGION)
VCN_DNS_LABEL=dcmsoci
!
provisioning-apply $MSDD_INFRA_CODE/network/oci
(
source $STATE/output.env
state_set VCN_OCID "$VCN_OCID"
)
else
state_set VCN_OCID "NA"
fi
fi


# Provision OKE
if test $(state_get RUN_TYPE) == "LL"; then
# OKE is already provisioned. Just need to get the OKE OCID and configure kubectl
OKE_OCID=`oci ce cluster list --compartment-id "$(state_get COMPARTMENT_OCID)" --query "join(' ',data[?"'"lifecycle-state"'"=='ACTIVE'].id)" --raw-output`
oci ce cluster create-kubeconfig --cluster-id "$OKE_OCID" --file $HOME/.kube/config --region "$REGION" --token-version 2.0.0
else
STATE=$DCMS_INFRA_STATE/k8s
mkdir -p $STATE
cd $STATE
cat >$STATE/input.env <<!
COMPARTMENT_OCID=$(state_get COMPARTMENT_OCID)
OCI_REGION=$(state_get OCI_REGION)
TENANCY_OCID=$(state_get TENANCY_OCID)
VCN_OCID=$(state_get VCN_OCID)
!
provisioning-apply $MSDD_INFRA_CODE/k8s/oke
fi

echo "" > $OUTPUT_FILE
state_set_done K8S_THREAD