dotnet / tye

Tye is a tool that makes developing, testing, and deploying microservices and distributed applications easier. Project Tye includes a local orchestrator to make developing microservices easier and the ability to deploy microservices to Kubernetes with minimal configuration.
MIT License
5.28k stars 520 forks source link

Getting binding-production error and not sure why #716

Open jongio opened 4 years ago

jongio commented 4 years ago

Describe the bug

With this tye

# define multiple services here
services:
- name: azurite
  image: mcr.microsoft.com/azure-storage/azurite
  bindings:
    - port: 10000
      name: blob
    - port: 10001
      name: queue

- name: webapp
  project: ${TYE_ROOT}/src/net/WebApp/WebApp.csproj
  bindings:
    - port: 1080

- name: api
  project: ${TYE_ROOT}/src/net/Api/Api.csproj
  bindings:
    - port: 2080

- name: function
  azureFunction: ${TYE_ROOT}/src/net/Services/Functions/
  bindings:
    - port: 3080
      protocol: http

- name: service
  project: ${TYE_ROOT}/src/net/Services/QueueService/QueueService.csproj

I get this:

        Validating secret 'binding-production-azurite-blob-secret'.
Drats! 'deploy' failed:
        The secret 'binding-production-azurite-blob-secret' used for service 'azurite' is missing from the deployment environment. Rerun the command with --interactive to specify the value interactively, or with --force to skip validation. Alternatively use the following command to manually create the secret.
kubectl create secret generic binding-production-azurite-blob-secret --namespace default --from-literal=protocol=<value> --from-literal=host=<value> --from-literal=port=<value>

If I add --force, I get this:

        Validating secret 'binding-production-azurite-blob-secret'.
        Skipping because force was specified.
        Validating secret 'binding-production-azurite-queue-secret'.
        Skipping because force was specified.
        Validating secret 'binding-production-function-secret'.
        Skipping because force was specified.

What is the expectation for those secrets?

How can we help the user figure this out on their own?

To Reproduce

Run tye deploy with the tye.yaml above.

Further technical details

WSL2

azsdke2e azsdke2e2

Farzadd commented 1 year ago

For anyone coming across this issue, you need to create the secrets required for service discovery on your kube env.

kubectl create secret generic binding-production--secret --namespace --from-literal=protocol= --from-literal=host= --from-literal=port=

Using the force flag will bypass this but your services will not configure.