|
| 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 | + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 21 | + mona "kmodules.xyz/monitoring-agent-api/api/v1" |
| 22 | + api "x-helm.dev/apimachinery/apis/releases/v1alpha1" |
| 23 | +) |
| 24 | + |
| 25 | +const ( |
| 26 | + ResourceKindHazelcastAlerts = "HazelcastAlerts" |
| 27 | + ResourceHazelcastAlerts = "hazelcastalerts" |
| 28 | + ResourceHazelcastAlertss = "hazelcastalertss" |
| 29 | +) |
| 30 | + |
| 31 | +// HazelcastAlerts defines the schama for KubeDB Ops Manager Operator Installer. |
| 32 | + |
| 33 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 34 | + |
| 35 | +// +kubebuilder:object:root=true |
| 36 | +// +kubebuilder:resource:path=hazelcastalertss,singular=hazelcastalerts,categories={kubedb,appscode} |
| 37 | +type HazelcastAlerts struct { |
| 38 | + metav1.TypeMeta `json:",inline"` |
| 39 | + metav1.ObjectMeta `json:"metadata,omitempty"` |
| 40 | + Spec HazelcastAlertsSpec `json:"spec,omitempty"` |
| 41 | +} |
| 42 | + |
| 43 | +// HazelcastAlertsSpec is the schema for kubedb-autoscaler chart values file |
| 44 | +type HazelcastAlertsSpec struct { |
| 45 | + api.Metadata `json:"metadata,omitempty"` |
| 46 | + Form HazelcastAlertsSpecForm `json:"form"` |
| 47 | + Grafana Grafana `json:"grafana"` |
| 48 | +} |
| 49 | + |
| 50 | +type HazelcastAlertsSpecForm struct { |
| 51 | + Alert HazelcastAlert `json:"alert"` |
| 52 | +} |
| 53 | + |
| 54 | +type HazelcastAlert struct { |
| 55 | + Enabled mona.SeverityFlag `json:"enabled"` |
| 56 | + Labels map[string]string `json:"labels"` |
| 57 | + // +optional |
| 58 | + Annotations map[string]string `json:"annotations"` |
| 59 | + // +optional |
| 60 | + AdditionalRuleLabels map[string]string `json:"additionalRuleLabels"` |
| 61 | + Groups HazelcastAlertGroups `json:"groups"` |
| 62 | +} |
| 63 | + |
| 64 | +type HazelcastAlertGroups struct { |
| 65 | + Database HazelcastDatabaseAlert `json:"database"` |
| 66 | + Provisioner ProvisionerAlert `json:"provisioner"` |
| 67 | + OpsManager OpsManagerAlert `json:"opsManager"` |
| 68 | +} |
| 69 | + |
| 70 | +type HazelcastDatabaseAlert struct { |
| 71 | + Enabled mona.SeverityFlag `json:"enabled"` |
| 72 | + Rules HazelcastDatabaseAlertRules `json:"rules"` |
| 73 | +} |
| 74 | + |
| 75 | +type HazelcastDatabaseAlertRules struct { |
| 76 | + HazelcastPartitionCountExceed IntValAlert `json:"hazelcastPartitionCountExceed"` |
| 77 | + HazelcastHighHeapPercentage IntValAlert `json:"hazelcastHighHeapPercentage"` |
| 78 | + HazelcastHighMemoryUsage IntValAlert `json:"hazelcastHighMemoryUsage"` |
| 79 | + HazelcastHighPhysicalMemoryUsage IntValAlert `json:"hazelcastHighPhysicalMemoryUsage"` |
| 80 | + HazelcastHighLatency IntValAlert `json:"hazelcastHighLatency"` |
| 81 | + HazelcastSystemCPULoadExceed IntValAlert `json:"hazelcastSystemCPULoadExceed"` |
| 82 | + DiskUsageHigh IntValAlert `json:"diskUsageHigh"` |
| 83 | + DiskAlmostFull IntValAlert `json:"diskAlmostFull"` |
| 84 | +} |
| 85 | + |
| 86 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 87 | + |
| 88 | +// HazelcastAlertsList is a list of HazelcastAlertss |
| 89 | +type HazelcastAlertsList struct { |
| 90 | + metav1.TypeMeta `json:",inline"` |
| 91 | + metav1.ListMeta `json:"metadata,omitempty"` |
| 92 | + // Items is a list of HazelcastAlerts CRD objects |
| 93 | + Items []HazelcastAlerts `json:"items,omitempty"` |
| 94 | +} |
0 commit comments