diff --git a/Makefile b/Makefile index 399aa30..0d28809 100644 --- a/Makefile +++ b/Makefile @@ -139,8 +139,8 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen ENVTEST ?= $(LOCALBIN)/setup-envtest ## Tool Versions -KUSTOMIZE_VERSION ?= v5.0.1 -CONTROLLER_TOOLS_VERSION ?= v0.12.0 +KUSTOMIZE_VERSION ?= v5.2.1 +CONTROLLER_TOOLS_VERSION ?= v0.13.0 .PHONY: kustomize kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. If wrong version is installed, it will be removed before downloading. diff --git a/api/proxmox/v1alpha1/container_types.go b/api/proxmox/v1alpha1/container_types.go index 9e34417..87e6931 100644 --- a/api/proxmox/v1alpha1/container_types.go +++ b/api/proxmox/v1alpha1/container_types.go @@ -76,6 +76,14 @@ type ContainerStatus struct { //+kubebuilder:object:root=true //+kubebuilder:subresource:status +//+kubebuilder:resource:shortName=lxc +//+kubebuilder:printcolumn:name="Node",type="string",JSONPath=".spec.nodeName",description="The name of the target node of Proxmox" +//+kubebuilder:printcolumn:name="ID",type="string",JSONPath=".status.status.id",description="The ID of the container" +//+kubebuilder:printcolumn:name="Cores",type="string",JSONPath=".spec.template.cores",description="The number of CPU cores" +//+kubebuilder:printcolumn:name="Memory",type="string",JSONPath=".spec.template.memory",description="The amount of memory in MB" +//+kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.status.state",description="The state of the VM" +//+kubebuilder:printcolumn:name="Uptime",type="string",JSONPath=".status.status.uptime",description="The uptime of the VM" +//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" // Container is the Schema for the containers API type Container struct { diff --git a/api/proxmox/v1alpha1/managedvirtualmachine_types.go b/api/proxmox/v1alpha1/managedvirtualmachine_types.go index 793e759..5b36f69 100644 --- a/api/proxmox/v1alpha1/managedvirtualmachine_types.go +++ b/api/proxmox/v1alpha1/managedvirtualmachine_types.go @@ -52,6 +52,14 @@ type ManagedVirtualMachineSpec struct { //+kubebuilder:object:root=true //+kubebuilder:subresource:status +//+kubebuilder:resource:shortName="mvm" +//+kubebuilder:printcolumn:name="Node",type="string",JSONPath=".spec.nodeName",description="The node name" +//+kubebuilder:printcolumn:name="ID",type="integer",JSONPath=".status.status.id",description="The ID of the VM" +//+kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.status.state",description="The state of the VM" +//+kubebuilder:printcolumn:name="Uptime",type="string",JSONPath=".status.status.uptime",description="The uptime of the VM" +//+kubebuilder:printcolumn:name="IP Address",type="string",JSONPath=".status.status.IPAddress",description="The IP address of the VM" +//+kubebuilder:printcolumn:name="OS Info",type="string",JSONPath=".status.status.OSInfo",description="The OS information of the VM" +//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" // ManagedVirtualMachine is the Schema for the managedvirtualmachines API type ManagedVirtualMachine struct { diff --git a/api/proxmox/v1alpha1/virtualmachine_types.go b/api/proxmox/v1alpha1/virtualmachine_types.go index 151e7d9..9feea95 100644 --- a/api/proxmox/v1alpha1/virtualmachine_types.go +++ b/api/proxmox/v1alpha1/virtualmachine_types.go @@ -132,6 +132,14 @@ type VirtualMachineStatus struct { //+kubebuilder:object:root=true //+kubebuilder:subresource:status +//+kubebuilder:resource:shortName="vm" +//+kubebuilder:printcolumn:name="Node",type="string",JSONPath=".spec.nodeName",description="The node name" +//+kubebuilder:printcolumn:name="ID",type="integer",JSONPath=".status.status.id",description="The ID of the VM" +//+kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.status.state",description="The state of the VM" +//+kubebuilder:printcolumn:name="Uptime",type="string",JSONPath=".status.status.uptime",description="The uptime of the VM" +//+kubebuilder:printcolumn:name="IP Address",type="string",JSONPath=".status.status.IPAddress",description="The IP address of the VM" +//+kubebuilder:printcolumn:name="OS Info",type="string",JSONPath=".status.status.OSInfo",description="The OS information of the VM" +//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" // VirtualMachine is the Schema for the virtualmachines API type VirtualMachine struct { diff --git a/api/proxmox/v1alpha1/virtualmachineset_types.go b/api/proxmox/v1alpha1/virtualmachineset_types.go index a5b8590..d7cbae8 100644 --- a/api/proxmox/v1alpha1/virtualmachineset_types.go +++ b/api/proxmox/v1alpha1/virtualmachineset_types.go @@ -55,6 +55,13 @@ type VirtualMachineSetStatus struct { //+kubebuilder:object:root=true //+kubebuilder:subresource:status +//+kubebuilder:resource:shortName=vmset +//+kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".spec.replicas",description="The number of VMs" +//+kubebuilder:printcolumn:name="Node",type="string",JSONPath=".spec.nodeName",description="The name of the target node of Proxmox" +//+kubebuilder:printcolumn:name="Cores",type="string",JSONPath=".spec.template.cores",description="The number of CPU cores" +//+kubebuilder:printcolumn:name="Memory",type="string",JSONPath=".spec.template.memory",description="The amount of memory in MB" +//+kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[0].type",description="The status of the VM" +//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" // VirtualMachineSet is the Schema for the virtualmachinesets API type VirtualMachineSet struct { diff --git a/api/proxmox/v1alpha1/zz_generated.deepcopy.go b/api/proxmox/v1alpha1/zz_generated.deepcopy.go index ffcb54d..1ba2018 100644 --- a/api/proxmox/v1alpha1/zz_generated.deepcopy.go +++ b/api/proxmox/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright 2023. diff --git a/charts/kubemox/Chart.yaml b/charts/kubemox/Chart.yaml index bf91962..0cbfeaf 100644 --- a/charts/kubemox/Chart.yaml +++ b/charts/kubemox/Chart.yaml @@ -17,10 +17,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 +version: 0.3.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.2" +appVersion: "0.1.0" diff --git a/charts/kubemox/README.md b/charts/kubemox/README.md new file mode 100644 index 0000000..93362aa --- /dev/null +++ b/charts/kubemox/README.md @@ -0,0 +1,70 @@ +# kubemox + +![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.2](https://img.shields.io/badge/AppVersion-0.2-informational?style=flat-square) + +A Helm chart for Kubernetes + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| Alp Eren Celik | | | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| autoscaling.enabled | bool | `false` | | +| autoscaling.maxReplicas | int | `100` | | +| autoscaling.minReplicas | int | `1` | | +| autoscaling.targetCPUUtilizationPercentage | int | `80` | | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"Always"` | Image pull policy for Kubemox | +| image.repository | string | `"alperencelik/kubemox"` | Kubemox image repository | +| image.tag | string | `"latest"` | Kubemox image tag, see https://github.com/alperencelik/kubemox/releases for the tags | +| imagePullSecrets | list | `[]` | | +| ingress.annotations | object | `{}` | | +| ingress.className | string | `""` | | +| ingress.enabled | bool | `false` | | +| ingress.hosts[0].host | string | `"chart-example.local"` | | +| ingress.hosts[0].paths[0].path | string | `"/"` | | +| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | | +| ingress.tls | list | `[]` | | +| metrics.serviceMonitor.additionalLabels | object | `{}` | Prometheus ServiceMonitor labels | +| metrics.serviceMonitor.annotations | object | `{}` | Prometheus ServiceMonitor annotations | +| metrics.serviceMonitor.enabled | bool | `false` | Prometheus ServiceMonitor enabled | +| metrics.serviceMonitor.interval | string | `"30s"` | Prometheus ServiceMonitor interval | +| metrics.serviceMonitor.metricRelabelings | list | `[]` | Prometheus [MetricRelabelConfigs] to apply to samples before ingestion | +| metrics.serviceMonitor.namespace | string | `""` | Prometheus ServiceMonitor namespace | +| metrics.serviceMonitor.relabelings | list | `[]` | Prometheus [MetricRelabelConfigs] to apply to samples before ingestion | +| metrics.serviceMonitor.scheme | string | `""` | Prometheus ServiceMonitor scheme | +| metrics.serviceMonitor.selector | object | `{}` | Prometheus ServiceMonitor selector | +| metrics.serviceMonitor.tlsConfig | object | `{}` | Prometheus ServiceMonitor tlsConfig | +| nameOverride | string | `""` | | +| nodeSelector | object | `{}` | | +| podAnnotations | object | `{}` | | +| podSecurityContext | object | `{}` | | +| proxmox.endpoint | string | `"10.0.0.99"` | Proxmox VE endpoint | +| proxmox.insecureSkipTLSVerify | bool | `true` | Proxmox VE skip hostname verification for SSL | +| proxmox.password | string | `"PROXMOX_PASSWORD"` | Proxmox VE password | +| proxmox.secret | string | `""` | Proxmox VE token secret | +| proxmox.tokenID | string | `""` | Proxmox VE token ID | +| proxmox.username | string | `"root@pam"` | Proxmox VE username | +| replicaCount | int | `1` | Define how many replicas of the Kubemox to run | +| resources.limits.cpu | string | `"500m"` | | +| resources.limits.memory | string | `"512Mi"` | | +| resources.requests.cpu | string | `"100m"` | | +| resources.requests.memory | string | `"128Mi"` | | +| securityContext | object | `{}` | | +| service.port | int | `8080` | | +| service.portName | string | `"http"` | | +| service.targetPort | int | `8080` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.annotations | object | `{}` | Annotations to add to the service account | +| serviceAccount.create | bool | `true` | Specifies whether a service account should be created | +| serviceAccount.name | string | `""` | If not set and create is true, a name is generated using the fullname template | +| tolerations | list | `[]` | | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1) diff --git a/charts/kubemox/templates/crds/containers.yaml b/charts/kubemox/templates/crds/containers.yaml index 0734749..672914f 100644 --- a/charts/kubemox/templates/crds/containers.yaml +++ b/charts/kubemox/templates/crds/containers.yaml @@ -10,10 +10,40 @@ spec: kind: Container listKind: ContainerList plural: containers + shortNames: + - lxc singular: container scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - description: The name of the target node of Proxmox + jsonPath: .spec.nodeName + name: Node + type: string + - description: The ID of the container + jsonPath: .status.status.id + name: ID + type: string + - description: The number of CPU cores + jsonPath: .spec.template.cores + name: Cores + type: string + - description: The amount of memory in MB + jsonPath: .spec.template.memory + name: Memory + type: string + - description: The state of the VM + jsonPath: .status.status.state + name: State + type: string + - description: The uptime of the VM + jsonPath: .status.status.uptime + name: Uptime + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 schema: openAPIV3Schema: description: Container is the Schema for the containers API @@ -86,19 +116,105 @@ spec: status: description: ContainerStatus defines the observed state of Container properties: - id: - type: integer - name: - type: string - node: - type: string - state: + conditions: description: 'INSERT ADDITIONAL STATUS FIELD - define observed state of cluster Important: Run "make" to regenerate code after modifying this file' - type: string - uptime: - type: string + items: + description: "Condition contains details for one aspect of the current + state of this API Resource. --- This struct is intended for direct + use as an array at the field path .status.conditions. For example, + \n type FooStatus struct{ // Represents the observations of a + foo's current state. // Known .status.conditions.type are: \"Available\", + \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge + // +listType=map // +listMapKey=type Conditions ]metav1.Condition + `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" + protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition + transitioned from one status to another. This should be when + the underlying condition changed. If that is not known, then + using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: message is a human readable message indicating + details about the transition. This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: observedGeneration represents the .metadata.generation + that the condition was set based upon. For instance, if .metadata.generation + is currently 12, but the .status.conditions[x].observedGeneration + is 9, the condition is out of date with respect to the current + state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: reason contains a programmatic identifier indicating + the reason for the condition's last transition. Producers + of specific condition types may define expected values and + meanings for this field, and whether the values are considered + a guaranteed API. The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + --- Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + status: + properties: + IPAddress: + description: IPAddress is the IP address of the VM + type: string + OSInfo: + description: OSInfo is the OS information of the VM + type: string + id: + description: ID is the ID of the VM + type: integer + node: + description: Node is the name of the node + type: string + state: + description: State is the state of the VM + type: string + uptime: + description: Uptime is the uptime of the VM + type: string + required: + - IPAddress + - OSInfo + - id + - node + - state + - uptime + type: object type: object type: object served: true diff --git a/charts/kubemox/templates/crds/virtualmachines.yaml b/charts/kubemox/templates/crds/virtualmachines.yaml index 19c77f2..26a34fb 100644 --- a/charts/kubemox/templates/crds/virtualmachines.yaml +++ b/charts/kubemox/templates/crds/virtualmachines.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.13.0 name: virtualmachines.proxmox.alperen.cloud spec: group: proxmox.alperen.cloud @@ -10,10 +10,40 @@ spec: kind: VirtualMachine listKind: VirtualMachineList plural: virtualmachines + shortNames: + - vm singular: virtualmachine scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - description: The node name + jsonPath: .spec.nodeName + name: Node + type: string + - description: The ID of the VM + jsonPath: .status.status.id + name: ID + type: integer + - description: The state of the VM + jsonPath: .status.status.state + name: State + type: string + - description: The uptime of the VM + jsonPath: .status.status.uptime + name: Uptime + type: string + - description: The IP address of the VM + jsonPath: .status.status.IPAddress + name: IP Address + type: string + - description: The OS information of the VM + jsonPath: .status.status.OSInfo + name: OS Info + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 schema: openAPIV3Schema: description: VirtualMachine is the Schema for the virtualmachines API diff --git a/charts/kubemox/templates/crds/virtualmachinesets.yaml b/charts/kubemox/templates/crds/virtualmachinesets.yaml index 37c84bb..2fe9882 100644 --- a/charts/kubemox/templates/crds/virtualmachinesets.yaml +++ b/charts/kubemox/templates/crds/virtualmachinesets.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.13.0 name: virtualmachinesets.proxmox.alperen.cloud spec: group: proxmox.alperen.cloud @@ -10,10 +10,36 @@ spec: kind: VirtualMachineSet listKind: VirtualMachineSetList plural: virtualmachinesets + shortNames: + - vmset singular: virtualmachineset scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - description: The number of VMs + jsonPath: .spec.replicas + name: Replicas + type: integer + - description: The name of the target node of Proxmox + jsonPath: .spec.nodeName + name: Node + type: string + - description: The number of CPU cores + jsonPath: .spec.template.cores + name: Cores + type: string + - description: The amount of memory in MB + jsonPath: .spec.template.memory + name: Memory + type: string + - description: The status of the VM + jsonPath: .status.conditions[0].type + name: Status + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 schema: openAPIV3Schema: description: VirtualMachineSet is the Schema for the virtualmachinesets API @@ -33,13 +59,28 @@ spec: spec: description: VirtualMachineSetSpec defines the desired state of VirtualMachineSet properties: + deletionProtection: + default: false + description: DeletionProtection is a flag that indicates whether the + VM should be protected from deletion. If true, the VM will not be + deleted when the Kubernetes resource is deleted. If not set, it + defaults to false. + type: boolean + enableAutoStart: + default: true + description: EnableAutoStart is a flag that indicates whether the + VM should automatically start when it's powered off. If true, the + VM will start automatically when it's powered off. If not set, it + defaults to true. + type: boolean nodeName: + description: NodeName is the name of the target node of Proxmox type: string replicas: - description: Foo is an example field of VirtualMachineSet. Edit virtualmachineset_types.go - to remove/update + description: Replicas is the number of VMs type: integer template: + description: Template is the name of the source VM template properties: cores: description: Cores is the number of CPU cores diff --git a/charts/kubemox/values.yaml b/charts/kubemox/values.yaml index 3c653a0..a2972be 100644 --- a/charts/kubemox/values.yaml +++ b/charts/kubemox/values.yaml @@ -1,31 +1,38 @@ # Default values for kubemox. # This is a YAML-formatted file. # Declare variables to be passed into your templates. - +# -- Define how many replicas of the Kubemox to run replicaCount: 1 proxmox: + # -- Proxmox VE endpoint endpoint: "10.0.0.99" - # endpoint: 10.0.0.99 - # insecureSkipTLSVerify: true + # -- Proxmox VE skip hostname verification for SSL insecureSkipTLSVerify: true # Either tokenID/secret or username/password must be set + # -- Proxmox VE token ID tokenID: "" + # -- Proxmox VE token secret secret: "" # Both username and password must be set if tokenID/secret is not set + # -- Proxmox VE username username: "root@pam" + # -- Proxmox VE password password: "PROXMOX_PASSWORD" image: + # -- Kubemox image repository repository: alperencelik/kubemox + # -- Image pull policy for Kubemox pullPolicy: Always - # Overrides the image tag whose default is the chart appVersion. - # See https://github.com/alperencelik/kubemox/releases for the tags + # -- Kubemox image tag, see https://github.com/alperencelik/kubemox/releases for the tags tag: "latest" metrics: serviceMonitor: + # -- Prometheus ServiceMonitor enabled enabled: false + # -- Prometheus ServiceMonitor interval interval: 30s # -- Prometheus [MetricRelabelConfigs] to apply to samples before ingestion relabelings: [] @@ -51,12 +58,12 @@ nameOverride: "" fullnameOverride: "" serviceAccount: - # Specifies whether a service account should be created + # -- Specifies whether a service account should be created create: true - # Annotations to add to the service account + # -- Annotations to add to the service account annotations: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template + # -- The name of the service account to use. + # -- If not set and create is true, a name is generated using the fullname template name: "" podAnnotations: {} @@ -101,16 +108,6 @@ resources: requests: cpu: 100m memory: 128Mi - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi autoscaling: enabled: false diff --git a/config/crd/bases/proxmox.alperen.cloud_containers.yaml b/config/crd/bases/proxmox.alperen.cloud_containers.yaml index c1a53d5..e9f55ec 100644 --- a/config/crd/bases/proxmox.alperen.cloud_containers.yaml +++ b/config/crd/bases/proxmox.alperen.cloud_containers.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.13.0 name: containers.proxmox.alperen.cloud spec: group: proxmox.alperen.cloud @@ -11,10 +11,40 @@ spec: kind: Container listKind: ContainerList plural: containers + shortNames: + - lxc singular: container scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - description: The name of the target node of Proxmox + jsonPath: .spec.nodeName + name: Node + type: string + - description: The ID of the container + jsonPath: .status.status.id + name: ID + type: string + - description: The number of CPU cores + jsonPath: .spec.template.cores + name: Cores + type: string + - description: The amount of memory in MB + jsonPath: .spec.template.memory + name: Memory + type: string + - description: The state of the VM + jsonPath: .status.status.state + name: State + type: string + - description: The uptime of the VM + jsonPath: .status.status.uptime + name: Uptime + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 schema: openAPIV3Schema: description: Container is the Schema for the containers API diff --git a/config/crd/bases/proxmox.alperen.cloud_customcertificates.yaml b/config/crd/bases/proxmox.alperen.cloud_customcertificates.yaml index 3b329c7..ccfae22 100644 --- a/config/crd/bases/proxmox.alperen.cloud_customcertificates.yaml +++ b/config/crd/bases/proxmox.alperen.cloud_customcertificates.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.13.0 name: customcertificates.proxmox.alperen.cloud spec: group: proxmox.alperen.cloud diff --git a/config/crd/bases/proxmox.alperen.cloud_managedvirtualmachines.yaml b/config/crd/bases/proxmox.alperen.cloud_managedvirtualmachines.yaml index 9a2f349..ad2e094 100644 --- a/config/crd/bases/proxmox.alperen.cloud_managedvirtualmachines.yaml +++ b/config/crd/bases/proxmox.alperen.cloud_managedvirtualmachines.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.13.0 name: managedvirtualmachines.proxmox.alperen.cloud spec: group: proxmox.alperen.cloud @@ -11,10 +11,40 @@ spec: kind: ManagedVirtualMachine listKind: ManagedVirtualMachineList plural: managedvirtualmachines + shortNames: + - mvm singular: managedvirtualmachine scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - description: The node name + jsonPath: .spec.nodeName + name: Node + type: string + - description: The ID of the VM + jsonPath: .status.status.id + name: ID + type: integer + - description: The state of the VM + jsonPath: .status.status.state + name: State + type: string + - description: The uptime of the VM + jsonPath: .status.status.uptime + name: Uptime + type: string + - description: The IP address of the VM + jsonPath: .status.status.IPAddress + name: IP Address + type: string + - description: The OS information of the VM + jsonPath: .status.status.OSInfo + name: OS Info + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 schema: openAPIV3Schema: description: ManagedVirtualMachine is the Schema for the managedvirtualmachines diff --git a/config/crd/bases/proxmox.alperen.cloud_storagedownloadurls.yaml b/config/crd/bases/proxmox.alperen.cloud_storagedownloadurls.yaml index c5ba2a4..f1398bf 100644 --- a/config/crd/bases/proxmox.alperen.cloud_storagedownloadurls.yaml +++ b/config/crd/bases/proxmox.alperen.cloud_storagedownloadurls.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.13.0 name: storagedownloadurls.proxmox.alperen.cloud spec: group: proxmox.alperen.cloud diff --git a/config/crd/bases/proxmox.alperen.cloud_virtualmachines.yaml b/config/crd/bases/proxmox.alperen.cloud_virtualmachines.yaml index 45a5257..1b99507 100644 --- a/config/crd/bases/proxmox.alperen.cloud_virtualmachines.yaml +++ b/config/crd/bases/proxmox.alperen.cloud_virtualmachines.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.13.0 name: virtualmachines.proxmox.alperen.cloud spec: group: proxmox.alperen.cloud @@ -11,10 +11,40 @@ spec: kind: VirtualMachine listKind: VirtualMachineList plural: virtualmachines + shortNames: + - vm singular: virtualmachine scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - description: The node name + jsonPath: .spec.nodeName + name: Node + type: string + - description: The ID of the VM + jsonPath: .status.status.id + name: ID + type: integer + - description: The state of the VM + jsonPath: .status.status.state + name: State + type: string + - description: The uptime of the VM + jsonPath: .status.status.uptime + name: Uptime + type: string + - description: The IP address of the VM + jsonPath: .status.status.IPAddress + name: IP Address + type: string + - description: The OS information of the VM + jsonPath: .status.status.OSInfo + name: OS Info + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 schema: openAPIV3Schema: description: VirtualMachine is the Schema for the virtualmachines API diff --git a/config/crd/bases/proxmox.alperen.cloud_virtualmachinesets.yaml b/config/crd/bases/proxmox.alperen.cloud_virtualmachinesets.yaml index 0b1856e..8a0f16e 100644 --- a/config/crd/bases/proxmox.alperen.cloud_virtualmachinesets.yaml +++ b/config/crd/bases/proxmox.alperen.cloud_virtualmachinesets.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.13.0 name: virtualmachinesets.proxmox.alperen.cloud spec: group: proxmox.alperen.cloud @@ -11,10 +11,36 @@ spec: kind: VirtualMachineSet listKind: VirtualMachineSetList plural: virtualmachinesets + shortNames: + - vmset singular: virtualmachineset scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - description: The number of VMs + jsonPath: .spec.replicas + name: Replicas + type: integer + - description: The name of the target node of Proxmox + jsonPath: .spec.nodeName + name: Node + type: string + - description: The number of CPU cores + jsonPath: .spec.template.cores + name: Cores + type: string + - description: The amount of memory in MB + jsonPath: .spec.template.memory + name: Memory + type: string + - description: The status of the VM + jsonPath: .status.conditions[0].type + name: Status + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 schema: openAPIV3Schema: description: VirtualMachineSet is the Schema for the virtualmachinesets API diff --git a/config/crd/bases/proxmox.alperen.cloud_virtualmachinesnapshotpolicies.yaml b/config/crd/bases/proxmox.alperen.cloud_virtualmachinesnapshotpolicies.yaml index abac8d6..6a11b18 100644 --- a/config/crd/bases/proxmox.alperen.cloud_virtualmachinesnapshotpolicies.yaml +++ b/config/crd/bases/proxmox.alperen.cloud_virtualmachinesnapshotpolicies.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.13.0 name: virtualmachinesnapshotpolicies.proxmox.alperen.cloud spec: group: proxmox.alperen.cloud diff --git a/config/crd/bases/proxmox.alperen.cloud_virtualmachinesnapshots.yaml b/config/crd/bases/proxmox.alperen.cloud_virtualmachinesnapshots.yaml index 6d7b4e4..14b927f 100644 --- a/config/crd/bases/proxmox.alperen.cloud_virtualmachinesnapshots.yaml +++ b/config/crd/bases/proxmox.alperen.cloud_virtualmachinesnapshots.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.13.0 name: virtualmachinesnapshots.proxmox.alperen.cloud spec: group: proxmox.alperen.cloud diff --git a/docs/crds/virtualmachineset.md b/docs/crds/virtualmachineset.md index 53af753..3ca3e55 100644 --- a/docs/crds/virtualmachineset.md +++ b/docs/crds/virtualmachineset.md @@ -23,6 +23,10 @@ spec: # Number of VMs to be created replicas: 3 nodeName: lowtower + # Deletion protection is whether to delete VM from Proxmox or not + deleteProtection: false + # VM should be started any time found in stopped state + enableAutostart: true template: # Name of the template to be cloned name: centos-template-new @@ -32,10 +36,6 @@ spec: socket: 1 # Memory to be allocated to the VM memory: 4096 # As MB - # Deletion protection is whether to delete VM from Proxmox or not - deleteProtection: false - # VM should be started any time found in stopped state - enableAutostart: true # Disk used by the VM disk: - storage: nvme diff --git a/examples/virtualmachineset.yaml b/examples/virtualmachineset.yaml index f6f4489..faf1ff8 100644 --- a/examples/virtualmachineset.yaml +++ b/examples/virtualmachineset.yaml @@ -14,6 +14,10 @@ spec: # Number of VMs to be created replicas: 3 nodeName: lowtower + # Deletion protection is whether to delete VM from Proxmox or not + deleteProtection: false + # VM should be started any time found in stopped state + enableAutostart: true template: # Name of the template to be cloned name: fedora-template @@ -23,10 +27,6 @@ spec: socket: 1 # Memory to be allocated to the VM memory: 4096 # As MB - # Deletion protection is whether to delete VM from Proxmox or not - deleteProtection: false - # VM should be started any time found in stopped state - enableAutostart: true # Disk used by the VM disk: - storage: nvme