Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Operator Name to Ceph S3 Operator #31

Merged
merged 9 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
4 changes: 2 additions & 2 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ jobs:
- name: Chart | Push
uses: appany/[email protected]
with:
name: s3-operator
name: ceph-s3-operator
repository: ${{ github.repository }}/helm-charts
tag: ${{ github.ref_name }}
path: charts/s3-operator # Default charts/{name}
path: charts/ceph-s3-operator # Default charts/{name}
registry: ghcr.io
registry_username: ${{ github.repository_owner }}
registry_password: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ jobs:
curl -L https://github.com/kudobuilder/kuttl/releases/download/v0.15.0/kubectl-kuttl_0.15.0_linux_x86_64 -o /usr/local/bin/kubectl-kuttl
chmod +x /usr/local/bin/kubectl-kuttl
- name: Run e2e test
run: make e2e-test IMG=s3-operator:latest
run: make e2e-test IMG=ceph-s3-operator:latest
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ linters:
- goimports
linters-settings:
goimports:
local-prefixes: github.com/snapp-incubator/s3-operator
local-prefixes: github.com/snapp-incubator/ceph-s3-operator
therealak12 marked this conversation as resolved.
Show resolved Hide resolved
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
# 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
# snappcloud.io/s3-operator-bundle:$VERSION and snappcloud.io/s3-operator-catalog:$VERSION.
IMAGE_TAG_BASE ?= snappcloud.io/s3-operator
# snappcloud.io/ceph-s3-operator-bundle:$VERSION and snappcloud.io/ceph-s3-operator-catalog:$VERSION.
IMAGE_TAG_BASE ?= snappcloud.io/ceph-s3-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 Down Expand Up @@ -118,7 +118,7 @@ e2e-test: docker-build # Run e2e tests
.PHONY: e2e-test-local
e2e-test-local: docker-build # Run e2e tests for local development purposes
kind load docker-image $(IMG)
kubectl delete pod -n s3-operator-system -l control-plane=controller-manager
kubectl delete pod -n ceph-s3-operator-system -l control-plane=controller-manager
hoptical marked this conversation as resolved.
Show resolved Hide resolved
kubectl kuttl test --start-kind=false

##@ Build
Expand Down Expand Up @@ -180,7 +180,7 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified

.PHONY: deploy
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image ghcr.io/snapp-incubator/s3-operator=${IMG}
cd config/manager && $(KUSTOMIZE) edit set image ghcr.io/snapp-incubator/ceph-s3-operator=${IMG}
$(KUSTOMIZE) build config/default | kubectl apply -f -

.PHONY: undeploy
Expand All @@ -189,7 +189,7 @@ undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/confi

.PHONY: deploy-for-e2e-test
deploy-for-e2e-test: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config customized for e2e tests.
cd config/manager && $(KUSTOMIZE) edit set image ghcr.io/snapp-incubator/s3-operator=${IMG}
cd config/manager && $(KUSTOMIZE) edit set image ghcr.io/snapp-incubator/ceph-s3-operator=${IMG}
$(KUSTOMIZE) build config/test | kubectl apply -f -

##@ Build Dependencies
Expand Down Expand Up @@ -232,7 +232,7 @@ $(ENVTEST): $(LOCALBIN)
.PHONY: bundle
bundle: manifests kustomize ## Generate bundle manifests and metadata, then validate generated files.
operator-sdk generate kustomize manifests -q
cd config/manager && $(KUSTOMIZE) edit set image ghcr.io/snapp-incubator/s3-operator=$(IMG)
cd config/manager && $(KUSTOMIZE) edit set image ghcr.io/snapp-incubator/ceph-s3-operator=$(IMG)
$(KUSTOMIZE) build config/manifests | operator-sdk generate bundle $(BUNDLE_GEN_FLAGS)
operator-sdk bundle validate ./bundle

Expand Down Expand Up @@ -324,4 +324,4 @@ $(HELMIFY): $(LOCALBIN)
test -s $(LOCALBIN)/helmify || GOBIN=$(LOCALBIN) go install github.com/arttor/helmify/cmd/[email protected]

helm: manifests kustomize helmify
$(KUSTOMIZE) build config/default | $(HELMIFY) deploy/charts/s3-operator
$(KUSTOMIZE) build config/default | $(HELMIFY) charts/ceph-s3-operator
10 changes: 5 additions & 5 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: s3-operator
repo: github.com/snapp-incubator/s3-operator
projectName: ceph-s3-operator
repo: github.com/snapp-incubator/ceph-s3-operator
resources:
- api:
crdVersion: v1
Expand All @@ -18,7 +18,7 @@ resources:
domain: snappcloud.io
group: s3
kind: S3UserClaim
path: github.com/snapp-incubator/s3-operator/api/v1alpha1
path: github.com/snapp-incubator/ceph-s3-operator/api/v1alpha1
version: v1alpha1
webhooks:
validation: true
Expand All @@ -29,7 +29,7 @@ resources:
domain: snappcloud.io
group: s3
kind: S3User
path: github.com/snapp-incubator/s3-operator/api/v1alpha1
path: github.com/snapp-incubator/ceph-s3-operator/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
Expand All @@ -38,7 +38,7 @@ resources:
domain: snappcloud.io
group: s3
kind: S3Bucket
path: github.com/snapp-incubator/s3-operator/api/v1alpha1
path: github.com/snapp-incubator/ceph-s3-operator/api/v1alpha1
version: v1alpha1
webhooks:
validation: true
Expand Down
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# S3 Operator
# Ceph S3 Operator

![License](https://img.shields.io/github/license/snapp-incubator/s3-operator)
![Test](https://github.com/snapp-incubator/s3-operator/actions/workflows/checks.yaml/badge.svg?branch=main)
![Release](https://github.com/snapp-incubator/s3-operator/actions/workflows/build-release.yaml/badge.svg)
![Tag](https://img.shields.io/github/v/tag/snapp-incubator/s3-operator?&logo=git)
![License](https://img.shields.io/github/license/snapp-incubator/ceph-s3-operator)
![Test](https://github.com/snapp-incubator/ceph-s3-operator/actions/workflows/checks.yaml/badge.svg?branch=main)
![Release](https://github.com/snapp-incubator/ceph-s3-operator/actions/workflows/build-release.yaml/badge.svg)
![Tag](https://img.shields.io/github/v/tag/snapp-incubator/ceph-s3-operator?&logo=git)

## Introduction

The S3 Operator, an open-source endeavor, is crafted to streamline the management of S3 users and buckets within a Ceph cluster environment. It enhances efficiency and simplifies processes, rendering S3 usage on Ceph clusters more straightforward and user-friendly.
The Ceph S3 Operator, an open-source endeavor, is crafted to streamline the management of S3 users and buckets within a Ceph cluster environment. It enhances efficiency and simplifies processes, rendering S3 usage on Ceph clusters more straightforward and user-friendly.

## Features

Expand Down Expand Up @@ -35,7 +35,7 @@ make deploy
Deploy using Helm (version 3.8.0 or later), which supports OCI charts. To use the helm chart, edit the `values.yaml` file and set `controllerManagerConfig.configYaml` to your Ceph cluster configuration like [secret.yaml](config/manager/secret.yaml).

```bash
helm upgrade --install s3-operator oci://ghcr.io/snapp-incubator/s3-operator/helm-charts/s3-operator --version v0.3.5
helm upgrade --install ceph-s3-operator oci://ghcr.io/snapp-incubator/ceph-s3-operator/helm-charts/ceph-s3-operator --version v0.3.5
```

### Using OLM
Expand All @@ -44,19 +44,19 @@ All the operator releases are bundled and pushed to the [Snappcloud hub](https:/

1. Install [snappcloud hub catalog-source](https://github.com/snapp-incubator/snappcloud-hub/blob/main/catalog-source.yml)

2. Override the `s3-operator-controller-manager-config-override` with your operator configuration.
2. Override the `ceph-s3-operator-controller-manager-config-override` with your operator configuration.
3. Apply the subscription manifest as shown below:

```yaml
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: s3-operator
name: ceph-s3-operator
namespace: operators
spec:
channel: stable-v0
installPlanApproval: Automatic
name: s3-operator
name: ceph-s3-operator
source: snappcloud-hub-catalog
sourceNamespace: openshift-marketplace
config:
Expand All @@ -73,16 +73,16 @@ All the operator releases are bundled and pushed to the [Snappcloud hub](https:/
items:
- key: config.yaml
path: config.yaml
secretName: s3-operator-controller-manager-config-override
secretName: ceph-s3-operator-controller-manager-config-override
volumeMounts:
- mountPath: /s3-operator/config/
- mountPath: /ceph-s3-operator/config/
name: config
```

## Usage and Documentation

- CRD Examples: Located in the [samples](config/samples) folder.
- Detailed Documentation: Available on the [wiki](https://github.com/snapp-incubator/s3-operator/wiki).
- Detailed Documentation: Available on the [wiki](https://github.com/snapp-incubator/ceph-s3-operator/wiki).
- Design and Decision Insights: Refer to our [design doc](docs/DESIGN.md) for an in-depth understanding.

## Versioning and Release
Expand Down Expand Up @@ -114,7 +114,7 @@ the chart run:
make helm
```

The chart will be created/updated in `charts/s3-operator` path
The chart will be created/updated in `charts/ceph-s3-operator` path

### Run locally

Expand Down Expand Up @@ -159,4 +159,4 @@ Contributions are warmly welcomed. Feel free to submit issues or pull requests.

## License

This project is licensed under the [Apache License 2.0](https://github.com/snapp-incubator/s3-operator/blob/main/LICENSE).
This project is licensed under the [Apache License 2.0](https://github.com/snapp-incubator/ceph-s3-operator/blob/main/LICENSE).
2 changes: 1 addition & 1 deletion api/v1alpha1/quota_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/snapp-incubator/s3-operator/pkg/consts"
"github.com/snapp-incubator/ceph-s3-operator/pkg/consts"
)

func CalculateNamespaceUsedQuota(ctx context.Context, uncachedReader client.Reader,
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/s3bucket_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/webhook"

"github.com/snapp-incubator/s3-operator/pkg/consts"
"github.com/snapp-incubator/ceph-s3-operator/pkg/consts"
)

// log is for logging in this package.
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/s3userclaim_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/webhook"

"github.com/snapp-incubator/s3-operator/pkg/consts"
"github.com/snapp-incubator/ceph-s3-operator/pkg/consts"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/s3userclaim_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/snapp-incubator/s3-operator/pkg/consts"
"github.com/snapp-incubator/ceph-s3-operator/pkg/consts"
)

var _ = Describe("", Ordered, ContinueOnFailure, func() {
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/webhook_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

"github.com/snapp-incubator/s3-operator/internal/config"
"github.com/snapp-incubator/ceph-s3-operator/internal/config"
)

// These tests use Ginkgo (BDD-style Go testing framework). Refer to
Expand Down
2 changes: 1 addition & 1 deletion bundle.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM scratch
LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=s3-operator
LABEL operators.operatorframework.io.bundle.package.v1=ceph-s3-operator
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.31.0
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
name: s3-operator
name: ceph-s3-operator
description: A Helm chart for Kubernetes
# A chart can be either an 'application' or a 'library' chart.
#
Expand All @@ -13,9 +13,9 @@ 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.3.0
version: 0.1.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: "v0.3.4"
appVersion: "0.1.0"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "s3-operator.name" -}}
{{- define "ceph-s3-operator.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

Expand All @@ -10,7 +10,7 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "s3-operator.fullname" -}}
{{- define "ceph-s3-operator.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
Expand All @@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name.
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "s3-operator.chart" -}}
{{- define "ceph-s3-operator.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "s3-operator.labels" -}}
helm.sh/chart: {{ include "s3-operator.chart" . }}
{{ include "s3-operator.selectorLabels" . }}
{{- define "ceph-s3-operator.labels" -}}
helm.sh/chart: {{ include "ceph-s3-operator.chart" . }}
{{ include "ceph-s3-operator.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
Expand All @@ -45,17 +45,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Selector labels
*/}}
{{- define "s3-operator.selectorLabels" -}}
app.kubernetes.io/name: {{ include "s3-operator.name" . }}
{{- define "ceph-s3-operator.selectorLabels" -}}
app.kubernetes.io/name: {{ include "ceph-s3-operator.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "s3-operator.serviceAccountName" -}}
{{- define "ceph-s3-operator.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "s3-operator.fullname" .) .Values.serviceAccount.name }}
{{- default (include "ceph-s3-operator.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "ceph-s3-operator.fullname" . }}-clusterresourcequota-updater-binding
labels:
{{- include "ceph-s3-operator.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: '{{ include "ceph-s3-operator.fullname" . }}-clusterresourcequota-updater'
subjects:
- kind: ServiceAccount
name: '{{ include "ceph-s3-operator.fullname" . }}-controller-manager'
namespace: '{{ .Release.Namespace }}'
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "s3-operator.fullname" . }}-clusterresourcequota-updater
name: {{ include "ceph-s3-operator.fullname" . }}-clusterresourcequota-updater
labels:
{{- include "s3-operator.labels" . | nindent 4 }}
{{- include "ceph-s3-operator.labels" . | nindent 4 }}
rules:
- apiGroups:
- quota.openshift.io
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ include "s3-operator.fullname" . }}-controller-manager-config
name: {{ include "ceph-s3-operator.fullname" . }}-controller-manager-config
labels:
{{- include "s3-operator.labels" . | nindent 4 }}
{{- include "ceph-s3-operator.labels" . | nindent 4 }}
stringData:
config.yaml: {{ required "controllerManagerConfig.configYaml is required" .Values.controllerManagerConfig.configYaml
| quote }}
Loading