This is an ASP.NET Core application that shows how to use various IConfiguration
providers that are part of the Steeltoe project.
- Installed .NET 8 SDK
- Optional: Tanzu Platform for Cloud Foundry (optionally with Windows support) with Spring Cloud Services for Cloud Foundry and Cloud Foundry CLI
- Optional: Tanzu Platform for Kubernetes v1.5 or higher with Application Configuration Service and Tanzu CLI
- Start a Config Server docker container
- Run the sample
dotnet run
Refer to common tasks
for detailed instructions on creating a Spring Cloud Config Server instance in Cloud Foundry.
This sample expects the config server to be backed by the spring-cloud-samples
repo.
- Login to your Cloud Foundry environment and target your org/space
cf target -o your-org -s your-space
- Run the
cf push
command to deploy from source- When deploying to Windows, binaries must be built locally before push. Use the following commands instead:
dotnet publish -r win-x64 --self-contained cf push -f manifest-windows.yml -p bin/Release/net8.0/win-x64/publish
- When deploying to Windows, binaries must be built locally before push. Use the following commands instead:
YAML files for creating the needed resources are included with this project, and their usage is specified below, but you are encouraged to review and/or customize the contents of the files before applying them.
To create configuration objects (ConfigurationSource, ConfigurationSlice, ResourceClaim), run:
kubectl config set-context --current --namespace=your-namespace
kubectl apply -f ./config/application-configuration-service
For complete instructions, follow the documentation.
To deploy from local source code:
tanzu app workload apply --local-path . --file ./config/workload.yaml -y
Alternatively, from locally built binaries:
dotnet publish -r linux-x64 --no-self-contained
tanzu app workload apply --local-path ./bin/Release/net8.0/linux-x64/publish --file ./config/workload.yaml -y
See the Tanzu documentation for details.
See the Official Steeltoe Configuration Documentation for more detailed information.