Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions api/v1/hbase_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,42 @@ type ServerSpec struct {
Count int32 `json:"count,omitempty"`
}

// HBasePhase is the phase HBase is in from the controller point of view.
type HBasePhase string

const (
// HBaseReadyPhase is operating at the desired spec.
HBaseReadyPhase HBasePhase = "Ready"
// HBaseApplyingChangesPhase controller is working towards a desired state.
HBaseApplyingChangesPhase HBasePhase = "ApplyingChanges"
// HBaseResourceInvalid is marking a resource as invalid, should never happen if admission control is installed correctly.
HBaseResourceInvalidPhase HBasePhase = "Invalid"
)

type HBaseProgress string

const (
HBaseProgressUpdatingService HBaseProgress = "UpdatingService"
HBaseProgressUpdatingCM HBaseProgress = "UpdatingConfigMap"
HBaseProgressUpdatingMasters HBaseProgress = "UpdatingMasters"
HBaseProgressUpdatingRS HBaseProgress = "UpdatingRegionServers"
HBaseProgressWaitingRegionTransition HBaseProgress = "WaitingRegionTransition"
HBaseProgressWaitingMasters HBaseProgress = "WaitingMasterPods"
HBaseProgressWaitingRS HBaseProgress = "WaitingRegionServerPods"
HBaseProgressDelUnusedCM HBaseProgress = "DeletingUnusedConfigMaps"
HBaseProgressReady HBaseProgress = "Ready"
)

// HBaseStatus defines the observed state of HBase
type HBaseStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file

// Phase is a reconciliation phase of hbase
Phase HBasePhase `json:"phase,omitempty"`

// ReconcileProgress is a reconcilation progress of hbase
ReconcileProgress HBaseProgress `json:"reconcileprogress,omitempty"`
}

//+kubebuilder:object:root=true
Expand Down
5 changes: 4 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func main() {
probeAddr string
namespace string
zkQuorum string
zkRoot string
)
flag.StringVar(&metricsAddr, "metrics-addr", ":8080", "The address the metric endpoint binds to.")
flag.StringVar(&pprofAddr, "pprof-addr", ":6060", "The address the pprof endpoint binds to.")
Expand All @@ -67,6 +68,8 @@ func main() {
flag.StringVar(&namespace, "namespace", "hbase", "The namespace to watch for resource definitions.")
flag.StringVar(&zkQuorum, "zkquorum", "localhost:2181",
"Comma-separated list of zookeeper addresses.")
flag.StringVar(&zkRoot, "zkroot", "/hbase",
"Zookeeper root znode for hbase.")

opts := zap.Options{
Development: true,
Expand Down Expand Up @@ -116,7 +119,7 @@ func main() {
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
Log: ctrl.Log.WithName("controllers").WithName("HBase"),
GhAdmin: gohbase.NewAdminClient(zkQuorum),
GhAdmin: gohbase.NewAdminClient(zkQuorum, gohbase.ZookeeperRoot(zkRoot)),
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "HBase")
os.Exit(1)
Expand Down
7 changes: 7 additions & 0 deletions config/crd/bases/hbase.elenskiy.co_hbases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15044,6 +15044,13 @@ spec:
type: object
status:
description: HBaseStatus defines the observed state of HBase
properties:
phase:
description: Phase is a reconciliation phase of hbase
type: string
reconcileprogress:
description: ReconcileProgress is a reconcilation progress of hbase
type: string
type: object
type: object
served: true
Expand Down
43 changes: 22 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
module github.com/timoha/hbase-k8s-operator

go 1.21
go 1.23.0

toolchain go1.23.5

require (
github.com/davecgh/go-spew v1.1.1
github.com/go-logr/logr v1.4.1
github.com/golang/mock v1.6.0
github.com/go-logr/logr v1.4.2
github.com/onsi/ginkgo/v2 v2.14.0
github.com/onsi/gomega v1.30.0
github.com/tsuna/gohbase v0.0.0-20240313220547-1676ef7e233d
github.com/prometheus/client_golang v1.20.5
github.com/tsuna/gohbase v0.0.0-20250311120459-be525bde7d77
go.uber.org/mock v0.5.0
k8s.io/api v0.29.0
k8s.io/apimachinery v0.29.0
k8s.io/client-go v0.29.0
Expand All @@ -18,7 +21,7 @@ require (

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch/v5 v5.8.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
Expand All @@ -28,7 +31,7 @@ require (
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/go-zookeeper/zk v1.0.3 // indirect
github.com/go-zookeeper/zk v1.0.4 // 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
Expand All @@ -41,42 +44,40 @@ require (
github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.18.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.45.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.62.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.opentelemetry.io/otel v1.19.0 // indirect
go.opentelemetry.io/otel/metric v1.19.0 // indirect
go.opentelemetry.io/otel/trace v1.19.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/otel v1.34.0 // indirect
go.opentelemetry.io/otel/metric v1.34.0 // indirect
go.opentelemetry.io/otel/trace v1.34.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/oauth2 v0.12.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/oauth2 v0.24.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/term v0.27.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
golang.org/x/tools v0.22.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.33.0 // indirect
google.golang.org/protobuf v1.36.5 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.29.0 // indirect
k8s.io/component-base v0.29.0 // indirect
k8s.io/klog/v2 v2.110.1 // indirect
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
modernc.org/b/v2 v2.1.0 // indirect
modernc.org/b/v2 v2.1.2 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
Expand Down
Loading