-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Ingress replica CRD #268
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package v1alpha1 | ||
|
||
import ( | ||
corev1 "k8s.io/api/core/v1" | ||
v1 "k8s.io/api/networking/v1" | ||
"k8s.io/apimachinery/pkg/api/meta" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
func init() { | ||
SchemeBuilder.Register(&IngressReplica{}, &IngressReplicaList{}) | ||
} | ||
|
||
// IngressReplicaList contains a list of [IngressReplica] | ||
// +kubebuilder:object:root=true | ||
type IngressReplicaList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []IngressReplica `json:"items"` | ||
} | ||
|
||
// IngressReplica is the Schema for the console ingress replica | ||
// +kubebuilder:object:root=true | ||
// +kubebuilder:resource:scope=Namespaced | ||
// +kubebuilder:subresource:status | ||
type IngressReplica struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
// Spec of the IngressReplica | ||
// +kubebuilder:validation:Required | ||
Spec IngressReplicaSpec `json:"spec"` | ||
|
||
// Status of the IngressReplica | ||
// +kubebuilder:validation:Optional | ||
Status Status `json:"status,omitempty"` | ||
} | ||
|
||
type IngressReplicaSpec struct { | ||
// +kubebuilder:validation:Required | ||
IngressRef corev1.ObjectReference `json:"ingressRef"` | ||
|
||
// +kubebuilder:validation:Optional | ||
IngressClassName *string `json:"ingressClassName,omitempty"` | ||
|
||
// +kubebuilder:validation:Optional | ||
TLS []v1.IngressTLS `json:"tls,omitempty"` | ||
|
||
// +kubebuilder:validation:Required | ||
HostMappings map[string]string `json:"hostMappings"` | ||
} | ||
|
||
func (in *IngressReplica) SetCondition(condition metav1.Condition) { | ||
meta.SetStatusCondition(&in.Status.Conditions, condition) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
198 changes: 198 additions & 0 deletions
198
charts/deployment-operator/crds/deployments.plural.sh_ingressreplicas.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.16.3 | ||
name: ingressreplicas.deployments.plural.sh | ||
spec: | ||
group: deployments.plural.sh | ||
names: | ||
kind: IngressReplica | ||
listKind: IngressReplicaList | ||
plural: ingressreplicas | ||
singular: ingressreplica | ||
scope: Namespaced | ||
versions: | ||
- name: v1alpha1 | ||
schema: | ||
openAPIV3Schema: | ||
description: IngressReplica is the Schema for the console ingress replica | ||
properties: | ||
apiVersion: | ||
description: |- | ||
APIVersion defines the versioned schema of this representation of an object. | ||
Servers should convert recognized schemas to the latest internal value, and | ||
may reject unrecognized values. | ||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | ||
type: string | ||
kind: | ||
description: |- | ||
Kind is a string value representing the REST resource this object represents. | ||
Servers may infer this from the endpoint the client submits requests to. | ||
Cannot be updated. | ||
In CamelCase. | ||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
description: Spec of the IngressReplica | ||
properties: | ||
hostMappings: | ||
additionalProperties: | ||
type: string | ||
type: object | ||
ingressClassName: | ||
type: string | ||
ingressRef: | ||
description: ObjectReference contains enough information to let you | ||
inspect or modify the referred object. | ||
properties: | ||
apiVersion: | ||
description: API version of the referent. | ||
type: string | ||
fieldPath: | ||
description: |- | ||
If referring to a piece of an object instead of an entire object, this string | ||
should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. | ||
For example, if the object reference is to a container within a pod, this would take on a value like: | ||
"spec.containers{name}" (where "name" refers to the name of the container that triggered | ||
the event) or if no container name is specified "spec.containers[2]" (container with | ||
index 2 in this pod). This syntax is chosen only to have some well-defined way of | ||
referencing a part of an object. | ||
type: string | ||
kind: | ||
description: |- | ||
Kind of the referent. | ||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | ||
type: string | ||
name: | ||
description: |- | ||
Name of the referent. | ||
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | ||
type: string | ||
namespace: | ||
description: |- | ||
Namespace of the referent. | ||
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ | ||
type: string | ||
resourceVersion: | ||
description: |- | ||
Specific resourceVersion to which this reference is made, if any. | ||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency | ||
type: string | ||
uid: | ||
description: |- | ||
UID of the referent. | ||
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids | ||
type: string | ||
type: object | ||
x-kubernetes-map-type: atomic | ||
tls: | ||
items: | ||
description: IngressTLS describes the transport layer security associated | ||
with an ingress. | ||
properties: | ||
hosts: | ||
description: |- | ||
hosts is a list of hosts included in the TLS certificate. The values in | ||
this list must match the name/s used in the tlsSecret. Defaults to the | ||
wildcard host setting for the loadbalancer controller fulfilling this | ||
Ingress, if left unspecified. | ||
items: | ||
type: string | ||
type: array | ||
x-kubernetes-list-type: atomic | ||
secretName: | ||
description: |- | ||
secretName is the name of the secret used to terminate TLS traffic on | ||
port 443. Field is left optional to allow TLS routing based on SNI | ||
hostname alone. If the SNI host in a listener conflicts with the "Host" | ||
header field used by an IngressRule, the SNI host is used for termination | ||
and value of the "Host" header is used for routing. | ||
type: string | ||
type: object | ||
type: array | ||
required: | ||
- hostMappings | ||
- ingressRef | ||
type: object | ||
status: | ||
description: Status of the IngressReplica | ||
properties: | ||
conditions: | ||
description: Represents the observations of a PrAutomation's current | ||
state. | ||
items: | ||
description: Condition contains details for one aspect of the current | ||
state of this API Resource. | ||
properties: | ||
lastTransitionTime: | ||
description: |- | ||
lastTransitionTime is the last time the condition transitioned from one status to another. | ||
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. | ||
format: date-time | ||
type: string | ||
message: | ||
description: |- | ||
message is a human readable message indicating details about the transition. | ||
This may be an empty string. | ||
maxLength: 32768 | ||
type: string | ||
observedGeneration: | ||
description: |- | ||
observedGeneration represents the .metadata.generation that the condition was set based upon. | ||
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date | ||
with respect to the current state of the instance. | ||
format: int64 | ||
minimum: 0 | ||
type: integer | ||
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. | ||
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: | ||
- lastTransitionTime | ||
- message | ||
- reason | ||
- status | ||
- type | ||
type: object | ||
type: array | ||
x-kubernetes-list-map-keys: | ||
- type | ||
x-kubernetes-list-type: map | ||
id: | ||
description: ID of the resource in the Console API. | ||
type: string | ||
sha: | ||
description: SHA of last applied configuration. | ||
type: string | ||
type: object | ||
required: | ||
- spec | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also support overriding ingress class here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done