-
Notifications
You must be signed in to change notification settings - Fork 816
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add allocation policy CRD and schema definition.
- Loading branch information
Showing
4 changed files
with
327 additions
and
0 deletions.
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,95 @@ | ||
# Copyright 2019 Google LLC All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
{{- if .Values.agones.crds.install }} | ||
|
||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
controller-tools.k8s.io: "1.0" | ||
component: crd | ||
app: {{ template "agones.name" . }} | ||
chart: {{ template "agones.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
name: allocationpolicies.stable.agones.dev | ||
spec: | ||
group: stable.agones.dev | ||
names: | ||
kind: AllocationPolicy | ||
plural: allocationpolicies | ||
scope: Namespaced | ||
validation: | ||
openAPIV3Schema: | ||
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/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/api-conventions.md#types-kinds' | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
properties: | ||
connectionInfo: | ||
properties: | ||
allocationServiceSecret: | ||
properties: | ||
certificateAuthorityData: | ||
type: string | ||
serviceAccountToken: | ||
type: string | ||
required: | ||
- certificateAuthorityData | ||
- serviceAccountToken | ||
type: object | ||
apiServerEndpoint: | ||
type: string | ||
clusterName: | ||
type: string | ||
namespace: | ||
type: string | ||
required: | ||
- clusterName | ||
- apiServerEndpoint | ||
- namespace | ||
- allocationServiceSecret | ||
type: object | ||
priority: | ||
format: int64 | ||
minimum: 0 | ||
type: integer | ||
weight: | ||
format: int64 | ||
minimum: 0 | ||
type: integer | ||
required: | ||
- priority | ||
- weight | ||
type: object | ||
version: v1alpha1 | ||
status: | ||
acceptedNames: | ||
kind: "" | ||
plural: "" | ||
conditions: [] | ||
storedVersions: [] | ||
{{- end }} |
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
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,61 @@ | ||
// Copyright 2019 Google LLC All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package v1alpha1 | ||
|
||
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
||
// AllocationPolicySpec defines the desired state of AllocationPolicy | ||
type AllocationPolicySpec struct { | ||
// +kubebuilder:validation:Minimum=0 | ||
Priority int `json:"priority"` | ||
// +kubebuilder:validation:Minimum=0 | ||
Weight int `json:"weight"` | ||
ConnectionInfo ClusterConnectionInfo `json:"connectionInfo,omitempty"` | ||
} | ||
|
||
// ClusterConnectionInfo defines the connection information for a cluster | ||
type ClusterConnectionInfo struct { | ||
ClusterName string `json:"clusterName"` | ||
APIServerEndpoint string `json:"apiServerEndpoint"` | ||
Namespace string `json:"namespace"` | ||
AllocationServiceSecret ClusterSecret `json:"allocationServiceSecret"` | ||
} | ||
|
||
// ClusterSecret defines the secret to connect to a cluster. | ||
type ClusterSecret struct { | ||
CertificateAuthorityData string `json:"certificateAuthorityData"` | ||
ServiceAccountToken string `json:"serviceAccountToken"` | ||
} | ||
|
||
// +genclient | ||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// AllocationPolicy is the Schema for the allocationpolicies API | ||
// +k8s:openapi-gen=true | ||
type AllocationPolicy struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec AllocationPolicySpec `json:"spec,omitempty"` | ||
} | ||
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// AllocationPolicyList contains a list of AllocationPolicies | ||
type AllocationPolicyList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []AllocationPolicy `json:"items"` | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.