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

Update TAS Adapter installation to v1.0.0 #24

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions tas-adapter/admin/role-binding.yaml

This file was deleted.

40 changes: 40 additions & 0 deletions tas-adapter/app-registry-credentials/exported-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#@ load("@ytt:assert", "assert")
#@ load("@ytt:base64", "base64")
#@ load("@ytt:data", "data")
#@ load("@ytt:json", "json")

#@ def app_registry_secret_name():
#@ return data.values.container_registry.secret_name or assert.fail("missing container_registry.secret_name")
#@ end

#@ def app_registry_username():
#@ return data.values.container_registry.username or assert.fail("missing container_registry.username")
#@ end

#@ def app_registry_password():
#@ return data.values.container_registry.password or assert.fail("missing container_registry.password")
#@ end

#@ def app_registry_hostname():
#@ return data.values.container_registry.hostname or assert.fail("missing container_registry.hostname")
#@ end

---
apiVersion: v1
kind: Secret
metadata:
name: #@ app_registry_secret_name()
namespace: tap-install
type: kubernetes.io/dockerconfigjson
data:
#@ docker_auth = base64.encode("{}:{}".format(app_registry_username(), app_registry_password()))
#@ docker_creds = {"username": app_registry_username(), "password": app_registry_password(), "auth": docker_auth}
.dockerconfigjson: #@ base64.encode(json.encode({"auths": {app_registry_hostname(): docker_creds}}))
---
apiVersion: secretgen.carvel.dev/v1alpha1
kind: SecretExport
metadata:
name: #@ app_registry_secret_name()
namespace: tap-install
spec:
toNamespace: cf
18 changes: 9 additions & 9 deletions tas-adapter/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,19 @@ mkdir -p "${generated_dir}"
values_file_default="${script_dir}/values.yaml"
values_file=${VALUES_FILE:-$values_file_default}

TAS_ADAPTER_PACKAGE_VERSION=0.9.0
TAS_ADAPTER_PACKAGE_VERSION=1.0.1
TAS_ADAPTER_REPO_VERSION="${TAS_ADAPTER_PACKAGE_VERSION}"

ytt -f "${script_dir}/tas-adapter-values.yaml" -f "${values_file}" --ignore-unknown-comments > "${generated_dir}/tas-adapter-values.yaml"

kapp deploy \
--app tas-adapter-app-registry-credentials \
--namespace tap-install \
--file <(\
ytt --ignore-unknown-comments -f "${values_file}" -f "${script_dir}/app-registry-credentials" \
) \
--yes

kapp deploy \
--app tas-adapter-certificates \
--namespace tap-install \
Expand All @@ -37,11 +45,3 @@ tanzu package install tas-adapter \
--package-name application-service-adapter.tanzu.vmware.com \
--version "${TAS_ADAPTER_PACKAGE_VERSION}" \
--values-file "${generated_dir}/tas-adapter-values.yaml"

kapp deploy \
--app tas-adapter-cf-admin \
--namespace tap-install \
--file <(\
ytt --ignore-unknown-comments -f "${values_file}" -f "${script_dir}/admin" \
) \
--yes
8 changes: 6 additions & 2 deletions tas-adapter/tas-adapter-values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#@ load("@ytt:data", "data")
---
ceip_policy_disclosed: true
admin:
users:
- #@ data.values.admin.username
api_ingress:
fqdn: #@ "api-tas-adapter.{}".format(data.values.ingress.domain)
tls:
Expand All @@ -13,9 +16,10 @@ app_ingress:
namespace: #@ data.values.ingress.contour_tls_namespace
app_registry:
credentials:
username: #@ data.values.container_registry.username
password: #@ data.values.container_registry.password
namespace: tap-install
secret_name: #@ data.values.container_registry.secret_name
hostname: #@ data.values.container_registry.hostname
path:
droplets: #@ "{}/{}/droplets".format(data.values.container_registry.hostname,data.values.container_registry.project)
packages: #@ "{}/{}/packages".format(data.values.container_registry.hostname,data.values.container_registry.project)
kpack_clusterbuilder_name: full
3 changes: 2 additions & 1 deletion tas-adapter/values-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ ingress:
contour_tls_namespace: tanzu-system-ingress
contour_tls_secret: contour-tls-delegation-cert
container_registry:
secret_name: tas-adapter-app-registry-credentials
hostname: harbor.example.com
project: tas-adapter
username: admin
password:
admin:
username: [email protected] # Note: this is the name in the output of `cf curl /whoami`; see https://docs.vmware.com/en/Application-Service-Adapter-for-VMware-Tanzu-Application-Platform/0.5/tas-adapter/GUID-getting-started.html#assign-admin-user
username: [email protected] # Note: this is the name in the output of `cf curl /whoami`; see https://docs.vmware.com/en/Application-Service-Adapter-for-VMware-Tanzu-Application-Platform/1.0/tas-adapter/GUID-install.html#log-in-with-a-system-admin-user