Skip to content

Commit

Permalink
Generated spec for Memgraph HA
Browse files Browse the repository at this point in the history
  • Loading branch information
as51340 committed Jul 24, 2024
1 parent 73a7ba8 commit 3f681f1
Show file tree
Hide file tree
Showing 10 changed files with 858 additions and 217 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest

## Tool Versions
KUSTOMIZE_VERSION ?= v5.2.1
CONTROLLER_TOOLS_VERSION ?= v0.13.0
CONTROLLER_TOOLS_VERSION ?= v0.15.0

.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. If wrong version is installed, it will be removed before downloading.
Expand Down
66 changes: 62 additions & 4 deletions api/v1/memgraphha_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,69 @@ import (

// MemgraphHASpec defines the desired state of MemgraphHA
type MemgraphHASpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
Coordinators []Coordinator `json:"coordinators"`
Data []DataItem `json:"data"`
Memgraph MemgraphConfig `json:"memgraph"`
}

type Coordinator struct {
ID string `json:"id"`
BoltPort int `json:"boltPort"`
ManagementPort int `json:"managementPort"`
CoordinatorPort int `json:"coordinatorPort"`
Args []string `json:"args"`
}

type DataItem struct {
ID string `json:"id"`
BoltPort int `json:"boltPort"`
ManagementPort int `json:"managementPort"`
ReplicationPort int `json:"replicationPort"`
Args []string `json:"args"`
}

type MemgraphConfig struct {
Data MemgraphDataConfig `json:"data"`
Coordinators MemgraphCoordinatorsConfig `json:"coordinators"`
Env map[string]string `json:"env"`
Image ImageConfig `json:"image"`
Probes MemgraphProbesConfig `json:"probes"`
}

type MemgraphDataConfig struct {
VolumeClaim VolumeClaimConfig `json:"volumeClaim"`
}

type MemgraphCoordinatorsConfig struct {
VolumeClaim VolumeClaimConfig `json:"volumeClaim"`
}

type VolumeClaimConfig struct {
StoragePVCClassName string `json:"storagePVCClassName"`
StoragePVC bool `json:"storagePVC"`
StoragePVCSize string `json:"storagePVCSize"`
LogPVCClassName string `json:"logPVCClassName"`
LogPVC bool `json:"logPVC"`
LogPVCSize string `json:"logPVCSize"`
}

type ImageConfig struct {
PullPolicy string `json:"pullPolicy"`
Repository string `json:"repository"`
Tag string `json:"tag"`
}

type MemgraphProbesConfig struct {
Liveness ProbeConfig `json:"liveness"`
Readiness ProbeConfig `json:"readiness"`
Startup ProbeConfig `json:"startup"`
}

// Foo is an example field of MemgraphHA. Edit memgraphha_types.go to remove/update
Foo string `json:"foo,omitempty"`
// ProbeConfig configures individual probes
type ProbeConfig struct {
InitialDelaySeconds int `json:"initialDelaySeconds"`
PeriodSeconds int `json:"periodSeconds"`
FailureThreshold int `json:"failureThreshold,omitempty"`
}

// MemgraphHAStatus defines the observed state of MemgraphHA
Expand Down
290 changes: 290 additions & 0 deletions api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3f681f1

Please sign in to comment.