Skip to content

Commit

Permalink
Add generic CSI driver operator controller
Browse files Browse the repository at this point in the history
CSIDriverObserver checks Infracstructure CRD for the underlying cloud and
starts corresponding CSIDriverOperatorController(s).

CSIDriverOperatorController installs one CSI driver operator.
  • Loading branch information
jsafrane committed Jul 13, 2020
1 parent d64cbdc commit a0d3515
Show file tree
Hide file tree
Showing 36 changed files with 2,280 additions and 5 deletions.
5 changes: 1 addition & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@ module github.com/openshift/cluster-storage-operator
go 1.13

require (
github.com/evanphx/json-patch v4.5.0+incompatible // indirect
github.com/go-bindata/go-bindata v3.1.2+incompatible
github.com/google/go-cmp v0.4.0
github.com/googleapis/gnostic v0.3.1 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/openshift/api v0.0.0-20200623075207-eb651a5bb0ad
github.com/openshift/aws-ebs-csi-driver-operator v0.0.0-20200608143628-6c961e88931f
github.com/openshift/build-machinery-go v0.0.0-20200424080330-082bf86082cc
github.com/openshift/client-go v0.0.0-20200623090625-83993cebb5ae
github.com/openshift/library-go v0.0.0-20200423084921-517634e0a772
github.com/prometheus/client_golang v1.4.1
github.com/spf13/cobra v0.0.6
github.com/spf13/pflag v1.0.5
google.golang.org/genproto v0.0.0-20191220175831-5c49e3ecc1c1 // indirect
k8s.io/api v0.18.4
k8s.io/apiextensions-apiserver v0.18.2
k8s.io/apimachinery v0.18.4
Expand Down
74 changes: 74 additions & 0 deletions go.sum

Large diffs are not rendered by default.

File renamed without changes.
174 changes: 174 additions & 0 deletions manifests/01_crd_aws_ebs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: awsebsdrivers.csi.openshift.io
spec:
group: csi.openshift.io
names:
kind: AWSEBSDriver
plural: awsebsdrivers
singular: awsebsdriver
preserveUnknownFields: false
scope: Cluster
subresources:
status: {}
version: v1alpha1
versions:
- name: v1alpha1
served: true
storage: true
validation:
openAPIV3Schema:
description:
AWSEBSDriver provides information to configure an operator to
manage the AWS EBS CSI driver.
type: object
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/sig-architecture/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/sig-architecture/api-conventions.md#types-kinds"
type: string
metadata:
type: object
properties:
name:
type: string
# Force "cluster" as CR name.
enum:
- cluster
spec:
description:
AWSEBSDriverSpec is the specification of the desired behavior of
the AWS EBS CSI driver operator.
type: object
properties:
logLevel:
description:
logLevel is an intent based logging for an overall component. It
does not give fine grained control, but it is a simple way to manage
coarse grained logging choices that operators have to interpret for
their operands.
type: string
enum:
- Normal
- Debug
- Trace
- TraceAll
managementState:
description:
managementState indicates whether and how the operator
should manage the component
type: string
pattern: ^(Managed|Unmanaged|Force|Removed)$
observedConfig:
description:
observedConfig holds a sparse config that controller has
observed from the cluster state. It exists in spec because it is
an input to the level for the operator
type: object
nullable: true
x-kubernetes-preserve-unknown-fields: true
operatorLogLevel:
description:
operatorLogLevel is an intent based logging for the operator
itself. It does not give fine grained control, but it is a simple
way to manage coarse grained logging choices that operators have to
interpret for themselves.
type: string
enum:
- Normal
- Debug
- Trace
- TraceAll
unsupportedConfigOverrides:
description:
"unsupportedConfigOverrides holds a sparse config that
will override any previously set options. It only needs to be the
fields to override it will end up overlaying in the following order:
1. hardcoded defaults 2. observedConfig 3. unsupportedConfigOverrides"
type: object
nullable: true
x-kubernetes-preserve-unknown-fields: true
status:
description:
AWSEBSDriverStatus defines the observed status of
the AWS EBS CSI driver operator.
type: object
properties:
conditions:
description: conditions is a list of conditions and their status
type: array
items:
description: OperatorCondition is just the standard condition fields.
type: object
properties:
lastTransitionTime:
type: string
format: date-time
message:
type: string
reason:
type: string
status:
type: string
type:
type: string
generations:
description:
generations are used to determine when an item needs to
be reconciled or has changed in a way that needs a reaction.
type: array
items:
description:
GenerationStatus keeps track of the generation for a
given resource so that decisions about forced updates can be made.
type: object
properties:
group:
description: group is the group of the thing you're tracking
type: string
hash:
description:
hash is an optional field set for resources without
generation that are content sensitive like secrets and configmaps
type: string
lastGeneration:
description:
lastGeneration is the last generation of the workload
controller involved
type: integer
format: int64
name:
description: name is the name of the thing you're tracking
type: string
namespace:
description: namespace is where the thing you're tracking is
type: string
resource:
description:
resource is the resource type of the thing you're
tracking
type: string
observedGeneration:
description:
observedGeneration is the last generation change you've
dealt with
type: integer
format: int64
readyReplicas:
description:
readyReplicas indicates how many replicas are ready and
at the desired state
type: integer
format: int32
version:
description: version is the level this availability applies to
type: string
File renamed without changes.
18 changes: 18 additions & 0 deletions manifests/04-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,24 @@ spec:
env:
- name: OPERATOR_IMAGE_VERSION
value: "0.0.1-snapshot"
- name: OPERAND_IMAGE_VERSION
value: "0.0.1-snapshot"
- name: RELATED_IMAGE_AWS_EBS_DRIVER_OPERATOR
value: quay.io/openshift/origin-aws-ebs-csi-driver-operator:latest
- name: RELATED_IMAGE_AWS_EBS_DRIVER
value: quay.io/openshift/origin-aws-ebs-csi-driver:latest
- name: RELATED_IMAGE_PROVISIONER
value: quay.io/openshift/origin-csi-external-provisioner:latest
- name: RELATED_IMAGE_ATTACHER
value: quay.io/openshift/origin-csi-external-attacher:latest
- name: RELATED_IMAGE_RESIZER
value: quay.io/openshift/origin-csi-external-resizer:latest
- name: RELATED_IMAGE_SNAPSHOTTER
value: quay.io/openshift/origin-csi-external-snapshotter:latest
- name: RELATED_IMAGE_NODE_DRIVER_REGISTRAR
value: quay.io/openshift/origin-csi-node-driver-registrar:latest
- name: RELATED_IMAGE_LIVENESS_PROBE
value: quay.io/openshift/origin-csi-livenessprobe:latest
resources:
requests:
cpu: 10m
Expand Down
2 changes: 2 additions & 0 deletions manifests/05-cluster-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: config.openshift.io/v1
kind: ClusterOperator
metadata:
name: storage
spec:

status:
versions:
- name: operator
Expand Down
32 changes: 32 additions & 0 deletions manifests/image-references
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,35 @@ spec:
from:
kind: DockerImage
name: openshift/origin-cluster-storage-operator:latest
- name: aws-ebs-csi-driver-operator
from:
kind: DockerImage
name: quay.io/openshift/origin-aws-ebs-csi-driver-operator:latest
- name: aws-ebs-csi-driver
from:
kind: DockerImage
name: quay.io/openshift/origin-aws-ebs-csi-driver:latest
- name: csi-external-provisioner
from:
kind: DockerImage
name: quay.io/openshift/origin-csi-external-provisioner:latest
- name: csi-external-attacher
from:
kind: DockerImage
name: quay.io/openshift/origin-csi-external-attacher:latest
- name: csi-external-resizer
from:
kind: DockerImage
name: quay.io/openshift/origin-csi-external-resizer:latest
- name: csi-external-snapshotter
from:
kind: DockerImage
name: quay.io/openshift/origin-csi-external-snapshotter:latest
- name: csi-node-driver-registrar
from:
kind: DockerImage
name: quay.io/openshift/origin-csi-node-driver-registrar:latest
- name: csi-livenessprobe
from:
kind: DockerImage
name: quay.io/openshift/origin-csi-livenessprobe:latest

0 comments on commit a0d3515

Please sign in to comment.