-
Notifications
You must be signed in to change notification settings - Fork 25
modified memcached operator according to run bundle integration #86
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
Merged
laxmikantbpandhare
merged 4 commits into
operator-framework:main
from
laxmikantbpandhare:update-tutorial-mem-ex
Jun 3, 2022
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
26e16e5
modified memcached operator according to run bundle integration and w…
laxmikantbpandhare 55a7365
modified tutorial
laxmikantbpandhare 17e11c5
updated according to review comments
laxmikantbpandhare 946a64c
updated according to review comments
laxmikantbpandhare File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
|
||
VERSION ?= 0.0.1 | ||
IMAGE_TAG_BASE ?= example.com/memcached-quarkus-operator | ||
BUNDLE_IMG ?= $(IMAGE_TAG_BASE)-bundle:v$(VERSION) | ||
|
||
# Image URL to use all building/pushing image targets | ||
IMG ?= controller:latest | ||
|
||
all: docker-build | ||
|
||
##@ General | ||
|
||
# The help target prints out all targets with their descriptions organized | ||
# beneath their categories. The categories are represented by '##@' and the | ||
# target descriptions by '##'. The awk commands is responsible for reading the | ||
# entire set of makefiles included in this invocation, looking for lines of the | ||
# file as xyz: ## something, and then pretty-format the target and help. Then, | ||
# if there's a line with ##@ something, that gets pretty-printed as a category. | ||
# More info on the usage of ANSI control characters for terminal formatting: | ||
# https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters | ||
# More info on the awk command: | ||
# http://linuxcommand.org/lc3_adv_awk.php | ||
|
||
help: ## Display this help. | ||
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) | ||
|
||
##@ Build | ||
|
||
docker-build: ## Build docker image with the manager. | ||
mvn package -Dquarkus.container-image.build=true -Dquarkus.container-image.image=${IMG} | ||
|
||
docker-push: ## Push docker image with the manager. | ||
mvn package -Dquarkus.container-image.push=true -Dquarkus.container-image.image=${IMG} | ||
|
||
##@ Deployment | ||
|
||
install: ## Install CRDs into the K8s cluster specified in ~/.kube/config. | ||
@$(foreach file, $(wildcard target/kubernetes/*-v1.yml), kubectl apply -f $(file);) | ||
|
||
uninstall: ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. | ||
@$(foreach file, $(wildcard target/kubernetes/*-v1.yml), kubectl delete -f $(file);) | ||
|
||
deploy: ## Deploy controller to the K8s cluster specified in ~/.kube/config. | ||
kubectl apply -f target/kubernetes/kubernetes.yml | ||
|
||
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. | ||
kubectl delete -f target/kubernetes/kubernetes.yml | ||
|
||
##@Bundle | ||
.PHONY: bundle | ||
bundle: ## Generate bundle manifests and metadata, then validate generated files. | ||
## marker | ||
cat target/kubernetes/memcacheds.cache.example.com-v1.yml target/kubernetes/kubernetes.yml | operator-sdk generate bundle -q --overwrite --version 0.1.1 --default-channel=stable --channels=stable --package=memcached-quarkus-operator | ||
operator-sdk bundle validate ./bundle | ||
|
||
.PHONY: bundle-build | ||
bundle-build: ## Build the bundle image. | ||
docker build -f bundle.Dockerfile -t $(BUNDLE_IMG) . | ||
|
||
.PHONY: bundle-push | ||
bundle-push: ## Push the bundle image. | ||
docker push $(BUNDLE_IMG) |
16 changes: 16 additions & 0 deletions
16
testdata/quarkus/memcached-quarkus-operator/bundle.Dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM scratch | ||
|
||
# Core bundle labels. | ||
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=memcached-quarkus-operator | ||
LABEL operators.operatorframework.io.bundle.channels.v1=stable | ||
LABEL operators.operatorframework.io.bundle.channel.default.v1=stable | ||
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.21.0+git | ||
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 | ||
LABEL operators.operatorframework.io.metrics.project_layout=quarkus.javaoperatorsdk.io/v1-alpha | ||
|
||
# Copy files to locations specified by labels. | ||
COPY bundle/manifests /manifests/ | ||
COPY bundle/metadata /metadata/ |
40 changes: 40 additions & 0 deletions
40
...ata/quarkus/memcached-quarkus-operator/bundle/manifests/cache.example.com_memcacheds.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
creationTimestamp: null | ||
name: memcacheds.cache.example.com | ||
spec: | ||
group: cache.example.com | ||
names: | ||
kind: Memcached | ||
plural: memcacheds | ||
singular: memcached | ||
scope: Namespaced | ||
versions: | ||
- name: v1 | ||
schema: | ||
openAPIV3Schema: | ||
properties: | ||
spec: | ||
properties: | ||
size: | ||
type: integer | ||
type: object | ||
status: | ||
properties: | ||
nodes: | ||
items: | ||
type: string | ||
type: array | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} | ||
status: | ||
acceptedNames: | ||
kind: "" | ||
plural: "" | ||
conditions: null | ||
storedVersions: null |
12 changes: 12 additions & 0 deletions
12
...ts/memcached-quarkus-operator-operator-view_rbac.authorization.k8s.io_v1_rolebinding.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
creationTimestamp: null | ||
name: memcached-quarkus-operator-operator-view | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: view | ||
subjects: | ||
- kind: ServiceAccount | ||
name: memcached-quarkus-operator-operator |
25 changes: 25 additions & 0 deletions
25
...hed-quarkus-operator/bundle/manifests/memcached-quarkus-operator-operator_v1_service.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
annotations: | ||
app.quarkus.io/build-timestamp: 2022-06-03 - 17:56:59 +0000 | ||
prometheus.io/path: /q/metrics | ||
prometheus.io/port: "8080" | ||
prometheus.io/scheme: http | ||
prometheus.io/scrape: "true" | ||
creationTimestamp: null | ||
labels: | ||
app.kubernetes.io/name: memcached-quarkus-operator-operator | ||
app.kubernetes.io/version: 0.0.1-SNAPSHOT | ||
name: memcached-quarkus-operator-operator | ||
spec: | ||
ports: | ||
- name: http | ||
port: 80 | ||
targetPort: 8080 | ||
selector: | ||
app.kubernetes.io/name: memcached-quarkus-operator-operator | ||
app.kubernetes.io/version: 0.0.1-SNAPSHOT | ||
type: ClusterIP | ||
status: | ||
loadBalancer: {} |
128 changes: 128 additions & 0 deletions
128
...d-quarkus-operator/bundle/manifests/memcached-quarkus-operator.clusterserviceversion.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
apiVersion: operators.coreos.com/v1alpha1 | ||
kind: ClusterServiceVersion | ||
metadata: | ||
annotations: | ||
alm-examples: '[]' | ||
capabilities: Basic Install | ||
operators.operatorframework.io/builder: operator-sdk-v1.21.0+git | ||
operators.operatorframework.io/project_layout: quarkus.javaoperatorsdk.io/v1-alpha | ||
name: memcached-quarkus-operator.v0.1.1 | ||
namespace: placeholder | ||
spec: | ||
apiservicedefinitions: {} | ||
customresourcedefinitions: | ||
owned: | ||
- kind: Memcached | ||
name: memcacheds.cache.example.com | ||
version: v1 | ||
description: Memcached Quarkus Operator description. TODO. | ||
displayName: Memcached Quarkus Operator | ||
icon: | ||
- base64data: "" | ||
mediatype: "" | ||
install: | ||
spec: | ||
clusterPermissions: | ||
- rules: | ||
- apiGroups: | ||
- cache.example.com | ||
resources: | ||
- memcacheds | ||
- memcacheds/status | ||
- memcacheds/finalizers | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- create | ||
- delete | ||
- patch | ||
- update | ||
- apiGroups: | ||
- apiextensions.k8s.io | ||
resources: | ||
- customresourcedefinitions | ||
verbs: | ||
- get | ||
- list | ||
serviceAccountName: memcached-quarkus-operator-operator | ||
deployments: | ||
- label: | ||
app.kubernetes.io/name: memcached-quarkus-operator-operator | ||
app.kubernetes.io/version: 0.0.1-SNAPSHOT | ||
name: memcached-quarkus-operator-operator | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: memcached-quarkus-operator-operator | ||
app.kubernetes.io/version: 0.0.1-SNAPSHOT | ||
strategy: {} | ||
template: | ||
metadata: | ||
annotations: | ||
app.quarkus.io/build-timestamp: 2022-06-03 - 17:56:59 +0000 | ||
prometheus.io/path: /q/metrics | ||
prometheus.io/port: "8080" | ||
prometheus.io/scheme: http | ||
prometheus.io/scrape: "true" | ||
labels: | ||
app.kubernetes.io/name: memcached-quarkus-operator-operator | ||
app.kubernetes.io/version: 0.0.1-SNAPSHOT | ||
spec: | ||
containers: | ||
- env: | ||
- name: KUBERNETES_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
image: quay.io/lpandhar/memcached-quarkus-operator:v0.1.1 | ||
imagePullPolicy: Always | ||
livenessProbe: | ||
failureThreshold: 3 | ||
httpGet: | ||
path: /q/health/live | ||
port: 8080 | ||
scheme: HTTP | ||
periodSeconds: 30 | ||
successThreshold: 1 | ||
timeoutSeconds: 10 | ||
name: memcached-quarkus-operator-operator | ||
ports: | ||
- containerPort: 8080 | ||
name: http | ||
protocol: TCP | ||
readinessProbe: | ||
failureThreshold: 3 | ||
httpGet: | ||
path: /q/health/ready | ||
port: 8080 | ||
scheme: HTTP | ||
periodSeconds: 30 | ||
successThreshold: 1 | ||
timeoutSeconds: 10 | ||
resources: {} | ||
serviceAccountName: memcached-quarkus-operator-operator | ||
strategy: deployment | ||
installModes: | ||
- supported: false | ||
type: OwnNamespace | ||
- supported: false | ||
type: SingleNamespace | ||
- supported: false | ||
type: MultiNamespace | ||
- supported: true | ||
type: AllNamespaces | ||
keywords: | ||
- memcached-quarkus-operator | ||
links: | ||
- name: Memcached Quarkus Operator | ||
url: https://memcached-quarkus-operator.domain | ||
maintainers: | ||
- email: [email protected] | ||
name: Maintainer Name | ||
maturity: alpha | ||
provider: | ||
name: Provider Name | ||
url: https://your.domain | ||
version: 0.1.1 |
11 changes: 11 additions & 0 deletions
11
testdata/quarkus/memcached-quarkus-operator/bundle/metadata/annotations.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
annotations: | ||
# Core bundle annotations. | ||
operators.operatorframework.io.bundle.mediatype.v1: registry+v1 | ||
operators.operatorframework.io.bundle.manifests.v1: manifests/ | ||
operators.operatorframework.io.bundle.metadata.v1: metadata/ | ||
operators.operatorframework.io.bundle.package.v1: memcached-quarkus-operator | ||
operators.operatorframework.io.bundle.channels.v1: stable | ||
operators.operatorframework.io.bundle.channel.default.v1: stable | ||
operators.operatorframework.io.metrics.builder: operator-sdk-v1.21.0+git | ||
operators.operatorframework.io.metrics.mediatype.v1: metrics+v1 | ||
operators.operatorframework.io.metrics.project_layout: quarkus.javaoperatorsdk.io/v1-alpha |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.