Docsright arrowEdge Stackright arrow1.14right arrowCustomizing Project deployment

3 min • read

Customizing Project deployment

This feature is DEPRECATED. Consider the Argo Rollouts integration with Ambassador Edge Stack.

The project controller deploys each project revision using a default set of resources that include:

  • a Deployment
  • a Service
  • a Mapping

If you want to customize how these resources are defined or even deploy your application using a different set of resources, then you can define a project-revision.yaml.tmpl file in your repo.

When writing this file there are a number of things that are helpful to keep in mind:

  • The file is a golang template that is expected to produce Kubernetes yaml.

  • The template is supplied variables about the project and revision in its environment. See the reference at the end of this document for a complete list of variables.

  • The Kubernetes resources defined in the file will be applied for every revision, and since multiple revisions may exist simultaneously, it is important to template the resource names with a value that is unique to the revision. A simple way to do this is use the revision name in your templates.

  • The name of the image built from the Dockerfile is also supplied to the template along with a pull secret for accessing the registry that holds the image. You MUST remember to include the pull secret in your manifests or they will not work.

  • The project controller tracks each resource produced by your template and will clean them all up when a revision is removed (i.e. when you close your PR), so don't worry if you make mistakes.

  • Any namespaces that are omitted will be defaulted to the revision namespace.

The default resources are defined as follows:

Template Variable Reference

Template VariableDescription
.AmbassadorIDThe ambassador ID of the project controller.
.ProjectAll project level info is grouped under this struct.
.Project.NameThe project name.
.Project.NamespaceThe project namespace.
.Project.UIDThe UID of the project resource.
.Project.PrefixThe project prefix.
.Project.RepoThe project repo.
.RevisionAll revision level info is grouped under this struct.
.Revision.NameThe name of the revision.
.Revision.NamespaceThe namespace of the revision.
.Revision.UIDThe UID of the revision resource.
.Revision.IsPreviewA boolean indicating if this is a preview or production revision.
.Revision.RefThe git ref of the revision.
.Revision.RevThe git hash of the revision.
.Revision.PrefixThe Prefix of the revision. This is the same as the project prefix for production revisions and a preview prefix for preview revisions
.Revision.ImageThe image built for this revision.
.Revision.PullSecretThe name of the pull secret for the image revision.