|
| 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 | + ResourceKindS3proxy = "S3proxy" |
| 26 | + ResourceS3proxy = "s3proxy" |
| 27 | + ResourceS3proxys = "s3proxys" |
| 28 | +) |
| 29 | + |
| 30 | +// S3proxy defines the schama for S3proxy 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 | +// +kubebuilder:resource:path=s3proxys,singular=s3proxy,categories={kubeops,appscode} |
| 39 | +type S3proxy struct { |
| 40 | + metav1.TypeMeta `json:",inline,omitempty"` |
| 41 | + metav1.ObjectMeta `json:"metadata,omitempty"` |
| 42 | + Spec S3proxySpec `json:"spec,omitempty"` |
| 43 | +} |
| 44 | + |
| 45 | +// S3proxySpec is the schema for S3proxy Operator values file |
| 46 | +type S3proxySpec struct { |
| 47 | + ReplicaCount int `json:"replicaCount"` |
| 48 | + //+optional |
| 49 | + RegistryFQDN string `json:"registryFQDN"` |
| 50 | + Image ImageReference `json:"image"` |
| 51 | + //+optional |
| 52 | + ImagePullSecrets []string `json:"imagePullSecrets"` |
| 53 | + //+optional |
| 54 | + NameOverride string `json:"nameOverride"` |
| 55 | + //+optional |
| 56 | + FullnameOverride string `json:"fullnameOverride"` |
| 57 | + //+optional |
| 58 | + PodAnnotations map[string]string `json:"podAnnotations"` |
| 59 | + //+optional |
| 60 | + PodSecurityContext *core.PodSecurityContext `json:"podSecurityContext"` |
| 61 | + //+optional |
| 62 | + SecurityContext *core.SecurityContext `json:"securityContext"` |
| 63 | + Service AceServiceSpec `json:"service"` |
| 64 | + //+optional |
| 65 | + Resources core.ResourceRequirements `json:"resources"` |
| 66 | + //+optional |
| 67 | + NodeSelector map[string]string `json:"nodeSelector"` |
| 68 | + // If specified, the pod's tolerations. |
| 69 | + // +optional |
| 70 | + Tolerations []core.Toleration `json:"tolerations"` |
| 71 | + // If specified, the pod's scheduling constraints |
| 72 | + // +optional |
| 73 | + Affinity *core.Affinity `json:"affinity"` |
| 74 | + Persistence PersistenceSpec `json:"persistence"` |
| 75 | + StorageClass LocalObjectReference `json:"storageClass"` |
| 76 | + Ingress S3proxyIngress `json:"ingress"` |
| 77 | + S3proxy S3proxyConfig `json:"s3proxy"` |
| 78 | +} |
| 79 | + |
| 80 | +type S3proxyIngress struct { |
| 81 | + Enabled bool `json:"enabled"` |
| 82 | + ClassName string `json:"className"` |
| 83 | + Annotations map[string]string `json:"annotations"` |
| 84 | + Domain string `json:"domain"` |
| 85 | +} |
| 86 | + |
| 87 | +type S3proxyConfig struct { |
| 88 | + Auth S3proxyAuth `json:"auth"` |
| 89 | + TLS S3proxyTLS `json:"tls"` |
| 90 | +} |
| 91 | + |
| 92 | +type S3proxyAuth struct { |
| 93 | + AccessKeyId string `json:"accessKeyId"` |
| 94 | + SecretAccessKey string `json:"secretAccessKey"` |
| 95 | +} |
| 96 | + |
| 97 | +type S3proxyTLS struct { |
| 98 | + Enable bool `json:"enable"` |
| 99 | + Issuer CertificateIssuerRef `json:"issuer"` |
| 100 | + Secret LocalObjectReference `json:"secret"` |
| 101 | +} |
| 102 | + |
| 103 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 104 | + |
| 105 | +// S3proxyList is a list of S3proxys |
| 106 | +type S3proxyList struct { |
| 107 | + metav1.TypeMeta `json:",inline"` |
| 108 | + metav1.ListMeta `json:"metadata,omitempty"` |
| 109 | + // Items is a list of S3proxy CRD objects |
| 110 | + Items []S3proxy `json:"items,omitempty"` |
| 111 | +} |
0 commit comments