Skip to content

Commit

Permalink
Add container support
Browse files Browse the repository at this point in the history
  • Loading branch information
alperencelik committed Nov 16, 2023
1 parent 96642f2 commit 8364824
Show file tree
Hide file tree
Showing 8 changed files with 275 additions and 139 deletions.
6 changes: 5 additions & 1 deletion api/proxmox/v1alpha1/container_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ type ContainerTemplateNetwork struct {
type ContainerStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
State string `json:"state,omitempty"`
State string `json:"state,omitempty"`
Node string `json:"node,omitempty"`
Name string `json:"name,omitempty"`
ID int `json:"id,omitempty"`
Uptime string `json:"uptime,omitempty"`
}

//+kubebuilder:object:root=true
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/proxmox.alperen.cloud_containers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,19 @@ spec:
status:
description: ContainerStatus defines the observed state of Container
properties:
id:
type: integer
name:
type: string
node:
type: string
state:
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
type: object
type: object
served: true
Expand Down
24 changes: 24 additions & 0 deletions config/samples/proxmox_v1alpha1_container2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: proxmox.alperen.cloud/v1alpha1
kind: Container
metadata:
labels:
app.kubernetes.io/name: container
app.kubernetes.io/instance: container-new
app.kubernetes.io/part-of: kubemox
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: kubemox
name: container-new
spec:
name: container-new
nodeName: lowtower
template:
name: test-container
cores: 2
memory: 4096 # As MB
disk:
- storage: nvme
size: 50 # As GB
type: scsi
network:
- model: virtio
bridge: vmbr0
31 changes: 15 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ module github.com/alperencelik/kubemox
go 1.21

require (
github.com/alperencelik/go-proxmox v0.0.0-20231024213338-5bdd092e3586
github.com/luthermonson/go-proxmox v0.0.0-beta1.0.20231115161518-f6c641c6c80b
github.com/onsi/ginkgo/v2 v2.9.5
github.com/onsi/gomega v1.27.7
github.com/robfig/cron/v3 v3.0.1
k8s.io/api v0.27.2
k8s.io/apimachinery v0.27.2
k8s.io/client-go v0.27.2
k8s.io/api v0.28.3
k8s.io/apimachinery v0.28.3
k8s.io/client-go v0.28.3
sigs.k8s.io/controller-runtime v0.15.0
)

Expand All @@ -25,23 +25,22 @@ require (
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/zapr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/jinzhu/copier v0.3.4 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/luthermonson/go-proxmox v0.0.0-beta1.0.20231026205231-f451415fef7b // indirect
github.com/magefile/mage v1.14.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
Expand All @@ -57,11 +56,11 @@ require (
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/oauth2 v0.5.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.9.1 // indirect
gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
Expand All @@ -73,9 +72,9 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.27.2 // indirect
k8s.io/component-base v0.27.2 // indirect
k8s.io/klog/v2 v2.90.1 // indirect
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
Expand Down
Loading

0 comments on commit 8364824

Please sign in to comment.