Skip to content

Example of generating multiple resources from a single template file #4

Open
@oxr463

Description

@oxr463

In the values.yaml file, we could specify several sites:

sites:
  - name: foo
    source: "foo.com"
  - name: bar
    source: "bar.com
  - name: baz
    source: "baz.com

Then the chart would generate three deployments and three services, one for each site.

Then we could add an ingress that includes each of the services:

spec:
  rules:
  - host: hello-world.com
    http:
      paths:
      - backend:
          service:
            name: foo
            port:
              name: http
        path: /foo
        pathType: Prefix
      - backend:
          service:
            name: bar
            port:
              name: http
        path: /bar
        pathType: Prefix
      - backend:
          service:
            name: baz
            port:
              name: http
        path: /baz
        pathType: Prefix

Then each site would be accessible via the following URLs:

  • hello-world.com/foo
  • hello-world.com/bar
  • hello-world.com/baz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions