diff --git a/.drone.yml b/.drone.yml index 68c76b0d..cd38c70f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -52,7 +52,7 @@ steps: dockerfile: build/Dockerfile repo: knappek/mongodbatlas-operator tag: - - 0.0.3 + - 0.0.4 when: event: - tag diff --git a/Makefile b/Makefile index 5363f329..0c55e7fb 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ GOFMT_FILES?=$$(find . -name '*.go' | grep -v vendor) GO := GOARCH=amd64 CGO_ENABLED=0 GOOS=linux go VERSION?=latest -OLM_VERSION?=0.0.3 +OLM_VERSION?=0.0.4 API_VERSION?=v1alpha1 KIND= diff --git a/deploy/olm-catalog/mongodbatlas-operator/0.0.4/knappek_v1alpha1_mongodbatlascluster_crd.yaml b/deploy/olm-catalog/mongodbatlas-operator/0.0.4/knappek_v1alpha1_mongodbatlascluster_crd.yaml new file mode 100644 index 00000000..92993d9b --- /dev/null +++ b/deploy/olm-catalog/mongodbatlas-operator/0.0.4/knappek_v1alpha1_mongodbatlascluster_crd.yaml @@ -0,0 +1,211 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: mongodbatlasclusters.knappek.com +spec: + group: knappek.com + names: + kind: MongoDBAtlasCluster + listKind: MongoDBAtlasClusterList + plural: mongodbatlasclusters + singular: mongodbatlascluster + scope: Namespaced + validation: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + autoScaling: + properties: + diskGBEnabled: + type: boolean + required: + - diskGBEnabled + type: object + backupEnabled: + type: boolean + diskSizeGB: + format: double + type: number + mongoDBMajorVersion: + type: string + mongoDBVersion: + type: string + numShards: + format: int64 + type: integer + privateKey: + properties: + valueFrom: + properties: + secretKeyRef: + description: Selects a key of a secret in the CR's namespace + type: object + required: + - secretKeyRef + type: object + required: + - valueFrom + type: object + projectName: + type: string + providerBackupEnabled: + type: boolean + providerSettings: + properties: + backingProviderName: + type: string + diskIOPS: + format: int64 + type: integer + encryptEBSVolume: + type: boolean + instanceSizeName: + type: string + providerName: + type: string + regionName: + type: string + type: object + publicKey: + type: string + replicationFactor: + format: int64 + type: integer + replicationSpec: + additionalProperties: + properties: + analyticsNodes: + format: int64 + type: integer + electableNodes: + format: int64 + type: integer + priority: + format: int64 + type: integer + readOnlyNodes: + format: int64 + type: integer + required: + - priority + - electableNodes + - readOnlyNodes + - analyticsNodes + type: object + type: object + required: + - publicKey + - privateKey + - projectName + - backupEnabled + - providerBackupEnabled + type: object + status: + properties: + autoScaling: + properties: + diskGBEnabled: + type: boolean + required: + - diskGBEnabled + type: object + backupEnabled: + type: boolean + diskSizeGB: + format: double + type: number + groupID: + type: string + id: + description: 'INSERT ADDITIONAL STATUS FIELD - define observed state + of cluster Important: Run "operator-sdk generate k8s" to regenerate + code after modifying this file Add custom validation using kubebuilder + tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html' + type: string + mongoDBMajorVersion: + type: string + mongoDBVersion: + type: string + mongoURI: + type: string + mongoURIUpdated: + type: string + mongoURIWithOptions: + type: string + name: + type: string + numShards: + format: int64 + type: integer + paused: + type: boolean + providerBackupEnabled: + type: boolean + providerSettings: + properties: + backingProviderName: + type: string + diskIOPS: + format: int64 + type: integer + encryptEBSVolume: + type: boolean + instanceSizeName: + type: string + providerName: + type: string + regionName: + type: string + type: object + replicationFactor: + format: int64 + type: integer + replicationSpec: + additionalProperties: + properties: + analyticsNodes: + format: int64 + type: integer + electableNodes: + format: int64 + type: integer + priority: + format: int64 + type: integer + readOnlyNodes: + format: int64 + type: integer + required: + - priority + - electableNodes + - readOnlyNodes + - analyticsNodes + type: object + type: object + srvAddress: + type: string + stateName: + type: string + required: + - backupEnabled + - providerBackupEnabled + - paused + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true diff --git a/deploy/olm-catalog/mongodbatlas-operator/0.0.4/knappek_v1alpha1_mongodbatlasproject_crd.yaml b/deploy/olm-catalog/mongodbatlas-operator/0.0.4/knappek_v1alpha1_mongodbatlasproject_crd.yaml new file mode 100644 index 00000000..efb3edcc --- /dev/null +++ b/deploy/olm-catalog/mongodbatlas-operator/0.0.4/knappek_v1alpha1_mongodbatlasproject_crd.yaml @@ -0,0 +1,81 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: mongodbatlasprojects.knappek.com +spec: + group: knappek.com + names: + kind: MongoDBAtlasProject + listKind: MongoDBAtlasProjectList + plural: mongodbatlasprojects + singular: mongodbatlasproject + scope: Namespaced + subresources: + status: {} + validation: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + orgID: + type: string + privateKey: + properties: + valueFrom: + properties: + secretKeyRef: + description: Selects a key of a secret in the CR's namespace + type: object + required: + - secretKeyRef + type: object + required: + - valueFrom + type: object + publicKey: + type: string + required: + - publicKey + - privateKey + type: object + status: + properties: + clusterCount: + format: int64 + type: integer + created: + type: string + id: + description: 'INSERT ADDITIONAL STATUS FIELD - define observed state + of cluster Important: Run "operator-sdk generate k8s" to regenerate + code after modifying this file Add custom validation using kubebuilder + tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html' + type: string + name: + type: string + orgID: + type: string + required: + - id + - name + - orgID + - created + - clusterCount + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true diff --git a/deploy/olm-catalog/mongodbatlas-operator/0.0.4/mongodbatlas-operator.v0.0.4.clusterserviceversion.yaml b/deploy/olm-catalog/mongodbatlas-operator/0.0.4/mongodbatlas-operator.v0.0.4.clusterserviceversion.yaml new file mode 100644 index 00000000..d898737f --- /dev/null +++ b/deploy/olm-catalog/mongodbatlas-operator/0.0.4/mongodbatlas-operator.v0.0.4.clusterserviceversion.yaml @@ -0,0 +1,119 @@ +apiVersion: operators.coreos.com/v1alpha1 +kind: ClusterServiceVersion +metadata: + annotations: + alm-examples: '[{"apiVersion":"knappek.com/v1alpha1","kind":"MongoDBAtlasCluster","metadata":{"name":"example-mongodbatlascluster"},"spec":{"autoscaling":{"diskGBEnabled":false},"backupEnabled":false,"numShards":1,"orgID":"5c4a2a55553855344780cf5f","privateKey":{"valueFrom":{"secretKeyRef":{"key":"privateKey","name":"example-monogdb-atlas-project"}}},"projectName":"example-project","providerBackupEnabled":false,"providerSettings":{"encryptEBSVolume":false,"instanceSizeName":"M10","providerName":"AWS","regionName":"EU_CENTRAL_1"},"publicKey":"toppaljd"}},{"apiVersion":"knappek.com/v1alpha1","kind":"MongoDBAtlasProject","metadata":{"name":"example-project"},"spec":{"orgID":"5c4a2a55553855344780cf5f","privateKey":{"valueFrom":{"secretKeyRef":{"key":"privateKey","name":"example-monogdb-atlas-project"}}},"publicKey":"toppaljd"}}]' + capabilities: Basic Install + name: mongodbatlas-operator.v0.0.4 + namespace: placeholder +spec: + apiservicedefinitions: {} + customresourcedefinitions: + owned: + - kind: MongoDBAtlasCluster + name: mongodbatlasclusters.knappek.com + version: v1alpha1 + - kind: MongoDBAtlasProject + name: mongodbatlasprojects.knappek.com + version: v1alpha1 + description: Placeholder description + displayName: Mongodbatlas Operator + install: + spec: + deployments: + - name: mongodbatlas-operator + spec: + replicas: 1 + selector: + matchLabels: + name: mongodbatlas-operator + strategy: {} + template: + metadata: + labels: + name: mongodbatlas-operator + spec: + containers: + - command: + - mongodbatlas-operator + env: + - name: WATCH_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: OPERATOR_NAME + value: mongodbatlas-operator + image: knappek/mongodbatlas-operator:0.0.4 + imagePullPolicy: Always + name: mongodbatlas-operator + resources: {} + serviceAccountName: mongodbatlas-operator + permissions: + - rules: + - apiGroups: + - "" + resources: + - pods + - services + - endpoints + - persistentvolumeclaims + - events + - configmaps + - secrets + verbs: + - '*' + - apiGroups: + - "" + resources: + - namespaces + verbs: + - get + - apiGroups: + - apps + resources: + - deployments + - daemonsets + - replicasets + - statefulsets + verbs: + - '*' + - apiGroups: + - monitoring.coreos.com + resources: + - servicemonitors + verbs: + - get + - create + - apiGroups: + - apps + resourceNames: + - mongodbatlas-operator + resources: + - deployments/finalizers + verbs: + - update + - apiGroups: + - knappek.com + resources: + - '*' + - mongodbatlasclusters + verbs: + - '*' + serviceAccountName: mongodbatlas-operator + strategy: deployment + installModes: + - supported: true + type: OwnNamespace + - supported: true + type: SingleNamespace + - supported: false + type: MultiNamespace + - supported: true + type: AllNamespaces + maturity: alpha + provider: {} + version: 0.0.4 diff --git a/deploy/operator.yaml b/deploy/operator.yaml index d6fdee8f..2b6a4bbf 100644 --- a/deploy/operator.yaml +++ b/deploy/operator.yaml @@ -16,7 +16,7 @@ spec: containers: - name: mongodbatlas-operator # Replace this with the built image name - image: knappek/mongodbatlas-operator:0.0.3 + image: knappek/mongodbatlas-operator:0.0.4 command: - mongodbatlas-operator imagePullPolicy: Always