|
| 1 | +/* |
| 2 | +Copyright AppsCode Inc. and Contributors |
| 3 | +
|
| 4 | +Licensed under the AppsCode Community License 1.0.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | +
|
| 8 | + https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +*/ |
| 16 | + |
| 17 | +package v1alpha1 |
| 18 | + |
| 19 | +import ( |
| 20 | + core "k8s.io/api/core/v1" |
| 21 | + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 22 | +) |
| 23 | + |
| 24 | +const ( |
| 25 | + ResourceKindStatefulSet = "StatefulSet" |
| 26 | + ResourceStatefulSet = "statefulset" |
| 27 | + ResourceStatefulSets = "statefulsets" |
| 28 | +) |
| 29 | + |
| 30 | +// StatefulSet defines the schama for StatefulSet operator installer. |
| 31 | + |
| 32 | +// +genclient |
| 33 | +// +genclient:skipVerbs=updateStatus |
| 34 | +// +k8s:openapi-gen=true |
| 35 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 36 | + |
| 37 | +// +kubebuilder:object:root=true |
| 38 | +type StatefulSet struct { |
| 39 | + metav1.TypeMeta `json:",inline,omitempty"` |
| 40 | + metav1.ObjectMeta `json:"metadata,omitempty"` |
| 41 | + Spec StatefulSetSpec `json:"spec,omitempty"` |
| 42 | +} |
| 43 | + |
| 44 | +// StatefulSetSpec is the schema for Operator Operator values file |
| 45 | +type StatefulSetSpec struct { |
| 46 | + //+optional |
| 47 | + NameOverride string `json:"nameOverride"` |
| 48 | + //+optional |
| 49 | + FullnameOverride string `json:"fullnameOverride"` |
| 50 | + RegistryFQDN string `json:"registryFQDN"` |
| 51 | + ReplicaCount int32 `json:"replicaCount"` |
| 52 | + Operator ContianerRef `json:"operator"` |
| 53 | + RbacProxy ImageRef `json:"rbacproxy"` |
| 54 | + Cleaner CleanerRef `json:"cleaner"` |
| 55 | + ImagePullPolicy string `json:"imagePullPolicy"` |
| 56 | + //+optional |
| 57 | + ImagePullSecrets []string `json:"imagePullSecrets"` |
| 58 | + //+optional |
| 59 | + CriticalAddon bool `json:"criticalAddon"` |
| 60 | + //+optional |
| 61 | + LogLevel int32 `json:"logLevel"` |
| 62 | + //+optional |
| 63 | + Annotations map[string]string `json:"annotations"` |
| 64 | + //+optional |
| 65 | + PodAnnotations map[string]string `json:"podAnnotations"` |
| 66 | + //+optional |
| 67 | + PodLabels map[string]string `json:"podLabels"` |
| 68 | + //+optional |
| 69 | + NodeSelector map[string]string `json:"nodeSelector"` |
| 70 | + // If specified, the pod's tolerations. |
| 71 | + // +optional |
| 72 | + Tolerations []core.Toleration `json:"tolerations"` |
| 73 | + // If specified, the pod's scheduling constraints |
| 74 | + // +optional |
| 75 | + Affinity *core.Affinity `json:"affinity"` |
| 76 | + // PodSecurityContext holds pod-level security attributes and common container settings. |
| 77 | + // Optional: Defaults to empty. See type description for default values of each field. |
| 78 | + // +optional |
| 79 | + PodSecurityContext *core.PodSecurityContext `json:"podSecurityContext"` |
| 80 | + ServiceAccount ServiceAccountSpec `json:"serviceAccount"` |
| 81 | + // +optional |
| 82 | + Apiserver WebHookSpec `json:"apiserver"` |
| 83 | + Monitoring Monitoring `json:"monitoring"` |
| 84 | +} |
| 85 | + |
| 86 | +type ContianerRef struct { |
| 87 | + ImageRef `json:",inline"` |
| 88 | + // Compute Resources required by the sidecar container. |
| 89 | + // +optional |
| 90 | + Resources core.ResourceRequirements `json:"resources"` |
| 91 | +} |
| 92 | + |
| 93 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 94 | + |
| 95 | +// StatefulSetList is a list of StatefulSets |
| 96 | +type StatefulSetList struct { |
| 97 | + metav1.TypeMeta `json:",inline"` |
| 98 | + metav1.ListMeta `json:"metadata,omitempty"` |
| 99 | + // Items is a list of StatefulSet CRD objects |
| 100 | + Items []StatefulSet `json:"items,omitempty"` |
| 101 | +} |
0 commit comments