Skip to content

Deduplicate rendered manifests upon release #1437

@bourgeoisor

Description

@bourgeoisor

As of release v0.6.0 (PR: #1425), release Kubernetes manifests are no longer copy-pasted from a staging directory. Instead, they are programmatically generated using skaffold render (see https://github.com/GoogleCloudPlatform/bank-of-anthos/blob/release/v0.6.0/docs/releasing/make-release.sh#L60-L72).

Since we want to keep parity with the pre-v0.6.0 versions of Bank of Anthos which had each microservice in a different file, this causes some issues wherein duplicate Kubernetes objects are rendered in multiple files:

. . .
secret/jwt-key unchanged
deployment.apps/loadgenerator created
configmap/ledger-db-config unchanged
service/ledger-db unchanged
statefulset.apps/ledger-db unchanged
namespace/bank-of-anthos-development unchanged
serviceaccount/bank-of-anthos unchanged
configmap/demo-data-config unchanged
configmap/environment-config unchanged
configmap/service-api-config unchanged
secret/jwt-key unchanged
service/transactionhistory created
deployment.apps/transactionhistory created
namespace/bank-of-anthos-development unchanged
serviceaccount/bank-of-anthos unchanged
configmap/demo-data-config unchanged
. . .

For release v0.6.0, I have taken the action of manually:

  • Removing the duplicate config.yaml objects from all other files
  • Removing the duplicate ledger-db.yaml and accounts-db.yaml objects from all other files
  • Removing the duplicate jwt-secret.yaml object from all other files
  • Adding the new ServiceAccount to the config.yaml file (not sure if it's the right place for it, it may deserve its own file, but that would require breaking a tutorial or two).

We should look into automating the above steps for new releases, or finding an alternative solution. I have looked into diff, comm, and third-party tools like dyff, but none of them works out great when diff'ing out entire objects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p3Desirable enhancement or fix. May not be included in next release.type: cleanupAn internal cleanup or hygiene concern.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions