diff --git a/api/v1alpha1/codecoapp_types.go b/api/v1alpha1/codecoapp_types.go index 50afdbe3eb08f9295478e87349421252ed4559c9..0ccc016d4bc96c40987fec3202069f8970a082f3 100644 --- a/api/v1alpha1/codecoapp_types.go +++ b/api/v1alpha1/codecoapp_types.go @@ -49,21 +49,17 @@ const ( // CodecoAppResource defines the resource consumption of CodecoApp type CodecoAppResource struct { - //+kubebuilder:validation:Minimum=0 //+kubebuilder:validation:default=100 - CpuUsagePct uint64 `json:"cpu-usage-pct,omitempty"` + CpuUsagePct string `json:"cpu,omitempty"` - //+kubebuilder:validation:Minimum=0 //+kubebuilder:validation:default=8 - MemUsageGB uint64 `json:"mem-usage-GB,omitempty"` + MemUsageGB string `json:"mem,omitempty"` - //+kubebuilder:validation:Minimum=0 //+kubebuilder:validation:default=25 - NWBandwidthMbs uint64 `json:"nwbandwidth-Mbs,omitempty"` + NWBandwidthMbs string `json:"nwbandwidth,omitempty"` - //+kubebuilder:validation:Minimum=0 //+kubebuilder:validation:default=10 - NWLatencyMs uint64 `json:"nwlatency-ms,omitempty"` + NWLatencyMs string `json:"nwlatency,omitempty"` } // CodecoAppMSSpec defines the desired state of CodecoApp micro service diff --git a/config/crd/bases/codeco.he-codeco.eu_codecoapps.yaml b/config/crd/bases/codeco.he-codeco.eu_codecoapps.yaml index 0cbe415a703b454eccdd7e0541763317f0790194..c8d0bfed999074d669d3227abb56c1af8122e161 100644 --- a/config/crd/bases/codeco.he-codeco.eu_codecoapps.yaml +++ b/config/crd/bases/codeco.he-codeco.eu_codecoapps.yaml @@ -55,22 +55,14 @@ spec: micro service required resources. Edit codecoapp_types.go to remove/update properties: - cpu-usage-pct: - format: int64 - minimum: 0 - type: integer - mem-usage-GB: - format: int64 - minimum: 0 - type: integer - nwbandwidth-Mbs: - format: int64 - minimum: 0 - type: integer - nwlatency-ms: - format: int64 - minimum: 0 - type: integer + cpu: + type: string + mem: + type: string + nwbandwidth: + type: string + nwlatency: + type: string type: object required: - name diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 6beebd8d87eaa4e7bda7d8840d1b50901000442b..97b3504c557f4b456c62e649a541335baa01cfc4 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -5,4 +5,4 @@ kind: Kustomization images: - name: controller newName: quay.io/jsalomon/codecoapp-test - newTag: v0.0.4 + newTag: v0.0.5 diff --git a/config/samples/codeco_v1alpha1_codecoapp.yaml b/config/samples/codeco_v1alpha1_codecoapp.yaml index 18f2b4990a33d52d00246a33a90818cfaf786b91..dd2ea28e9f6d90f689d2e8908cba27a6aefcbf0c 100644 --- a/config/samples/codeco_v1alpha1_codecoapp.yaml +++ b/config/samples/codeco_v1alpha1_codecoapp.yaml @@ -16,18 +16,18 @@ spec: name: "CODECO micro service 1", podspecname: "MicroService1", required-resources: { - cpu-usage-pct: 200, - mem-usage-GB: 120, - nwbandwidth-Mbs: 10 + cpu: "2", + mem: 120G, + nwbandwidth: 10M } }, { name: "CODECO micro service 2", podspecname: "MicroService2", required-resources: { - cpu-usage-pct: 150, - mem-usage-GB: 80, - nwbandwidth-Mbs: 20 + cpu: 1500m, + mem: 80G, + nwbandwidth: 20M } }, ]