forked from solo-io/workshops
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
soloio-bot
committed
Nov 7, 2022
1 parent
9d0df61
commit d8a2a2e
Showing
80 changed files
with
7,536 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
50 changes: 50 additions & 0 deletions
50
gloo-mesh-2-2/eks-and-openshift/data/steps/deploy-keycloak/keycloak.yaml
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,50 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: keycloak | ||
labels: | ||
app: keycloak | ||
spec: | ||
ports: | ||
- name: http | ||
port: 8080 | ||
targetPort: 8080 | ||
selector: | ||
app: keycloak | ||
type: LoadBalancer | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: keycloak | ||
labels: | ||
app: keycloak | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: keycloak | ||
template: | ||
metadata: | ||
labels: | ||
app: keycloak | ||
spec: | ||
containers: | ||
- name: keycloak | ||
image: quay.io/keycloak/keycloak:12.0.4 | ||
env: | ||
- name: KEYCLOAK_USER | ||
value: "admin" | ||
- name: KEYCLOAK_PASSWORD | ||
value: "admin" | ||
- name: PROXY_ADDRESS_FORWARDING | ||
value: "true" | ||
ports: | ||
- name: http | ||
containerPort: 8080 | ||
- name: https | ||
containerPort: 8443 | ||
readinessProbe: | ||
httpGet: | ||
path: /auth/realms/master | ||
port: 8080 |
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions
16
...s-and-openshift/images/steps/create-bookinfo-workspace/gloo-mesh-workspaces.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions
16
...s-and-openshift/images/steps/create-gateways-workspace/gloo-mesh-workspaces.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+92.2 KB
gloo-mesh-2-2/eks-and-openshift/images/steps/deploy-bookinfo/bookinfo-working.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+72.2 KB
gloo-mesh-2-2/eks-and-openshift/images/steps/deploy-bookinfo/initial-setup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions
16
...enshift/images/steps/deploy-gloo-mesh-addons/gloo-mesh-workshop-environment.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+193 KB
gloo-mesh-2-2/eks-and-openshift/images/steps/deploy-keycloak/bookinfo-oidc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+110 KB
...s-and-openshift/images/steps/deploy-keycloak/keycloak-authentication-dialog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+204 KB
...h-2-2/eks-and-openshift/images/steps/deploy-keycloak/self-signed-cert-error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions
16
gloo-mesh-2-2/eks-and-openshift/images/steps/gateway-expose/gloo-mesh-gateway.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions
16
...-and-openshift/images/steps/gateway-extauth-oauth/gloo-mesh-gateway-extauth.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions
16
...ft/images/steps/gateway-external-service/gloo-mesh-gateway-external-service.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions
16
...openshift/images/steps/gateway-ratelimiting/gloo-mesh-gateway-rate-limiting.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions
16
...ks-and-openshift/images/steps/root-trust-policy/gloo-mesh-root-trust-policy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions
16
.../eks-and-openshift/images/steps/traffic-policies/gloo-mesh-traffic-policies.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+336 KB
...esh-2-2/eks-and-openshift/images/steps/traffic-policies/reviews-unavailable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions
16
...enshift/images/steps/virtual-destination/gloo-mesh-virtual-destination-both.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions
16
...ift/images/steps/virtual-destination/gloo-mesh-virtual-destination-failover.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions
16
...shift/images/steps/virtual-destination/gloo-mesh-virtual-destination-remote.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions
16
...nd-openshift/images/steps/virtual-destination/gloo-mesh-virtual-destination.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+50.9 KB
gloo-mesh-2-2/eks-and-openshift/images/steps/zero-trust/bookinfo-rbac1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+99.5 KB
gloo-mesh-2-2/eks-and-openshift/images/steps/zero-trust/bookinfo-rbac2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+92.2 KB
gloo-mesh-2-2/eks-and-openshift/images/steps/zero-trust/bookinfo-working.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,252 @@ | ||
#!/usr/bin/env bash | ||
|
||
##################################################################### | ||
## | ||
## title: Assert Extension | ||
## | ||
## description: | ||
## Assert extension of shell (bash, ...) | ||
## with the common assert functions | ||
## Function list based on: | ||
## http://junit.sourceforge.net/javadoc/org/junit/Assert.html | ||
## Log methods : inspired by | ||
## - https://natelandau.com/bash-scripting-utilities/ | ||
## author: Mark Torok | ||
## | ||
## date: 07. Dec. 2016 | ||
## | ||
## license: MIT | ||
## | ||
##################################################################### | ||
|
||
if command -v tput &>/dev/null && tty -s; then | ||
RED=$(tput setaf 1) | ||
GREEN=$(tput setaf 2) | ||
MAGENTA=$(tput setaf 5) | ||
NORMAL=$(tput sgr0) | ||
BOLD=$(tput bold) | ||
else | ||
RED=$(echo -en "\e[31m") | ||
GREEN=$(echo -en "\e[32m") | ||
MAGENTA=$(echo -en "\e[35m") | ||
NORMAL=$(echo -en "\e[00m") | ||
BOLD=$(echo -en "\e[01m") | ||
fi | ||
|
||
log_header() { | ||
printf "\n${BOLD}${MAGENTA}========== %s ==========${NORMAL}\n" "$@" >&2 | ||
} | ||
|
||
log_success() { | ||
printf "${GREEN}✔ %s${NORMAL}\n" "$@" >&2 | ||
} | ||
|
||
log_failure() { | ||
printf "${RED}✖ %s${NORMAL}\n" "$@" >&2 | ||
file=.test-error.log | ||
echo "$@" >> $file | ||
echo "#############################################" >> $file | ||
echo "#############################################" >> $file | ||
} | ||
|
||
|
||
assert_eq() { | ||
local expected="$1" | ||
local actual="$2" | ||
local msg="${3-}" | ||
|
||
if [ "$expected" == "$actual" ]; then | ||
return 0 | ||
else | ||
[ "${#msg}" -gt 0 ] && log_failure "$expected == $actual :: $msg" || true | ||
return 1 | ||
fi | ||
} | ||
|
||
assert_not_eq() { | ||
local expected="$1" | ||
local actual="$2" | ||
local msg="${3-}" | ||
|
||
if [ ! "$expected" == "$actual" ]; then | ||
return 0 | ||
else | ||
[ "${#msg}" -gt 0 ] && log_failure "$expected != $actual :: $msg" || true | ||
return 1 | ||
fi | ||
} | ||
|
||
assert_true() { | ||
local actual="$1" | ||
local msg="${2-}" | ||
|
||
assert_eq true "$actual" "$msg" | ||
return "$?" | ||
} | ||
|
||
assert_false() { | ||
local actual="$1" | ||
local msg="${2-}" | ||
|
||
assert_eq false "$actual" "$msg" | ||
return "$?" | ||
} | ||
|
||
assert_array_eq() { | ||
|
||
declare -a expected=("${!1-}") | ||
# echo "AAE ${expected[@]}" | ||
|
||
declare -a actual=("${!2}") | ||
# echo "AAE ${actual[@]}" | ||
|
||
local msg="${3-}" | ||
|
||
local return_code=0 | ||
if [ ! "${#expected[@]}" == "${#actual[@]}" ]; then | ||
return_code=1 | ||
fi | ||
|
||
local i | ||
for (( i=1; i < ${#expected[@]} + 1; i+=1 )); do | ||
if [ ! "${expected[$i-1]}" == "${actual[$i-1]}" ]; then | ||
return_code=1 | ||
break | ||
fi | ||
done | ||
|
||
if [ "$return_code" == 1 ]; then | ||
[ "${#msg}" -gt 0 ] && log_failure "(${expected[*]}) != (${actual[*]}) :: $msg" || true | ||
fi | ||
|
||
return "$return_code" | ||
} | ||
|
||
assert_array_not_eq() { | ||
|
||
declare -a expected=("${!1-}") | ||
declare -a actual=("${!2}") | ||
|
||
local msg="${3-}" | ||
|
||
local return_code=1 | ||
if [ ! "${#expected[@]}" == "${#actual[@]}" ]; then | ||
return_code=0 | ||
fi | ||
|
||
local i | ||
for (( i=1; i < ${#expected[@]} + 1; i+=1 )); do | ||
if [ ! "${expected[$i-1]}" == "${actual[$i-1]}" ]; then | ||
return_code=0 | ||
break | ||
fi | ||
done | ||
|
||
if [ "$return_code" == 1 ]; then | ||
[ "${#msg}" -gt 0 ] && log_failure "(${expected[*]}) == (${actual[*]}) :: $msg" || true | ||
fi | ||
|
||
return "$return_code" | ||
} | ||
|
||
assert_empty() { | ||
local actual=$1 | ||
local msg="${2-}" | ||
|
||
assert_eq "" "$actual" "$msg" | ||
return "$?" | ||
} | ||
|
||
assert_not_empty() { | ||
local actual=$1 | ||
local msg="${2-}" | ||
|
||
assert_not_eq "" "$actual" "$msg" | ||
return "$?" | ||
} | ||
|
||
assert_contain() { | ||
local haystack="$1" | ||
local needle="${2-}" | ||
local msg="${3-}" | ||
|
||
if [ -z "${needle:+x}" ]; then | ||
return 0; | ||
fi | ||
|
||
if [ -z "${haystack##*$needle*}" ]; then | ||
return 0 | ||
else | ||
[ "${#msg}" -gt 0 ] && log_failure "$haystack doesn't contain $needle :: $msg" || true | ||
return 1 | ||
fi | ||
} | ||
|
||
assert_not_contain() { | ||
local haystack="$1" | ||
local needle="${2-}" | ||
local msg="${3-}" | ||
|
||
if [ -z "${needle:+x}" ]; then | ||
return 0; | ||
fi | ||
|
||
if [ "${haystack##*$needle*}" ]; then | ||
return 0 | ||
else | ||
[ "${#msg}" -gt 0 ] && log_failure "$haystack contains $needle :: $msg" || true | ||
return 1 | ||
fi | ||
} | ||
|
||
assert_gt() { | ||
local first="$1" | ||
local second="$2" | ||
local msg="${3-}" | ||
|
||
if [[ "$first" -gt "$second" ]]; then | ||
return 0 | ||
else | ||
[ "${#msg}" -gt 0 ] && log_failure "$first > $second :: $msg" || true | ||
return 1 | ||
fi | ||
} | ||
|
||
assert_ge() { | ||
local first="$1" | ||
local second="$2" | ||
local msg="${3-}" | ||
|
||
if [[ "$first" -ge "$second" ]]; then | ||
return 0 | ||
else | ||
[ "${#msg}" -gt 0 ] && log_failure "$first >= $second :: $msg" || true | ||
return 1 | ||
fi | ||
} | ||
|
||
assert_lt() { | ||
local first="$1" | ||
local second="$2" | ||
local msg="${3-}" | ||
|
||
if [[ "$first" -lt "$second" ]]; then | ||
return 0 | ||
else | ||
[ "${#msg}" -gt 0 ] && log_failure "$first < $second :: $msg" || true | ||
return 1 | ||
fi | ||
} | ||
|
||
assert_le() { | ||
local first="$1" | ||
local second="$2" | ||
local msg="${3-}" | ||
|
||
if [[ "$first" -le "$second" ]]; then | ||
return 0 | ||
else | ||
[ "${#msg}" -gt 0 ] && log_failure "$first <= $second :: $msg" || true | ||
return 1 | ||
fi | ||
} |
19 changes: 19 additions & 0 deletions
19
gloo-mesh-2-2/eks-and-openshift/scripts/check-kubernetes.liquid
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,19 @@ | ||
{%- if step.spec.checkFile %} | ||
{%- assign filename = step.vars.dir | findFile: step.spec.checkFile %} | ||
{%- if filename != "notfound" %} | ||
source /root/.env 2>/dev/null || true | ||
# Rendered from {{ filename }} | ||
{%- if filename | isMocha %} | ||
{{ filename | generateCheckFile: retries: 5, bail: 'yes', vars: vars }} | ||
retval=$? | ||
if [ $retval -ne 0 ]; then | ||
echo "{{ filename }}" | ||
cat /tmp/stderr | ||
echo "FAIL: $(cat /tmp/stderr | grep Error | head -n 1 | xargs -0)" | ||
exit 1 | ||
fi | ||
{%- else %} | ||
{% render filename %} | ||
{%- endif %} | ||
{%- endif %} | ||
{%- endif %} |
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,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
printf "Waiting for all the kube-system pods to become ready in context $1" | ||
until [ $(kubectl --context $1 -n kube-system get pods -o jsonpath='{range .items[*].status.containerStatuses[*]}{.ready}{"\n"}{end}' | grep false -c) -eq 0 ]; do | ||
printf "%s" "." | ||
sleep 1 | ||
done | ||
printf "\n" | ||
|
||
printf "Waiting for all the metallb-system pods to become ready in context $1" | ||
until [ $(kubectl --context $1 -n metallb-system get pods -o jsonpath='{range .items[*].status.containerStatuses[*]}{.ready}{"\n"}{end}' | grep false -c) -eq 0 ]; do | ||
printf "%s" "." | ||
sleep 1 | ||
done | ||
printf "\n" |
Oops, something went wrong.