Deployment
Once you have defined your application's components and created an environment, then you can deploy them with the
wf deploy appcomponent
CLI command. You can also use the wf deploy application
CLI command to deploy your entire application.
You can preview the deployment manifest files before actual deployment by appending the CLI command with the --dry-run
flag for example:
wf deploy component APP-NAME APP-ENV-NAME --component COMPONENT-NAME --dry-run
Wayfinder generates the following manifests for a container component:
- WORKSPACE_ENVIRONMENT_COMPONENT_deployment.yaml
- WORKSPACE_ENVIRONMENT_COMPONENT_service.yaml
- WORKSPACE_ENVIRONMENT_COMPONENT-ingress_ingress.yaml
- WORKSPACE_ENVIRONMENT_COMPONENT-ingress_networkpolicy.yaml
Wayfinder generates the following manifest for a cloud resource component:
- WORKSPACE_ENVIRONMENT_COMPONENT_configuration.yaml
You need to create/enable an access token before you can deploy your application using a CI system.
CLI Quick Reference
Instruction | CLI Command |
---|---|
Deploy a container component | wf deploy appcomponent APP-NAME APP-ENV-NAME --component COMPONENT-NAME |
View a component's manifests in stdout with --dry-run flag | wf deploy appcomponent APP-NAME APP-ENV-NAME --component COMPONENT-NAME --dry-run |
Deploy entire application with all components | wf deploy application APP APPENV [-w WORKSPACE] |
View the application's manifests in stdout with --dry-run flag | wf deploy application APP APPENV --dry-run |
Generate manifest files to disk with --path flag | wf deploy application APP APPENV --path ./PATH/TO/DIR |
Deploy the application with only specified components | wf deploy application APP APPENV --only COMPONENT-NAME |
Override the tag to be applied to the container component's images for all components | wf deploy application APP APPENV --image-tag TAG |
Create a workspace-scoped access token | wf create -w WORKSPACE-NAME workspaceaccesstoken NAME-OF-TOKEN |
Eject un-Kustomized manifests and kustomization.yaml overlay for the environment to stdout | wf deploy application APP APPENV --eject |
Eject un-Kustomized manifests and kustomization.yaml overlay for the environment to disk | wf deploy application APP APPENV --eject --path ./PATH/TO/DIR |
Set up kubectl access to do the ejected deployment | wf access env APP APPENV --role namespace.edit |
Apply the ejected definition using kubectl | kubectl apply -k ./PATH/TO/DIR/APPENV |
Deploy Components
You can deploy a container component as well as a
cloud resource component with the same wf deploy appcomponent
command.
If you are not sure of the configuration, then you can preview the manifest files by appending the --dry-run flag to the 'wf deploy appcomponent' command.
wf deploy appcomponent APP-NAME APP-ENV-NAME --component COMPONENT-NAME --dry-run
If you are happy with the manifest files, then run the wf deploy appcomponent
command to deploy your component. Remember to omit the --dry-run flag.
To see examples of manifest files, visit:
Deploy Application
You can deploy your application as follows:
-
Wayfinder can generate the required manifest files and deploy all related components to your environment. Use the following command:
wf deploy application APP APPENV [-w workspace]
wf deploy application coolapps2 dev-env2 -w sand
◉ No active deployment role, requesting temporary role binding for the default deployment role namespace.edit
......
✔ Deployment role ready
◉ Deploying application coolapps2 to environment dev-env2...
✔ Deployment successful
- You can preview the manifest files in stdout before deployment with the command below.
wf deploy application APP APPENV --dry-run
wf deploy application coolapps2 dev-env2 --dry-run
[lists content details of all relevant manifest files for all the application''s components e.g.,
coolapps2_dev-env2_front-end_deployment.yaml
coolapps2_dev-env2_front-end_service.yaml
coolapps2_dev-env2_front-end-ingress_ingress.yaml
coolapps2_dev-env2_front-end-ingress_networkpolicy.yaml
coolapps2_dev-env2_storage_configuration.yaml
]
-
You can generate the manifest files to disk with the following command:
wf deploy application APP APPENV --path ./PATH/TO/DIR
-
You can deploy specific components using the --only flag with the component's name:
wf deploy application APP APPENV --only COMPONENT-NAME
wf deploy application coolapps2 dev-env2 --only storage
✔ Deployment role available
◉ Deploying application coolapps2 to environment dev-env2 (components: [storage])...
✔ Deployment successful
-
You can override the tag to be applied to the container component's images for all components with the --image-tag flag:
wf deploy application APP APPENV --image-tag TAG
wf deploy application coolapps2 dev-env2 --image-tag ReallyCoolTag
✔ Deployment role available
◉ Deploying application coolapps2 to environment dev-env2 using image tag ReallyCoolTag...
✔ Deployment successful
[Advanced Usage]
Wayfinder uses Kustomize to generate manifests per component. You can eject the kustomize definitions to disk if you wish to modify them and apply them yourself using kubectl apply -k command.
-
Eject un-Kustomized manifests and kustomization.yaml overlay for the environment to stdout using the following command:
wf deploy application APP APPENV --eject
-
Eject un-Kustomized manifests and kustomization.yaml overlay for the environment to disk using the following command:
wf deploy application APP APPENV --eject --path ./PATH/TO/DIR
-
You can apply the ejected definition as per below. Note the addition of the APPENV name at the end of the path:
- Use
wf access env APP APPENV --role namespace.edit
to set up kubectl access to do the deployment. - Use the
kubectl apply
command as per below:
kubectl apply -k ./PATH/TO/DIR/APPENV
- Use
Access Tokens
Create a Workspace Access Token
Create a workspace access token to access your workspace and grant permissions to deploy your application.
You need to create a workspace-scoped token (for deployments and automation within a single workspace) with the following command:
wf create -w WORKSPACE-NAME workspaceaccesstoken NAME-OF-TOKEN
Enable a Workspace Access Token
You need to create at least one component before you can enable the deployment access token within Wayfinder's web interface.
By default, Wayfinder supplies a disabled deployment access token for each application environment. Once it is enabled, Wayfinder will create the access token and provide the needed permissions for you to deploy your application to that specific environment. Administrators can create additional access tokens for workspaces and assign permissions accordingly.
Using Wayfinder's web interface, select Workspaces, and then navigate to All Applications.
- Select your application's name and your environment's name.
- Select the Access Tokens tab.
- Slide the Deployment token for ENVIRONMENT-NAME to Enabled
To regenerate an access token, click the Regenerate token button. If you have used the old token, for example in a CI system, you must replace all occurences of the old token with the new one.
Troubleshooting
View Deployment Log Files
You can view the deployment log files within Wayfinder's web interface as follow:
- Select Workspaces, and then click on All Applications.
- Select the name of your application and then select the name of your environment.
- Under the Components tab, select the name of your component
- Under the Pod's tab, select the name of the Pod.