Skip to content

Commit

Permalink
Merge pull request #5 from bococ/develop
Browse files Browse the repository at this point in the history
fix: change metadata to metastore
  • Loading branch information
whg517 authored Oct 26, 2023
2 parents 0d339a0 + 84745d7 commit ba38a08
Show file tree
Hide file tree
Showing 25 changed files with 63 additions and 50 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ RETISTRY ?= quay.io/zncdata
# This variable is used to construct full image tags for bundle and catalog images.
#
# For example, running 'make bundle-build bundle-push catalog-build catalog-push' will build and push both
# zncdata.net/hive-metadata-operator-bundle:$VERSION and zncdata.net/hive-metadata-operator-catalog:$VERSION.
IMAGE_TAG_BASE ?= $(RETISTRY)/hive-metadata-operator
# zncdata.net/hive-metastore-operator-bundle:$VERSION and zncdata.net/hive-metastore-operator-catalog:$VERSION.
IMAGE_TAG_BASE ?= $(RETISTRY)/hive-metastore-operator

# BUNDLE_IMG defines the image:tag used for the bundle.
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>)
Expand All @@ -53,7 +53,7 @@ endif
OPERATOR_SDK_VERSION ?= v1.31.0

# Image URL to use all building/pushing image targets
IMG ?= $(RETISTRY)/hive-metadata-operator:$(VERSION)
IMG ?= $(RETISTRY)/hive-metastore-operator:$(VERSION)
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.26.0

Expand Down
6 changes: 3 additions & 3 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ layout:
plugins:
manifests.sdk.operatorframework.io/v2: {}
scorecard.sdk.operatorframework.io/v2: {}
projectName: hive-metadata-operator
repo: github.com/zncdata-labs/hive-metadata-operator
projectName: hive-metastore-operator
repo: github.com/zncdata-labs/hive-metastore-operator
resources:
- api:
crdVersion: v1
Expand All @@ -18,6 +18,6 @@ resources:
domain: zncdata.net
group: stack
kind: HiveMetastore
path: github.com/zncdata-labs/hive-metadata-operator/api/v1alpha1
path: github.com/zncdata-labs/hive-metastore-operator/api/v1alpha1
version: v1alpha1
version: "3"
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
# hive-metadata-operator
# hive-metastore-operator

// TODO(user): Add simple overview of use/purpose

## Description

// TODO(user): An in-depth paragraph about your project and overview of use

## Getting Started

You’ll need a Kubernetes cluster to run against. You can use [KIND](https://sigs.k8s.io/kind) to get a local cluster for testing, or run against a remote cluster.
**Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows).

### Running on the cluster
<!-- markdownlint-disable -->
1. Install Instances of Custom Resources:

```sh
Expand All @@ -18,39 +22,46 @@ kubectl apply -f config/samples/
2. Build and push your image to the location specified by `IMG`:

```sh
make docker-build docker-push IMG=<some-registry>/hive-metadata-operator:tag
make docker-build docker-push IMG=<some-registry>/hive-metastore-operator:tag
```

3. Deploy the controller to the cluster with the image specified by `IMG`:

```sh
make deploy IMG=<some-registry>/hive-metadata-operator:tag
make deploy IMG=<some-registry>/hive-metastore-operator:tag
```
<!-- markdownlint-restore -->

### Uninstall CRDs

To delete the CRDs from the cluster:

```sh
make uninstall
```

### Undeploy controller

UnDeploy the controller from the cluster:

```sh
make undeploy
```

## Contributing

// TODO(user): Add detailed information on how you would like others to contribute to this project

### How it works

This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/).

It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/),
which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.

### Test It Out
<!-- markdownlint-disable -->

1. Install the CRDs into the cluster:

```sh
Expand All @@ -62,10 +73,12 @@ make install
```sh
make run
```
<!-- markdownlint-restore -->

**NOTE:** You can also run this in one step by running: `make install run`

### Modifying the API definitions

If you are editing the API definitions, generate the manifests such as CRs or CRDs using:

```sh
Expand Down
4 changes: 2 additions & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import (
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

stackv1alpha1 "github.com/zncdata-labs/hive-metadata-operator/api/v1alpha1"
"github.com/zncdata-labs/hive-metadata-operator/internal/controller"
stackv1alpha1 "github.com/zncdata-labs/hive-metastore-operator/api/v1alpha1"
"github.com/zncdata-labs/hive-metastore-operator/internal/controller"
//+kubebuilder:scaffold:imports
)

Expand Down
4 changes: 2 additions & 2 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Adds namespace to all resources.
namespace: hive-metadata-operator-system
namespace: hive-metastore-operator-system

# Value of this field is prepended to the
# names of all resources, e.g. a deployment named
# "wordpress" becomes "alices-wordpress".
# Note that it should also match with the prefix (text before '-') of the namespace
# field above.
namePrefix: hive-metadata-operator-
namePrefix: hive-metastore-operator-

# Labels to add to all resources and selectors.
#labels:
Expand Down
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: quay.io/zncdata/hive-metadata-operator
newName: quay.io/zncdata/hive-metastore-operator
newTag: 0.0.1-alpha
8 changes: 4 additions & 4 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
app.kubernetes.io/name: namespace
app.kubernetes.io/instance: system
app.kubernetes.io/component: manager
app.kubernetes.io/created-by: hive-metadata-operator
app.kubernetes.io/part-of: hive-metadata-operator
app.kubernetes.io/created-by: hive-metastore-operator
app.kubernetes.io/part-of: hive-metastore-operator
app.kubernetes.io/managed-by: kustomize
name: system
---
Expand All @@ -21,8 +21,8 @@ metadata:
app.kubernetes.io/name: deployment
app.kubernetes.io/instance: controller-manager
app.kubernetes.io/component: manager
app.kubernetes.io/created-by: hive-metadata-operator
app.kubernetes.io/part-of: hive-metadata-operator
app.kubernetes.io/created-by: hive-metastore-operator
app.kubernetes.io/part-of: hive-metastore-operator
app.kubernetes.io/managed-by: kustomize
spec:
selector:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
annotations:
alm-examples: '[]'
capabilities: Basic Install
name: hive-metadata-operator.v0.0.0
name: hive-metastore-operator.v0.0.0
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -37,8 +37,8 @@ spec:
- hive
- metastore
links:
- name: Hive Metadata Operator
url: https://hive-metadata-operator.domain
- name: Hive Metastore Operator
url: https://hive-metastore-operator.domain
maturity: alpha
provider:
name: zncdata-labs
Expand Down
2 changes: 1 addition & 1 deletion config/manifests/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# These resources constitute the fully configured set of manifests
# used to generate the 'manifests/' directory in a bundle.
resources:
- bases/hive-metadata-operator.clusterserviceversion.yaml
- bases/hive-metastore-operator.clusterserviceversion.yaml
- ../default
- ../samples
- ../scorecard
Expand Down
4 changes: 2 additions & 2 deletions config/prometheus/monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ metadata:
app.kubernetes.io/name: servicemonitor
app.kubernetes.io/instance: controller-manager-metrics-monitor
app.kubernetes.io/component: metrics
app.kubernetes.io/created-by: hive-metadata-operator
app.kubernetes.io/part-of: hive-metadata-operator
app.kubernetes.io/created-by: hive-metastore-operator
app.kubernetes.io/part-of: hive-metastore-operator
app.kubernetes.io/managed-by: kustomize
name: controller-manager-metrics-monitor
namespace: system
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/auth_proxy_client_clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: clusterrole
app.kubernetes.io/instance: metrics-reader
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: hive-metadata-operator
app.kubernetes.io/part-of: hive-metadata-operator
app.kubernetes.io/created-by: hive-metastore-operator
app.kubernetes.io/part-of: hive-metastore-operator
app.kubernetes.io/managed-by: kustomize
name: metrics-reader
rules:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/auth_proxy_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: clusterrole
app.kubernetes.io/instance: proxy-role
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: hive-metadata-operator
app.kubernetes.io/part-of: hive-metadata-operator
app.kubernetes.io/created-by: hive-metastore-operator
app.kubernetes.io/part-of: hive-metastore-operator
app.kubernetes.io/managed-by: kustomize
name: proxy-role
rules:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/auth_proxy_role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: clusterrolebinding
app.kubernetes.io/instance: proxy-rolebinding
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: hive-metadata-operator
app.kubernetes.io/part-of: hive-metadata-operator
app.kubernetes.io/created-by: hive-metastore-operator
app.kubernetes.io/part-of: hive-metastore-operator
app.kubernetes.io/managed-by: kustomize
name: proxy-rolebinding
roleRef:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/auth_proxy_service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
app.kubernetes.io/name: service
app.kubernetes.io/instance: controller-manager-metrics-service
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: hive-metadata-operator
app.kubernetes.io/part-of: hive-metadata-operator
app.kubernetes.io/created-by: hive-metastore-operator
app.kubernetes.io/part-of: hive-metastore-operator
app.kubernetes.io/managed-by: kustomize
name: controller-manager-metrics-service
namespace: system
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/hivemetastore_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
app.kubernetes.io/name: clusterrole
app.kubernetes.io/instance: hivemetastore-editor-role
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: hive-metadata-operator
app.kubernetes.io/part-of: hive-metadata-operator
app.kubernetes.io/created-by: hive-metastore-operator
app.kubernetes.io/part-of: hive-metastore-operator
app.kubernetes.io/managed-by: kustomize
name: hivemetastore-editor-role
rules:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/hivemetastore_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
app.kubernetes.io/name: clusterrole
app.kubernetes.io/instance: hivemetastore-viewer-role
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: hive-metadata-operator
app.kubernetes.io/part-of: hive-metadata-operator
app.kubernetes.io/created-by: hive-metastore-operator
app.kubernetes.io/part-of: hive-metastore-operator
app.kubernetes.io/managed-by: kustomize
name: hivemetastore-viewer-role
rules:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/leader_election_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
app.kubernetes.io/name: role
app.kubernetes.io/instance: leader-election-role
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: hive-metadata-operator
app.kubernetes.io/part-of: hive-metadata-operator
app.kubernetes.io/created-by: hive-metastore-operator
app.kubernetes.io/part-of: hive-metastore-operator
app.kubernetes.io/managed-by: kustomize
name: leader-election-role
rules:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/leader_election_role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: rolebinding
app.kubernetes.io/instance: leader-election-rolebinding
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: hive-metadata-operator
app.kubernetes.io/part-of: hive-metadata-operator
app.kubernetes.io/created-by: hive-metastore-operator
app.kubernetes.io/part-of: hive-metastore-operator
app.kubernetes.io/managed-by: kustomize
name: leader-election-rolebinding
roleRef:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: clusterrolebinding
app.kubernetes.io/instance: manager-rolebinding
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: hive-metadata-operator
app.kubernetes.io/part-of: hive-metadata-operator
app.kubernetes.io/created-by: hive-metastore-operator
app.kubernetes.io/part-of: hive-metastore-operator
app.kubernetes.io/managed-by: kustomize
name: manager-rolebinding
roleRef:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/service_account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: serviceaccount
app.kubernetes.io/instance: controller-manager-sa
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: hive-metadata-operator
app.kubernetes.io/part-of: hive-metadata-operator
app.kubernetes.io/created-by: hive-metastore-operator
app.kubernetes.io/part-of: hive-metastore-operator
app.kubernetes.io/managed-by: kustomize
name: controller-manager
namespace: system
4 changes: 2 additions & 2 deletions config/samples/stack_v1alpha1_hivemetastore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ metadata:
labels:
app.kubernetes.io/name: hivemetastore
app.kubernetes.io/instance: hivemetastore-sample
app.kubernetes.io/part-of: hive-metadata-operator
app.kubernetes.io/part-of: hive-metastore-operator
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: hive-metadata-operator
app.kubernetes.io/created-by: hive-metastore-operator
name: hivemetastore-sample
spec:
replicas: 1
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/zncdata-labs/hive-metadata-operator
module github.com/zncdata-labs/hive-metastore-operator

go 1.20

Expand Down
2 changes: 1 addition & 1 deletion internal/controller/handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/log"

stackv1alpha1 "github.com/zncdata-labs/hive-metadata-operator/api/v1alpha1"
stackv1alpha1 "github.com/zncdata-labs/hive-metastore-operator/api/v1alpha1"
)

// make service
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/hivemetastore_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/log"

stackv1alpha1 "github.com/zncdata-labs/hive-metadata-operator/api/v1alpha1"
stackv1alpha1 "github.com/zncdata-labs/hive-metastore-operator/api/v1alpha1"
)

// HiveMetastoreReconciler reconciles a HiveMetastore object
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

stackv1alpha1 "github.com/zncdata-labs/hive-metadata-operator/api/v1alpha1"
stackv1alpha1 "github.com/zncdata-labs/hive-metastore-operator/api/v1alpha1"
//+kubebuilder:scaffold:imports
)

Expand Down

0 comments on commit ba38a08

Please sign in to comment.