At this stage, you have built your customized Tanzu Developer Portal with Configurator.
After the build has completed, you retrieve the image reference of the built portal. You then use the image reference to perform a ytt overlay to substitute that image name for the one running the pre-built Tanzu Developer Portal on your cluster.
Identify the image that the supply chain built so that you can use the image reference in your ytt overlay in the next section. There are several ways to retrieve this image name, including using the Kubernetes command-line tool (kubectl) or using the Tanzu Developer Portal GUI.
kubectl -n DEVELOPER-NAMESPACE get images.kpack.io WORKLOAD-NAME -o jsonpath={.status.latestImage}
Where:
DEVELOPER-NAMESPACE
is the configured developer namespace on the cluster where you ran the workload.WORKLOAD-NAME
is the name of the workload you used.For example:
> kubectl -n default get images.kpack.io tdp-workload -o jsonpath={.status.latestImage}
> kapplegate.azurecr.io/demo/workloads/tdp-workload-default@sha256:bae710386f7d81a725ce5ab15d76a3dd4f6ea79804ae0a475cf98f5e3dd6cf82
To prepare to overlay your customized image onto the currently running instance:
Create the ytt overlay secret.
Create a file called tdp-overlay-secret.yaml
with the following content to replace IMAGE-REFERENCE
with the customized image you retrieved earlier. There is one of two possible values. The value depends on whether you installed Tanzu Application Platform with the lite
dependencies (default) or the full
dependencies.
tdp-overlay-secret.yaml
if you installed the
lite
dependencies (default):
apiVersion: v1
kind: Secret
metadata:
name: tdp-app-image-overlay-secret
namespace: tap-install
stringData:
tdp-app-image-overlay.yaml: |
#@ load("@ytt:overlay", "overlay")
#! makes an assumption that tap-gui is deployed in the namespace: "tap-gui"
#@overlay/match by=overlay.subset({"kind": "Deployment", "metadata": {"name": "server", "namespace": "tap-gui"}}), expects="1+"
---
spec:
template:
spec:
containers:
#@overlay/match by=overlay.subset({"name": "backstage"}),expects="1+"
#@overlay/match-child-defaults missing_ok=True
- image: IMAGE-REFERENCE
#@overlay/replace
args:
- -c
- |
export KUBERNETES_SERVICE_ACCOUNT_TOKEN="$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)"
exec /layers/tanzu-buildpacks_node-engine-lite/node/bin/node portal/dist/packages/backend \
--config=portal/app-config.yaml \
--config=portal/runtime-config.yaml \
--config=/etc/app-config/app-config.yaml
tdp-overlay-secret.yaml
if you installed the
full
dependencies:
apiVersion: v1
kind: Secret
metadata:
name: tdp-app-image-overlay-secret
namespace: tap-install
stringData:
tdp-app-image-overlay.yaml: |
#@ load("@ytt:overlay", "overlay")
#! makes an assumption that tap-gui is deployed in the namespace: "tap-gui"
#@overlay/match by=overlay.subset({"kind": "Deployment", "metadata": {"name": "server", "namespace": "tap-gui"}}), expects="1+"
---
spec:
template:
spec:
containers:
#@overlay/match by=overlay.subset({"name": "backstage"}),expects="1+"
#@overlay/match-child-defaults missing_ok=True
- image: IMAGE-REFERENCE
#@overlay/replace
args:
- -c
- |
export KUBERNETES_SERVICE_ACCOUNT_TOKEN="$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)"
exec /layers/tanzu-buildpacks_node-engine/node/bin/node portal/dist/packages/backend \
--config=portal/app-config.yaml \
--config=portal/runtime-config.yaml \
--config=/etc/app-config/app-config.yaml
Apply the secret by running:
kubectl apply -f tdp-overlay-secret.yaml
Add the secret to tap-values.yaml
, the file used to install Tanzu Application Platform. For example:
profile: full
tap_gui:
...
package_overlays:
- name: tap-gui
secrets:
- name: tdp-app-image-overlay-secret
Update your installation to use the modified tap-values.yaml
file. The exact steps vary depending on your installation method (GitOps, online install, or offline install).
For how to do so for an online installation, see Install your Tanzu Application Platform package.
ImportantThe cluster that is running Tanzu Developer Portal (formerly known as
TAP-GUI
) needs the relevant credentials to pull images from the container registry that contains your customized portal.If the cluster is in a
full
profile, it likely has the necessary credentials. In a multicluster installation (view
profile) you likely need to use the Tanzu CLI to add the relevant credentials.