Octopus supports the deployment of Kubernetes resources through the
Deploy Raw Kubernetes YAML step.
This step allows you to configure Kubernetes manually, leveraging the full power of Octopus features to support your setup. This approach is more flexible and gives you complete control over the YAML but requires deeper knowledge of Kubernetes configuration.
You can source your YAML from three different sources:
- Git Repository - New!
- Inline Script
Sourcing from Git Repositories was added in Octopus 2023.3.
You can find more information about this feature in this blog post.
Sourcing from a Git repository clones the whole repository onto Octopus Server during a deployment. Ensure that you do not have any sensitive data in your git repository.
Sourcing from a Git Repository can streamline your deployment process by reducing the amount of steps required to get your YAML into Octopus. In Octopus, when YAML is sourced from a Git repository, we call it a Git Manifest.
To configure a Git Repository source, select the
Git Repository option as your YAML Source.
When you choose the tip of a branch for your Git Manifest when creating a Release, the commit hash is saved to the Release. This means redeploying that release will only ever use that specific commit and not the new tip of the branch.
Sourcing from a Package is the traditional way to load data from external sources. You can specify the Package Feed and Package ID as well as a path or paths† to the file(s) in the package that you want to deploy.
To configure a package source, select the
Package option as your YAML Source.
†In 2023.3, sourcing from packages can take advantage of Glob Patterns and Multiple Paths.
The simplest way to get going with this step is to use Inline YAML. You can create your YAML resources in the inline editor which will be saved in the project in Octopus.
To configure an inline YAML source, select the
Inline YAML as your YAML Source, click
Add Source Code and start writing!
This is not the recommended approach for advanced cases as it does not allow for version management unless you are using it in conjunction with Config As Code.
Glob Patterns and Multiple Paths
The Git Repository and Package data sources require you to specify which files you would like to apply from the git repo or package. Previously we only allowed a single file to be applied via an explicit path. In release 2023.3, we have added the ability to source multiple files via multiple paths for both Git Repositories and Packages.
There are a few different ways to take advantage of this feature:
You can list several paths by separating them with a new line.
Note: Each path will be applied in order from top to bottom.
You can use a glob pattern to select multiple files in a single path.
Note: All files matching a glob pattern will be applied at the same time.
Both options at the same time. This gives you the best of both worlds!
Note: If multiple glob patterns find the same file, the file will be applied twice.
Help us continuously improve
Please let us know if you have any feedback about this page.
Page updated on Friday, July 28, 2023