Deployment Package#
As outlined in the Developer Workflow Deployment Packages, a Deployment Package is a collection of Applications - each linked to one Helm* Chart.
In this step you will write a Deployment Package to deploy the Tutorial Server and the Tutorial Web UI.
Create the Application#
Create a new directory at the top level called tutorial-deployment and then create the Application as tutorial-server-app.yaml in the same directory with the following content for Tutorial Server:
specSchema: Application
schemaVersion: "0.1"
$schema: "https://schema.intel.com/catalog.orchestrator/0.1/schema"
name: tutorial-server
version: "0.1.0"
description: "Tutorial Server"
imageRegistry: "harbor-docker-oci"
helmRegistry: "harbor-helm-oci"
chartName: "tutorial-server"
chartVersion: "0.1.0"
profiles:
- name: "default"
valuesFileName: "tutorial-server-values-default.yaml"
- name: "alternate"
valuesFileName: "tutorial-server-values-alternate.yaml"
- name: "alternate-pt"
valuesFileName: "tutorial-server-values-alternate-pt.yaml"
parameterTemplates:
- name: "greeting"
displayName: Greeting message
default: "Deployed by Application Orchestration (pt)"
type: string
- name: "initialCount"
displayName: Initial count
default: "0"
type: string
Here you have three profiles - one for the default values and two for alternate values. This provides two ways to override the Helm chart values at deployment time - a) by having different values files and b) by having values parameter templates that can be chosen at deployment time.
Note
The imageRegistry: harbor-docker-oci is the Registry object pointing to where the Tutorial Server image can be retrieved by the Edge Node. Later we will be pushing the image to this registry. This statement is only necessary if the image is not in a public registry. Full details on the registry can be found at Registry.
Likewise the helmRegistry: harbor-helm-oci is the Registry object pointing to where the Tutorial Server Helm chart will be retrieved from. This statement is always necessary even in the case of public registries. Both OCI and traditional Helm registries can be referred to. If the registry requires authentication, the credentials can be added to the Registry object.
Add another file tutorial-web-ui-app.yaml in the same directory with the following content for Tutorial Web UI:
specSchema: Application
schemaVersion: "0.1"
$schema: "https://schema.intel.com/catalog.orchestrator/0.1/schema"
name: tutorial-web-ui
version: "0.1.0"
description: "Tutorial Server"
imageRegistry: "harbor-docker-oci"
helmRegistry: "harbor-helm-oci"
chartName: "tutorial-web-ui"
chartVersion: "0.1.0"
profiles:
- name: "default"
valuesFileName: "tutorial-web-ui-values.yaml"
Create Values Files#
Create four values files in the same directory (tutorial-deployment) with the following content:
First create tutorial-server-values-default.yaml with the following content:
fullnameOverride: tutorial-server
tutorialServer:
greeting: "Deployed by Application Orchestration (default)"
initialCount: 10
image:
# Please update with your CLUSTER_FQDN and your ORG and PROJECT names
repository: registry-oci.<CLUSTER_FQDN>/catalog-apps-<ORG>-<PROJECT>/tutorial-server-image
imagePullSecrets:
- name: "%GeneratedDockerCredential%"
The fullnameOverride is important here as it drives the name that the services and pods are given. The default is to include the “release name” that the chart is installed with, and since Application Orchestration will use a UUID in the release name, this will mean that the services and pods will have a random name. By setting the name to a fixed value like this, it means the Tutorial Web UI will be able to reference this service by this name in a predictable manner.
Note
The image repository is the OCI registry where the Tutorial Server image is stored. In the next step we will be pushing the image to this registry. You must adjust it to suit Edge Orchestrator’s Full Qualified Domain Name, the Organization you’re in and the multi-tenancy Project you’re deploying in. We will show how this can be edited after the Deployment Package is imported in Edit Image Location. The imagePullSecrets an automatically calculated value that will allow the deployment pull the image from the OCI registry.
Then create tutorial-server-values-alternate.yaml with the following content:
fullnameOverride: tutorial-server
tutorialServer:
greeting: "Deployed by Application Orchestration (alternate)"
initialCount: 5
image:
# Please update with your CLUSTER_FQDN and your ORG and PROJECT names
repository: registry-oci.<CLUSTER_FQDN>/catalog-apps-<ORG>-<PROJECT>/tutorial-server-image
imagePullSecrets:
- name: "%GeneratedDockerCredential%"
Note
Here we vary the initialCount and the greeting message, to show the flexibility the profiles feature brings.
Then create tutorial-server-values-alternate-pt.yaml with the following content:
fullnameOverride: tutorial-server
tutorialServer:
greeting: "Deployed by Application Orchestration (alternate-pt)"
initialCount: 0
image:
# Please update with your CLUSTER_FQDN and your ORG and PROJECT names
repository: registry-oci.<CLUSTER_FQDN>/catalog-apps-<ORG>-<PROJECT>/tutorial-server-image
imagePullSecrets:
- name: "%GeneratedDockerCredential%"
Finally create tutorial-web-ui-values.yaml with the following content:
fullnameOverride: tutorial-web-ui
image:
# Please update with your CLUSTER_FQDN and your ORG and PROJECT names
repository: registry-oci.<CLUSTER_FQDN>/catalog-apps-<ORG>-<PROJECT>/tutorial-web-ui-image
imagePullSecrets:
- name: "%GeneratedDockerCredential%"
service:
annotations:
service-proxy.app.orchestrator.io/ports: "8080"
The service-proxy annotation is used to tell the Application Orchestrator to expose the web UI service, as described Service Link Support section of in Package an Application for the Registry.
Creating the Deployment Package#
Finally to bring it all together we add a deployment-package.yaml file containing the Deployment Package:
specSchema: DeploymentPackage
schemaVersion: "0.1"
$schema: "https://schema.intel.com/catalog.orchestrator/0.1/schema"
description: Application Orchestration Tutorial Deployment Package
name: app-orch-tutorial-dp
displayName: "Tutorial DP"
version: "0.1.0"
applications:
- name: tutorial-server
version: "0.1.0"
- name: tutorial-web-ui
version: "0.1.0"
deploymentProfiles:
- name: "default-profile"
displayName: "Default Configuration"
applicationProfiles:
- application: "tutorial-server"
profile: "default"
- application: "tutorial-web-ui"
profile: "default"
- name: "alternate"
displayName: "Alternate Configuration"
applicationProfiles:
- application: "tutorial-server"
profile: "alternate"
- application: "tutorial-web-ui"
profile: "default"
- name: "alternate-pt"
displayName: "Alternate with Parameter Templates"
applicationProfiles:
- application: "tutorial-server"
profile: "alternate-pt"
- application: "tutorial-web-ui"
profile: "default"
defaultNamespaces:
tutorial-server: tutorial
tutorial-web-ui: tutorial
This is where the power of the Deployment Package can be seen, bringing together the Applications. It allows us to define which Applications (and their versions) to include, and to define the Deployment Profiles combining the different Application Profiles. It also allows us set the namespace that the Application will be deployed to. If this is left out, a default namespace will be created for each Application.
Note
In this case, you are using the same namespace for both so they can call each other without needing to use the full DNS name.