Skip to content

Commit ffb0869

Browse files
verrazzano/multi-cloud work (#35)
* dotnet inventorylocation query * dotnet inventorylocation query * inventory-go work * inventory-go work * inventory-go aq dequeue added * inventory-go working with pl/sql * dotnet and go services: switch to polling for msgs * verrazzano/multi-cloud work * verrazzano comp files * verrazzano/multi-cloud work
1 parent e455fa8 commit ffb0869

32 files changed

+1207
-0
lines changed

README-multicloud.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
1. Do lab 1
3+
2. Run ./setup-multicloud.sh
4+
3. Do lab 2 and 3 which tests the app, etc.
5+
4. Use URLs and login from output in step 2 to look at Grafana, etc.

grabdish/deploy-multicloud.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
# Copyright (c) 2021 Oracle and/or its affiliates.
3+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
4+
5+
MS="frontend-helidon order-helidon supplier-helidon-se inventory-helidon"
6+
for s in $MS; do
7+
echo ________________________________________
8+
echo "Deploying $s..."
9+
echo ________________________________________
10+
cd $GRABDISH_HOME/$s
11+
./deploy-verrazzano.sh
12+
cd $GRABDISH_HOME
13+
done
14+
15+
echo ________________________________________
16+
echo ...finished
17+
echo ________________________________________

grabdish/destroy-multicloud.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
# Copyright (c) 2021 Oracle and/or its affiliates.
3+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
4+
5+
# The following uninstall of Verrazzano is taken directly from https://verrazzano.io/docs/setup/quickstart/
6+
7+
echo Deleting the Verrazzano custom resource....
8+
kubectl delete verrazzano example-verrazzano
9+
10+
#(Optional) View the uninstall logs.
11+
#kubectl logs -f \
12+
# $( \
13+
# kubectl get pod \
14+
# -l job-name=verrazzano-uninstall-example-verrazzano \
15+
# -o jsonpath="{.items[0].metadata.name}" \
16+
# )
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
## Copyright (c) 2021 Oracle and/or its affiliates.
3+
## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
4+
5+
6+
SCRIPT_DIR=$(dirname $0)
7+
8+
export DOCKER_REGISTRY="$(state_get DOCKER_REGISTRY)"
9+
export ORDER_PDB_NAME="$(state_get ORDER_DB_NAME)"
10+
export OCI_REGION="$(state_get OCI_REGION)"
11+
export VAULT_SECRET_OCID=""
12+
13+
echo create order-helidon deployment and service...
14+
export CURRENTTIME=$( date '+%F_%H:%M:%S' )
15+
echo CURRENTTIME is $CURRENTTIME ...this will be appended to generated deployment yaml
16+
17+
cp order-helidon-comp.yaml order-helidon-comp-$CURRENTTIME.yaml
18+
19+
#may hit sed incompat issue with mac
20+
sed -i "s|%DOCKER_REGISTRY%|${DOCKER_REGISTRY}|g" order-helidon-comp-$CURRENTTIME.yaml
21+
sed -i "s|%ORDER_PDB_NAME%|${ORDER_PDB_NAME}|g" order-helidon-comp-${CURRENTTIME}.yaml
22+
sed -i "s|%OCI_REGION%|${OCI_REGION}|g" order-helidon-comp-${CURRENTTIME}.yaml
23+
sed -i "s|%VAULT_SECRET_OCID%|${VAULT_SECRET_OCID}|g" order-helidon-comp-${CURRENTTIME}.yaml
24+
25+
if [ -z "$1" ]; then
26+
kubectl apply -f $SCRIPT_DIR/order-helidon-comp-$CURRENTTIME.yaml
27+
# kubectl apply -f $SCRIPT_DIR/order-helidon-app.yaml
28+
else
29+
kubectl apply -f <(istioctl kube-inject -f $SCRIPT_DIR/order-helidon-comp-$CURRENTTIME.yaml) -n msdataworkshop
30+
fi
31+
32+
#kubectl apply -f $SCRIPT_DIR/order-service.yaml -n msdataworkshop
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright (c) 2020, 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+
apiVersion: core.oam.dev/v1alpha2
4+
kind: ApplicationConfiguration
5+
metadata:
6+
name: order-helidon-appconf
7+
namespace: msdataworkshop
8+
annotations:
9+
version: v1.0.0
10+
description: "Order Helidon application"
11+
spec:
12+
components:
13+
- componentName: order-helidon-component
14+
traits:
15+
- trait:
16+
apiVersion: oam.verrazzano.io/v1alpha1
17+
kind: MetricsTrait
18+
spec:
19+
scraper: verrazzano-system/vmi-system-prometheus-0
20+
# - trait:
21+
# apiVersion: oam.verrazzano.io/v1alpha1
22+
# kind: IngressTrait
23+
# metadata:
24+
# name: order-helidon-ingress
25+
# spec:
26+
# rules:
27+
# - paths:
28+
# - path: "/command"
29+
# pathType: Prefix
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright (c) 2020, 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+
apiVersion: core.oam.dev/v1alpha2
4+
kind: Component
5+
metadata:
6+
name: inventory-helidon-component
7+
namespace: inventory-helidon
8+
spec:
9+
workload:
10+
apiVersion: oam.verrazzano.io/v1alpha1
11+
kind: VerrazzanoHelidonWorkload
12+
metadata:
13+
name: inventory-helidon-workload
14+
labels:
15+
app: inventory-helidon
16+
spec:
17+
deploymentTemplate:
18+
metadata:
19+
name: inventory-helidon-deployment
20+
podSpec:
21+
containers:
22+
- name: frontend
23+
image: %DOCKER_REGISTRY%/frontend-helidon:0.1
24+
imagePullPolicy: Always
25+
env:
26+
- name: SECRETS_PASSWORD
27+
valueFrom:
28+
secretKeyRef:
29+
name: frontendadmin
30+
key: password
31+
ports:
32+
- containerPort: 8080
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
## Copyright (c) 2021 Oracle and/or its affiliates.
3+
## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
4+
5+
6+
SCRIPT_DIR=$(dirname $0)
7+
8+
export DOCKER_REGISTRY="$(state_get DOCKER_REGISTRY)"
9+
export ORDER_PDB_NAME="$(state_get ORDER_DB_NAME)"
10+
export OCI_REGION="$(state_get OCI_REGION)"
11+
export VAULT_SECRET_OCID=""
12+
13+
echo create order-helidon deployment and service...
14+
export CURRENTTIME=$( date '+%F_%H:%M:%S' )
15+
echo CURRENTTIME is $CURRENTTIME ...this will be appended to generated deployment yaml
16+
17+
cp order-helidon-comp.yaml order-helidon-comp-$CURRENTTIME.yaml
18+
19+
#may hit sed incompat issue with mac
20+
sed -i "s|%DOCKER_REGISTRY%|${DOCKER_REGISTRY}|g" order-helidon-comp-$CURRENTTIME.yaml
21+
sed -i "s|%ORDER_PDB_NAME%|${ORDER_PDB_NAME}|g" order-helidon-comp-${CURRENTTIME}.yaml
22+
sed -i "s|%OCI_REGION%|${OCI_REGION}|g" order-helidon-comp-${CURRENTTIME}.yaml
23+
sed -i "s|%VAULT_SECRET_OCID%|${VAULT_SECRET_OCID}|g" order-helidon-comp-${CURRENTTIME}.yaml
24+
25+
if [ -z "$1" ]; then
26+
kubectl apply -f $SCRIPT_DIR/order-helidon-comp-$CURRENTTIME.yaml
27+
# kubectl apply -f $SCRIPT_DIR/order-helidon-app.yaml
28+
else
29+
kubectl apply -f <(istioctl kube-inject -f $SCRIPT_DIR/order-helidon-comp-$CURRENTTIME.yaml) -n msdataworkshop
30+
fi
31+
32+
#kubectl apply -f $SCRIPT_DIR/order-service.yaml -n msdataworkshop
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright (c) 2020, 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+
apiVersion: core.oam.dev/v1alpha2
4+
kind: ApplicationConfiguration
5+
metadata:
6+
name: order-helidon-appconf
7+
namespace: msdataworkshop
8+
annotations:
9+
version: v1.0.0
10+
description: "Order Helidon application"
11+
spec:
12+
components:
13+
- componentName: order-helidon-component
14+
traits:
15+
- trait:
16+
apiVersion: oam.verrazzano.io/v1alpha1
17+
kind: MetricsTrait
18+
spec:
19+
scraper: verrazzano-system/vmi-system-prometheus-0
20+
# - trait:
21+
# apiVersion: oam.verrazzano.io/v1alpha1
22+
# kind: IngressTrait
23+
# metadata:
24+
# name: order-helidon-ingress
25+
# spec:
26+
# rules:
27+
# - paths:
28+
# - path: "/command"
29+
# pathType: Prefix
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Copyright (c) 2020, 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+
apiVersion: core.oam.dev/v1alpha2
4+
kind: Component
5+
metadata:
6+
name: inventory-helidon-component
7+
namespace: inventory-helidon
8+
spec:
9+
workload:
10+
apiVersion: oam.verrazzano.io/v1alpha1
11+
kind: VerrazzanoHelidonWorkload
12+
metadata:
13+
name: inventory-helidon-workload
14+
labels:
15+
app: inventory-helidon
16+
spec:
17+
deploymentTemplate:
18+
metadata:
19+
name: inventory-helidon-deployment
20+
podSpec:
21+
containers:
22+
- name: inventory
23+
image: %DOCKER_REGISTRY%/inventory-dotnet:0.1
24+
imagePullPolicy: Always
25+
env:
26+
- name: DB_USER
27+
value: "inventoryuser"
28+
- name: TNS_ADMIN
29+
value: "/msdataworkshop/creds"
30+
- name: DB_CONNECT_STRING
31+
value: "%INVENTORY_PDB_NAME%_tp"
32+
- name: OCI_REGION
33+
value: "%OCI_REGION%"
34+
- name: VAULT_SECRET_OCID
35+
value: "%VAULT_SECRET_OCID%"
36+
- name: DB_PASSWORD
37+
valueFrom:
38+
secretKeyRef:
39+
name: dbuser
40+
key: dbpassword
41+
optional: true #not needed/used if using VAULT_SECRET_OCID exists
42+
volumeMounts:
43+
- name: creds
44+
mountPath: /msdataworkshop/creds
45+
ports:
46+
- containerPort: 8080
47+
restartPolicy: Always
48+
volumes:
49+
- name: creds
50+
secret:
51+
secretName: db-wallet-secret
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
## Copyright (c) 2021 Oracle and/or its affiliates.
3+
## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
4+
5+
6+
SCRIPT_DIR=$(dirname $0)
7+
8+
export DOCKER_REGISTRY="$(state_get DOCKER_REGISTRY)"
9+
export ORDER_PDB_NAME="$(state_get ORDER_DB_NAME)"
10+
export OCI_REGION="$(state_get OCI_REGION)"
11+
export VAULT_SECRET_OCID=""
12+
13+
echo create order-helidon deployment and service...
14+
export CURRENTTIME=$( date '+%F_%H:%M:%S' )
15+
echo CURRENTTIME is $CURRENTTIME ...this will be appended to generated deployment yaml
16+
17+
cp order-helidon-comp.yaml order-helidon-comp-$CURRENTTIME.yaml
18+
19+
#may hit sed incompat issue with mac
20+
sed -i "s|%DOCKER_REGISTRY%|${DOCKER_REGISTRY}|g" order-helidon-comp-$CURRENTTIME.yaml
21+
sed -i "s|%ORDER_PDB_NAME%|${ORDER_PDB_NAME}|g" order-helidon-comp-${CURRENTTIME}.yaml
22+
sed -i "s|%OCI_REGION%|${OCI_REGION}|g" order-helidon-comp-${CURRENTTIME}.yaml
23+
sed -i "s|%VAULT_SECRET_OCID%|${VAULT_SECRET_OCID}|g" order-helidon-comp-${CURRENTTIME}.yaml
24+
25+
if [ -z "$1" ]; then
26+
kubectl apply -f $SCRIPT_DIR/order-helidon-comp-$CURRENTTIME.yaml
27+
# kubectl apply -f $SCRIPT_DIR/order-helidon-app.yaml
28+
else
29+
kubectl apply -f <(istioctl kube-inject -f $SCRIPT_DIR/order-helidon-comp-$CURRENTTIME.yaml) -n msdataworkshop
30+
fi
31+
32+
#kubectl apply -f $SCRIPT_DIR/order-service.yaml -n msdataworkshop

0 commit comments

Comments
 (0)