contour
contour copied to clipboard
Tracking usability enhancements to ContourDeployment CRD
To make the Contour Gateway Provisioner and ContourDeployment more useful, more fields are required to customize the resources it generates, particularly the Contour Deployment, Envoy DaemonSet/Deployment, and Envoy Service.
Let's use this issue to collect the work in progress and organize how we want to develop the API so we can make changes in a consistent way.
The existing API looks like (godoc comments removed for brevity and relevant sub-types included):
type ContourDeploymentSpec struct {
// +optional
Contour *ContourSettings `json:"contour,omitempty"`
// +optional
Envoy *EnvoySettings `json:"envoy,omitempty"`
// +optional
RuntimeSettings *ContourConfigurationSpec `json:"runtimeSettings,omitempty"`
}
type ContourSettings struct {
// +kubebuilder:validation:Minimum=0
Replicas int32 `json:"replicas,omitempty"`
// +optional
NodePlacement *NodePlacement `json:"nodePlacement,omitempty"`
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=9
// +optional
KubernetesLogLevel uint8 `json:"kubernetesLogLevel,omitempty"`
// +optional
LogLevel LogLevel `json:"logLevel,omitempty"`
}
type EnvoySettings struct {
// +optional
WorkloadType WorkloadType `json:"workloadType,omitempty"`
// +kubebuilder:validation:Minimum=0
Replicas int32 `json:"replicas,omitempty"`
// +optional.
NetworkPublishing *NetworkPublishing `json:"networkPublishing,omitempty"`
// +optional
NodePlacement *NodePlacement `json:"nodePlacement,omitempty"`
}
type NetworkPublishing struct {
// +optional
Type NetworkPublishingType `json:"type,omitempty"`
// +optional
ServiceAnnotations map[string]string `json:"serviceAnnotations,omitempty"`
}
type NodePlacement struct {
// +optional
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
// +optional
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
}
From the open PRs it seems we may be eventually replicating most if not all configurable fields on Services, Deployments/DaemonSets
Relevant PRs:
- [ ] Contour Logging:
- https://github.com/projectcontour/contour/pull/4676
- https://github.com/projectcontour/contour/pull/4677
- [ ] Resource labels
- https://github.com/projectcontour/contour/pull/4709
- [ ] Resource annotations
- https://github.com/projectcontour/contour/pull/4681
- [ ] Resource requirements for Envoy/Contour pods
- https://github.com/projectcontour/contour/pull/4712
- [ ] Update Strategy
- https://github.com/projectcontour/contour/pull/4713
- [ ] Extra volumes/mounts
- https://github.com/projectcontour/contour/pull/4680
- [ ] Extra Envoy Service configuration
- https://github.com/projectcontour/contour/pull/4705
- ExternalTrafficPolicy?
- LoadBalancerIP?
- Other Service configuration?
Hey @izturn opened this to track the various PRs youve opened recently around the ContourDeployment CRD
@sunjayBhatia , thx
with my use case, the contour/envoy components are created by the provisioner are not production-ready at the moment, so i/we have to adjust them later with kubectl, so I think we need to add more attributes to customize the resources it generates & re-arrange some fields in the current structures
@izturn does the current set of PRs that you have open cover all of the fields that you need added at this time, or are there more coming?
Fortunately this CRD is still alpha so we have the right to make breaking changes if needed. It would be helpful to see all the known additions in one place, so we can talk about if we need to do any restructuring.
@izturn does the current set of PRs that you have open cover all of the fields that you need added at this time, or are there more coming?
Fortunately this CRD is still alpha so we have the right to make breaking changes if needed. It would be helpful to see all the known additions in one place, so we can talk about if we need to do any restructuring.
yes, that's all I need to be added at this time, @skriss you mean I need to collapse the all opening PRs into one?
@skriss you mean I need to collapse the all opening PRs into one?
No, I just meant it'd be helpful to write down the updated CRD spec with all the new fields, i.e. amending what @sunjayBhatia documented in https://github.com/projectcontour/contour/issues/4724#issue-1373751424, so we can look at it and make sure we're happy with the overall structure. In a comment on this issue is fine.
ok, i will update it later at this issue
type ContourDeploymentSpec struct {
// +optional
Contour *ContourSettings `json:"contour,omitempty"`
// +optional
Envoy *EnvoySettings `json:"envoy,omitempty"`
// +optional
RuntimeSettings *ContourConfigurationSpec `json:"runtimeSettings,omitempty"`
// +optional
CommonLabels map[string]string `json:"commonLabels,omitempty"`
}
type ContourSettings struct {
// +kubebuilder:validation:Minimum=0
Replicas int32 `json:"replicas,omitempty"`
// +optional
NodePlacement *NodePlacement `json:"nodePlacement,omitempty"`
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=9
// +optional
KubernetesLogLevel uint8 `json:"kubernetesLogLevel,omitempty"`
// +optional
LogLevel LogLevel `json:"logLevel,omitempty"`
// +optional
Strategy *appsv1.DeploymentStrategy `json:"strategy,omitempty"`
// +optional
Resources corev1.ResourceRequirements `json:"resources,omitempty"`
}
type EnvoySettings struct {
// +optional
WorkloadType WorkloadType `json:"workloadType,omitempty"`
// +kubebuilder:validation:Minimum=0
Replicas int32 `json:"replicas,omitempty"`
// +optional.
NetworkPublishing *NetworkPublishing `json:"networkPublishing,omitempty"`
// +optional
NodePlacement *NodePlacement `json:"nodePlacement,omitempty"`
// +optional
LogLevel LogLevel `json:"logLevel,omitempty"`
// +optional
ExtraVolumes []corev1.Volume `json:"extraVolumes,omitempty"`
// +optional
ExtraVolumeMounts []corev1.VolumeMount `json:"extraVolumeMounts,omitempty"`
// +optional
PodAnnotations map[string]string `json:"podAnnotations,omitempty"`
// +optional
Resources corev1.ResourceRequirements `json:"resources,omitempty"`
// +optional
UpdateStrategy *appsv1.DaemonSetUpdateStrategy `json:"updateStrategy,omitempty"`
// +optional
Strategy *appsv1.DeploymentStrategy `json:"strategy,omitempty"`
}
type Port struct {
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=253
Name string `json:"name"`
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Maximum=65535
Port int32 `json:"port"`
// +optional
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=65535
NodePort *int32 `json:"nodePort,omitempty"`
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Maximum=65535
ContainerPort int32 `json:"containerPort"`
}
type NetworkPublishing struct {
// +optional
Type NetworkPublishingType `json:"type,omitempty"`
// +optional
ServiceAnnotations map[string]string `json:"serviceAnnotations,omitempty"`
// +optional
ExternalTrafficPolicy corev1.ServiceExternalTrafficPolicyType `json:"externalTrafficPolicy,omitempty"`
// +optional
Ports []Port `json:"ports,omitempty"`
}
type NodePlacement struct {
// +optional
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
// +optional
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
}
@skriss PTAL
@sunjayBhatia pls add #4801 to the list
@sunjayBhatia #4803 pls