Skip to content

Commit

Permalink
feat(HostnameGenerator): apply templates to MeshServices (#10362)
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Beaumont <mjboamail@gmail.com>
  • Loading branch information
michaelbeaumont committed Jun 4, 2024
1 parent d82f752 commit c26bfce
Show file tree
Hide file tree
Showing 20 changed files with 1,213 additions and 6 deletions.
5 changes: 5 additions & 0 deletions app/kuma-cp/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/kumahq/kuma/pkg/core/bootstrap"
"github.com/kumahq/kuma/pkg/defaults"
"github.com/kumahq/kuma/pkg/diagnostics"
"github.com/kumahq/kuma/pkg/dns"
dp_server "github.com/kumahq/kuma/pkg/dp-server"
"github.com/kumahq/kuma/pkg/gc"
"github.com/kumahq/kuma/pkg/hds"
Expand Down Expand Up @@ -150,6 +151,10 @@ func newRunCmdWithOpts(opts kuma_cmd.RunCmdOpts) *cobra.Command {
runLog.Error(err, "unable to set up IPAM")
return err
}
if err := dns.SetupHostnameGenerator(rt); err != nil {
runLog.Error(err, "unable to set up hostname generator")
return err
}

runLog.Info("starting Control Plane", "version", kuma_version.Build.Version)
if err := rt.Start(gracefulCtx.Done()); err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5105,6 +5105,78 @@ spec:
properties:
hostname:
type: string
hostnameGeneratorRef:
properties:
name:
type: string
required:
- name
type: object
origin:
type: string
type: object
type: array
hostnameGenerators:
items:
properties:
conditions:
description: Conditions is an array of gateway instance conditions.
items:
properties:
message:
description: |-
message is a human readable message indicating details about the transition.
This may be an empty string.
maxLength: 32768
type: string
reason:
description: |-
reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False,
Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- message
- reason
- status
- type
type: object
type: array
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
hostnameGeneratorRef:
properties:
name:
type: string
required:
- name
type: object
required:
- hostnameGeneratorRef
type: object
type: array
tls:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5105,6 +5105,78 @@ spec:
properties:
hostname:
type: string
hostnameGeneratorRef:
properties:
name:
type: string
required:
- name
type: object
origin:
type: string
type: object
type: array
hostnameGenerators:
items:
properties:
conditions:
description: Conditions is an array of gateway instance conditions.
items:
properties:
message:
description: |-
message is a human readable message indicating details about the transition.
This may be an empty string.
maxLength: 32768
type: string
reason:
description: |-
reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False,
Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- message
- reason
- status
- type
type: object
type: array
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
hostnameGeneratorRef:
properties:
name:
type: string
required:
- name
type: object
required:
- hostnameGeneratorRef
type: object
type: array
tls:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5125,6 +5125,78 @@ spec:
properties:
hostname:
type: string
hostnameGeneratorRef:
properties:
name:
type: string
required:
- name
type: object
origin:
type: string
type: object
type: array
hostnameGenerators:
items:
properties:
conditions:
description: Conditions is an array of gateway instance conditions.
items:
properties:
message:
description: |-
message is a human readable message indicating details about the transition.
This may be an empty string.
maxLength: 32768
type: string
reason:
description: |-
reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False,
Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- message
- reason
- status
- type
type: object
type: array
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
hostnameGeneratorRef:
properties:
name:
type: string
required:
- name
type: object
required:
- hostnameGeneratorRef
type: object
type: array
tls:
Expand Down
72 changes: 72 additions & 0 deletions app/kumactl/cmd/install/testdata/install-crds.all.golden.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6537,6 +6537,78 @@ spec:
properties:
hostname:
type: string
hostnameGeneratorRef:
properties:
name:
type: string
required:
- name
type: object
origin:
type: string
type: object
type: array
hostnameGenerators:
items:
properties:
conditions:
description: Conditions is an array of gateway instance conditions.
items:
properties:
message:
description: |-
message is a human readable message indicating details about the transition.
This may be an empty string.
maxLength: 32768
type: string
reason:
description: |-
reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False,
Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- message
- reason
- status
- type
type: object
type: array
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
hostnameGeneratorRef:
properties:
name:
type: string
required:
- name
type: object
required:
- hostnameGeneratorRef
type: object
type: array
tls:
Expand Down
Loading

0 comments on commit c26bfce

Please sign in to comment.