Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the Kubernetes demo to use cyberark/demo-app (#18)
* Update the Kubernetes demo to use cyberark/demo-app - Remove old test apps - Build/deploy a PostgreSQL instance when apps are built/deployed - Store DB username and URL in Conjur policy as well as password - Update naming to use "summon" instead of "api" - Update validation test to POST and GET to the API of the demo apps - Expose apps over port 8080 - Update app manifests to enable them to work with Summon * Add minishift to `is_minienv` check in utils * fix typo
- Loading branch information
Showing
32 changed files
with
297 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
policy/policy.yml | ||
policy/generated/* | ||
webapp/summon*.gz | ||
pg/schema.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
. utils.sh | ||
|
||
announce "Validating that the deployments are functioning as expected." | ||
|
||
set_namespace $TEST_APP_NAMESPACE_NAME | ||
|
||
# Kubernetes and OpenShift currently deploy different apps; verify differently | ||
if [[ "$PLATFORM" = "kubernetes" ]]; then | ||
|
||
init_url=$($cli describe service test-app-summon-init | | ||
grep 'LoadBalancer Ingress' | awk '{ print $3 }'):8080 | ||
sidecar_url=$($cli describe service test-app-summon-sidecar | | ||
grep 'LoadBalancer Ingress' | awk '{ print $3 }'):8080 | ||
|
||
echo -e "Adding entry to the init app\n" | ||
curl \ | ||
-d '{"name": "Mr. Init"}' \ | ||
-H "Content-Type: application/json" \ | ||
$init_url/pet | ||
|
||
echo -e "Adding entry to the sidecar app\n" | ||
curl \ | ||
-d '{"name": "Mr. Sidecar"}' \ | ||
-H "Content-Type: application/json" \ | ||
$sidecar_url/pet | ||
|
||
echo -e "Remember that they are both using the same DB backend...\n" | ||
|
||
echo -e "Querying init app\n" | ||
curl $init_url/pets | ||
|
||
echo -e "\n\nQuerying sidecar app\n" | ||
curl $sidecar_url/pets | ||
|
||
else | ||
|
||
sidecar_api_pod=$($cli get pods --no-headers -l app=test-app-summon-sidecar | awk '{ print $1 }') | ||
if [[ "$sidecar_api_pod" != "" ]]; then | ||
echo "Sidecar + REST API: $($cli exec -c $TEST_APP_NAMESPACE_NAME-app $sidecar_api_pod -- /webapp_v$CONJUR_VERSION.sh)" | ||
echo "Sidecar + Summon: $($cli exec -c $TEST_APP_NAMESPACE_NAME-app $sidecar_api_pod -- summon /webapp_summon.sh)" | ||
fi | ||
|
||
init_api_pod=$($cli get pods --no-headers -l app=test-app-summon-init | awk '{ print $1 }') | ||
if [[ "$init_api_pod" != "" ]]; then | ||
echo "Init Container + REST API: $($cli exec -c $TEST_APP_NAMESPACE_NAME-app $init_api_pod -- /webapp_v$CONJUR_VERSION.sh)" | ||
echo "Init Container + Summon: $($cli exec -c $TEST_APP_NAMESPACE_NAME-app $init_api_pod -- summon /webapp_summon.sh)" | ||
fi | ||
|
||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
# These values augment those set in ...-deploy bootstrap.env | ||
export TEST_APP_NAMESPACE_NAME=amex | ||
# TEST_APP_NAME must be the same as the application build directory name | ||
export TEST_APP_NAME=webapp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: test-app-backend | ||
spec: | ||
selector: | ||
app: test-app-backend | ||
ports: | ||
- port: 5432 | ||
targetPort: 5432 | ||
|
||
--- | ||
apiVersion: apps/v1beta1 | ||
kind: StatefulSet | ||
metadata: | ||
name: pg | ||
labels: | ||
app: test-app-backend | ||
spec: | ||
serviceName: test-app-backend | ||
selector: | ||
matchLabels: | ||
app: test-app-backend | ||
template: | ||
metadata: | ||
labels: | ||
app: test-app-backend | ||
spec: | ||
containers: | ||
- name: test-app-backend | ||
image: {{ TEST_APP_PG_DOCKER_IMAGE }} | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 5432 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.