|
| 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 | + "kmodules.xyz/resource-metadata/apis/shared" |
| 23 | +) |
| 24 | + |
| 25 | +const ( |
| 26 | + ResourceKindGcpCredentialManager = "GcpCredentialManager" |
| 27 | + ResourceGcpCredentialManager = "gcpcredentialmanager" |
| 28 | + ResourceGcpCredentialManagers = "gcpcredentialmanagers" |
| 29 | +) |
| 30 | + |
| 31 | +// GcpCredentialManager defines the schema for GcpCredentialManager operator installer. |
| 32 | + |
| 33 | +// +genclient |
| 34 | +// +genclient:skipVerbs=updateStatus |
| 35 | +// +k8s:openapi-gen=true |
| 36 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 37 | + |
| 38 | +// +kubebuilder:object:root=true |
| 39 | +type GcpCredentialManager struct { |
| 40 | + metav1.TypeMeta `json:",inline,omitempty"` |
| 41 | + metav1.ObjectMeta `json:"metadata,omitempty"` |
| 42 | + Spec GcpCredentialManagerSpec `json:"spec,omitempty"` |
| 43 | +} |
| 44 | + |
| 45 | +// GcpCredentialManagerSpec is the schema for GCP Credential Manager values file. |
| 46 | +type GcpCredentialManagerSpec struct { |
| 47 | + //+optional |
| 48 | + NameOverride string `json:"nameOverride"` |
| 49 | + //+optional |
| 50 | + FullnameOverride string `json:"fullnameOverride"` |
| 51 | + //+optional |
| 52 | + RegistryFQDN string `json:"registryFQDN"` |
| 53 | + ReplicaCount int32 `json:"replicaCount"` |
| 54 | + Image ImageReference `json:"image"` |
| 55 | + //+optional |
| 56 | + ImagePullSecrets []string `json:"imagePullSecrets"` |
| 57 | + //+optional |
| 58 | + PodAnnotations map[string]string `json:"podAnnotations"` |
| 59 | + //+optional |
| 60 | + PodLabels map[string]string `json:"podLabels"` |
| 61 | + // PodSecurityContext holds pod-level security attributes and common container settings. |
| 62 | + // Optional: Defaults to empty. See type description for default values of each field. |
| 63 | + // +optional |
| 64 | + PodSecurityContext *core.PodSecurityContext `json:"podSecurityContext"` |
| 65 | + //+optional |
| 66 | + SecurityContext *core.SecurityContext `json:"securityContext"` |
| 67 | + //+optional |
| 68 | + Resources core.ResourceRequirements `json:"resources"` |
| 69 | + //+optional |
| 70 | + NodeSelector map[string]string `json:"nodeSelector"` |
| 71 | + // If specified, the pod's tolerations. |
| 72 | + // +optional |
| 73 | + Tolerations []core.Toleration `json:"tolerations"` |
| 74 | + // If specified, the pod's scheduling constraints. |
| 75 | + // +optional |
| 76 | + Affinity *core.Affinity `json:"affinity"` |
| 77 | + // +optional |
| 78 | + LivenessProbe *core.Probe `json:"livenessProbe"` |
| 79 | + // +optional |
| 80 | + ReadinessProbe *core.Probe `json:"readinessProbe"` |
| 81 | + Service ServiceSpec `json:"service"` |
| 82 | + ServiceAccount ServiceAccountSpec `json:"serviceAccount"` |
| 83 | + Volumes []core.Volume `json:"volumes"` |
| 84 | + VolumeMounts []core.VolumeMount `json:"volumeMounts"` |
| 85 | + // +optional |
| 86 | + Distro shared.DistroSpec `json:"distro"` |
| 87 | + // +optional |
| 88 | + Apiserver GcpCredentialManagerApiserver `json:"apiserver"` |
| 89 | + // +optional |
| 90 | + BucketAccessor GcpBucketAccessor `json:"bucketAccessor"` |
| 91 | +} |
| 92 | + |
| 93 | +type GcpCredentialManagerApiserver struct { |
| 94 | + GroupPriorityMinimum int `json:"groupPriorityMinimum"` |
| 95 | + VersionPriority int `json:"versionPriority"` |
| 96 | + EnableMutatingWebhook bool `json:"enableMutatingWebhook"` |
| 97 | + EnableValidatingWebhook bool `json:"enableValidatingWebhook"` |
| 98 | + Ca string `json:"ca"` |
| 99 | + BypassValidatingWebhookXray bool `json:"bypassValidatingWebhookXray"` |
| 100 | + UseKubeapiserverFqdnForAks bool `json:"useKubeapiserverFqdnForAks"` |
| 101 | + Healthcheck HealthcheckSpec `json:"healthcheck"` |
| 102 | + ServingCerts ServingCerts `json:"servingCerts"` |
| 103 | +} |
| 104 | + |
| 105 | +type GcpBucketAccessor struct { |
| 106 | + GcsMaxIntervalSeconds string `json:"gcsMaxIntervalSeconds"` |
| 107 | + GcsMaxWaitSeconds string `json:"gcsMaxWaitSeconds"` |
| 108 | +} |
| 109 | + |
| 110 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 111 | + |
| 112 | +// GcpCredentialManagerList is a list of GcpCredentialManagers. |
| 113 | +type GcpCredentialManagerList struct { |
| 114 | + metav1.TypeMeta `json:",inline"` |
| 115 | + metav1.ListMeta `json:"metadata,omitempty"` |
| 116 | + // Items is a list of GcpCredentialManager CRD objects. |
| 117 | + Items []GcpCredentialManager `json:"items,omitempty"` |
| 118 | +} |
0 commit comments