Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Development tips

Scott Ganyo edited this page Sep 25, 2019 · 6 revisions

Building a local docker image of adapter

cd grpc-server
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o apigee-adapter .
docker build -t apigee-adapter -f Dockerfile .

Use image: apigee-adapter:latest

Adapter smoke tests (MacOS, Docker Desktop)

Install Istio and helloworld

kubectl apply -f $ISTIO/install/kubernetes/istio-demo.yaml
kubectl label namespace default istio-injection=enabled

kubectl apply -f $ISTIO/samples/helloworld/helloworld.yaml
kubectl apply -f $ISTIO/samples/helloworld/helloworld-gateway.yaml

curl -i 0/hello

Install adapter, rule, and test apikey

cd $ADAPTER
DRYRUN=1 bin/build_release.sh

dist/istio-mixer-adapter_darwin_amd64/apigee-istio provision -o ${ORG} -e ${ENV} -f > samples/apigee/handler.yaml

cat samples/apigee/handler.yaml
dist/istio-mixer-adapter_darwin_amd64/apigee-istio version -o ${ORG} -e ${ENV}

kubectl apply -f samples/apigee/adapter.yaml
kubectl apply -f samples/apigee/definitions.yaml
kubectl apply -f samples/apigee/handler.yaml
kubectl apply -f samples/apigee/rule.yaml

curl -i 0/hello
curl -i 0/hello -H x-api-key:${API_KEY}

Edit samples/apigee/authentication-policy.yaml

issuer: https://${ORG}-${ENV}.apigee.net/istio-auth/token
jwksUri: https://${ORG}-${ENV}.apigee.net/istio-auth/certs

Apply auth policy and test JWT

kubectl apply -f samples/apigee/authentication-policy.yaml

curl -i 0/hello

export TOKEN=`dist/apigee-istio_darwin_amd64/apigee-istio token create -o ${ORG} -e ${ENV} -i ${API_KEY} -s ${SECRET}`

curl -i 0/hello -H "Authorization: Bearer ${TOKEN}"

Check quota

for ((n=0;n<10;n++)); do curl -i 0/hello -H "Authorization: Bearer ${TOKEN}"; done

Check analytics

open https://apigee.com/platform/${ORG}/proxy-performance?proxy=helloworld.default.svc.cluster.local