Skip to content
This repository was archived by the owner on Nov 18, 2020. It is now read-only.

upgrade to use sdk v0.11.0 #82

Merged
merged 1 commit into from
Nov 12, 2019
Merged
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
6 changes: 3 additions & 3 deletions memcached-operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ install: ## Install all resources (CR/CRD's, RBCA and Operator)
@echo ....... Creating namespace .......
- kubectl create namespace ${NAMESPACE}
@echo ....... Applying CRDS and Operator .......
- kubectl apply -f deploy/crds/cache_v1alpha1_memcached_crd.yaml -n ${NAMESPACE}
- kubectl apply -f deploy/crds/cache.example.com_memcacheds_crd.yaml -n ${NAMESPACE}
@echo ....... Applying Rules and Service Account .......
- kubectl apply -f deploy/role.yaml -n ${NAMESPACE}
- kubectl apply -f deploy/role_binding.yaml -n ${NAMESPACE}
- kubectl apply -f deploy/service_account.yaml -n ${NAMESPACE}
@echo ....... Applying Operator .......
- kubectl apply -f deploy/operator.yaml -n ${NAMESPACE}
@echo ....... Creating the Database .......
- kubectl apply -f deploy/crds/cache_v1alpha1_memcached_cr.yaml -n ${NAMESPACE}
- kubectl apply -f deploy/crds/cache.example.com_v1alpha1_memcached_cr.yaml -n ${NAMESPACE}

uninstall: ## Uninstall all that all performed in the $ make install
@echo ....... Uninstalling .......
@echo ....... Deleting CRDs.......
- kubectl delete -f deploy/crds/cache_v1alpha1_memcached_crd.yaml -n ${NAMESPACE}
- kubectl delete -f deploy/crds/cache.example.com_memcacheds_crd.yaml -n ${NAMESPACE}
@echo ....... Deleting Rules and Service Account .......
- kubectl delete -f deploy/role.yaml -n ${NAMESPACE}
- kubectl delete -f deploy/role_binding.yaml -n ${NAMESPACE}
Expand Down
2 changes: 1 addition & 1 deletion memcached-operator/build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.access.redhat.com/ubi7-dev-preview/ubi-minimal:7.6
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest

ENV OPERATOR=/usr/local/bin/memcached-operator \
USER_UID=1001 \
Expand Down
4 changes: 2 additions & 2 deletions memcached-operator/cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/intstr"
"sigs.k8s.io/controller-runtime/pkg/client/config"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/manager"
logf "sigs.k8s.io/controller-runtime/pkg/runtime/log"
"sigs.k8s.io/controller-runtime/pkg/runtime/signals"
"sigs.k8s.io/controller-runtime/pkg/manager/signals"
)

// Change below variables to serve metrics on different host or port.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ spec:
status: {}
validation:
openAPIV3Schema:
description: Memcached is the Schema for the memcacheds API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand All @@ -28,24 +29,28 @@ spec:
metadata:
type: object
spec:
description: MemcachedSpec defines the desired state of Memcached
properties:
size:
description: Quantity of instances
description: Size is the size of the memcached deployment
format: int32
type: integer
required:
- size
type: object
status:
description: MemcachedStatus defines the observed state of Memcached
properties:
nodes:
description: Status of Nodes
description: Nodes are the names of the memcached pods
items:
type: string
type: array
uniqueItems: true
required:
- nodes
type: object
type: object
version: v1alpha1
versions:
- name: v1alpha1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
annotations:
alm-examples: |-
[
{
"apiVersion": "cache.example.com/v1alpha1",
"kind": "Memcached",
"metadata": {
"name": "example-memcached"
},
"spec": {
"size": 3
}
}
]
capabilities: Basic Install
name: memcached-operator.v0.11.0
namespace: placeholder
spec:
apiservicedefinitions: {}
customresourcedefinitions:
owned:
- description: Represents a cluster of Memcached apps
displayName: Memcached App
kind: Memcached
name: memcacheds.cache.example.com
resources:
- kind: Deployment
name: ""
version: v1
- kind: Service
name: ""
version: v1
- kind: ReplicaSet
name: ""
version: v1
- kind: Pod
name: ""
version: v1
specDescriptors:
- description: The desired number of member Pods for the deployment.
displayName: Size
path: size
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:podCount
statusDescriptors:
- description: The current status of the application.
displayName: Status
path: phase
x-descriptors:
- urn:alm:descriptor:io.kubernetes.phase
- description: Explanation for the current status of the application.
displayName: Status Details
path: reason
x-descriptors:
- urn:alm:descriptor:io.kubernetes.phase:reason
version: v1alpha1
description: Main enterprise application providing business critical features with
high availability and no manual intervention.
displayName: Memcached Application
install:
spec:
deployments:
- name: memcached-operator
spec:
replicas: 1
selector:
matchLabels:
name: memcached-operator
strategy: {}
template:
metadata:
labels:
name: memcached-operator
spec:
containers:
- command:
- memcached-operator
env:
- name: WATCH_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.annotations['olm.targetNamespaces']
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: OPERATOR_NAME
value: memcached-operator
image: REPLACE_IMAGE
imagePullPolicy: Always
name: memcached-operator
resources: {}
serviceAccountName: memcached-operator
permissions:
- rules:
- apiGroups:
- ""
resources:
- pods
- services
- services/finalizers
- endpoints
- persistentvolumeclaims
- events
- configmaps
- secrets
verbs:
- '*'
- apiGroups:
- apps
resources:
- deployments
- daemonsets
- replicasets
- statefulsets
verbs:
- '*'
- apiGroups:
- monitoring.coreos.com
resources:
- servicemonitors
verbs:
- get
- create
- apiGroups:
- apps
resourceNames:
- memcached-operator
resources:
- deployments/finalizers
verbs:
- update
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- apiGroups:
- apps
resources:
- replicasets
verbs:
- get
- apiGroups:
- cache.example.com
resources:
- '*'
verbs:
- '*'
serviceAccountName: memcached-operator
strategy: deployment
installModes:
- supported: true
type: OwnNamespace
- supported: true
type: SingleNamespace
- supported: false
type: MultiNamespace
- supported: true
type: AllNamespaces
keywords:
- memcached
- app
maintainers:
- email: [email protected]
name: Some Corp
maturity: alpha
provider:
name: Example
url: www.example.com
replaces: memcached-operator.v0.10.0
version: 0.11.0
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
channels:
- currentCSV: memcached-operator.v0.10.0
- currentCSV: memcached-operator.v0.11.0
name: alpha
defaultChannel: alpha
packageName: memcached-operator
34 changes: 16 additions & 18 deletions memcached-operator/go.mod
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
module github.com/operator-framework/operator-sdk-samples/memcached-operator

require (
github.com/NYTimes/gziphandler v1.0.1 // indirect
github.com/go-openapi/spec v0.19.0
github.com/operator-framework/operator-sdk v0.10.1-0.20190906161029-1cb0481ca946
github.com/spf13/pflag v1.0.3
k8s.io/api v0.0.0-20190612125737-db0771252981
k8s.io/apimachinery v0.0.0-20190612125636-6a5db36e93ad
k8s.io/client-go v11.0.0+incompatible
k8s.io/api v0.0.0-20190918155943-95b840bb6a1f
k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655
k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible
k8s.io/kube-openapi v0.0.0-20190603182131-db7b694dc208
sigs.k8s.io/controller-runtime v0.1.12
sigs.k8s.io/controller-tools v0.1.10 // indirect
sigs.k8s.io/controller-runtime v0.2.2
)

// Pinned to kubernetes-1.13.4
// Pinned to kubernetes-1.14.1
replace (
k8s.io/api => k8s.io/api v0.0.0-20190222213804-5cb15d344471
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.0.0-20190228180357-d002e88f6236
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20190221213512-86fb29eff628
k8s.io/client-go => k8s.io/client-go v0.0.0-20190228174230-b40b2a5939e4
k8s.io/api => k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d
k8s.io/client-go => k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible
k8s.io/cloud-provider => k8s.io/cloud-provider v0.0.0-20190409023720-1bc0c81fa51d
)

replace (
github.com/coreos/prometheus-operator => github.com/coreos/prometheus-operator v0.29.0
// Pinned to v2.9.2 (kubernetes-1.13.1) so https://proxy.golang.org can
github.com/coreos/prometheus-operator => github.com/coreos/prometheus-operator v0.31.1
// Pinned to v2.10.0 (kubernetes-1.14.1) so https://proxy.golang.org can
// resolve it correctly.
github.com/prometheus/prometheus => github.com/prometheus/prometheus v0.0.0-20190424153033-d3245f150225
k8s.io/kube-state-metrics => k8s.io/kube-state-metrics v1.6.0
sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.1.12
sigs.k8s.io/controller-tools => sigs.k8s.io/controller-tools v0.1.11-0.20190411181648-9d55346c2bde
github.com/prometheus/prometheus => github.com/prometheus/prometheus v0.0.0-20190525122359-d20e84d0fb64
)

replace github.com/operator-framework/operator-sdk => github.com/operator-framework/operator-sdk v0.10.0
replace github.com/operator-framework/operator-sdk => github.com/operator-framework/operator-sdk v0.11.0

go 1.12
Loading