Deploy Sidecars

Apps Operator Duration: 5 min | Persona: Apps Operator

In this section, you will deploy fine granular Sidecars in order to optimize the resources (CPU/Memory) usage of the Online Boutique apps’s sidecar proxies. By default, each application in the onlineboutique Namespace can reach to all the endpoints in the mesh. The Sidecar resource allows to reduce that list to the strict minimum of which endpoints it needs to communicate with.

Initialize variables:

source ${WORK_DIR}

Prepare upstream Kubernetes manifests

Prepare the upstream Kubernetes manifests:

kpt pkg get

Update the Kustomize base overlay

kustomize edit add component ../upstream/sidecars/all

Update Staging namespace overlay

mkdir sidecars
cp -r ../upstream/sidecars/for-namespace/ sidecars/.
sed -i "s/ONLINEBOUTIQUE_NAMESPACE/${ONLINEBOUTIQUE_NAMESPACE}/g" sidecars/for-namespace/kustomization.yaml
kustomize edit add component sidecars/for-namespace

Deploy Kubernetes manifests

git add . && git commit -m "Online Boutique Sidecars" && git push origin main

Check deployments

List the Kubernetes resources managed by Config Sync in GKE cluster for the Online Boutique apps repository:

gcloud alpha anthos config sync repo describe \
    --project $TENANT_PROJECT_ID \
    --managed-resources all \
    --sync-name repo-sync \
    --sync-namespace $ONLINEBOUTIQUE_NAMESPACE

Wait and re-run this command above until you see "status": "SYNCED".

Alternatively, you could also see this from within the Cloud Console, by clicking on this link:

echo -e "${GKE_NAME}&id=${GKE_NAME}&project=${TENANT_PROJECT_ID}"

Wait until you see the Sync status column as SYNCED. And then you can also click on View resources to see the details.

List the GitHub runs for the Online Boutique apps repository:


Check the Online Boutique apps

Navigate to the Online Boutique apps, click on the link displayed by the command below:


You should still have the Online Boutique apps working successfully.