Skip to content

Commit

Permalink
operator: Rename deployment CRD name to pmemcsideployment
Browse files Browse the repository at this point in the history
Renaming the operator `Deployment` API to `PmemCSIDeployment'. Prefixed
only the `Deployment` type with 'PmemCSI' not its sub-types, because
this is what used by the 'kubebuilder' to determine the generated CRD
Kind is.

FIXES intel#814
  • Loading branch information
avalluri committed Jan 5, 2021
1 parent 88bbc92 commit d0e499c
Show file tree
Hide file tree
Showing 32 changed files with 291 additions and 276 deletions.
18 changes: 9 additions & 9 deletions deploy/bindata_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: pmem-csi.intel.com/v1beta1
kind: Deployment
kind: PmemCSIDeployment
metadata:
name: pmem-csi.intel.com
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.3.0
creationTimestamp: null
name: deployments.pmem-csi.intel.com
name: pmemcsideployments.pmem-csi.intel.com
spec:
group: pmem-csi.intel.com
names:
kind: Deployment
listKind: DeploymentList
plural: deployments
singular: deployment
kind: PmemCSIDeployment
listKind: PmemCSIDeploymentList
plural: pmemcsideployments
shortNames:
- pcd
singular: pmemcsideployment
scope: Cluster
versions:
- additionalPrinterColumns:
Expand All @@ -36,7 +38,7 @@ spec:
name: v1beta1
schema:
openAPIV3Schema:
description: Deployment is the Schema for the deployments API
description: PmemCSIDeployment is the Schema for the deployments API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
cert-manager.io/inject-ca-from: pmem-csi/pmem-csi-operator-selfsigned
controller-gen.kubebuilder.io/version: v0.3.0
creationTimestamp: null
name: deployments.pmem-csi.intel.com
name: pmemcsideployments.pmem-csi.intel.com
spec:
conversion:
strategy: Webhook
Expand All @@ -21,10 +21,12 @@ spec:
- v1beta1
group: pmem-csi.intel.com
names:
kind: Deployment
listKind: DeploymentList
plural: deployments
singular: deployment
kind: PmemCSIDeployment
listKind: PmemCSIDeploymentList
plural: pmemcsideployments
shortNames:
- pcd
singular: pmemcsideployment
scope: Cluster
versions:
- additionalPrinterColumns:
Expand All @@ -46,7 +48,7 @@ spec:
name: v1beta1
schema:
openAPIV3Schema:
description: Deployment is the Schema for the deployments API
description: PmemCSIDeployment is the Schema for the deployments API
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'
Expand Down
4 changes: 2 additions & 2 deletions deploy/kustomize/crd/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Kustomize generated CRD by patching with webhook
# conversion client configuration
resources:
- ../../crd/pmem-csi.intel.com_deployments.yaml # This file is generated by `make operator-generate-crd`
- ../../crd/pmem-csi.intel.com_pmemcsideployments.yaml # This file is generated by `make operator-generate-crd`

patchesJSON6902:
- target:
group: "apiextensions.k8s.io"
version: v1
kind: CustomResourceDefinition
name: deployments.pmem-csi.intel.com
name: pmemcsideployments.pmem-csi.intel.com
path: ../patches/crd-conversion-webhook-patch.yaml

4 changes: 2 additions & 2 deletions deploy/kustomize/olm-catalog/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ bases:
- ../operator

resources:
- ../../common/pmem-csi.intel.com_v1beta1_deployment_cr.yaml
- ../../crd/pmem-csi.intel.com_deployments.yaml
- ../../common/pmem-csi.intel.com_v1beta1_pmemcsideployment_cr.yaml
- ../../crd/pmem-csi.intel.com_pmemcsideployments.yaml

images:
- name: intel/pmem-csi-driver
Expand Down
2 changes: 0 additions & 2 deletions deploy/kustomize/operator-webhook/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ resources:
- webhook-certificate.yaml
- webhook-service.yaml

namespace: pmem-csi

patchesJson6902:
- target:
group: apps
Expand Down
2 changes: 2 additions & 0 deletions deploy/kustomize/operator-webhook/webhook-certificate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: self-signed-issuer
namespace: pmem-csi
spec:
selfSigned: {}
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: pmem-csi-operator-selfsigned # the name used for 'cert-manager.io.inject-ca-from' CRD annotation
namespace: pmem-csi
spec:
dnsNames:
# dnsNames must match be: <webhook-service-name><.namespace>.svc[.domain]
Expand Down
2 changes: 1 addition & 1 deletion deploy/kustomize/operator-webhook/webhook-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: Service
metadata:
name: pmem-csi-operator-service # name referenced in webhook-certificate.yaml for dnsNames
namespace: default
namespace: pmem-csi
spec:
ports:
- port: 9443
Expand Down
6 changes: 3 additions & 3 deletions deploy/kustomize/operator/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ rules:
- apiGroups:
- pmem-csi.intel.com
resources:
- deployments
- deployments/status
- deployments/finalizers
- pmemcsideployments
- pmemcsideployments/status
- pmemcsideployments/finalizers
verbs:
- '*'
---
Expand Down
42 changes: 21 additions & 21 deletions deploy/operator/pmem-csi-operator-webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ metadata:
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: pmem-csi-operator-event
namespace: default
rules:
- apiGroups:
- ""
resources:
- events
verbs:
- '*'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
creationTimestamp: null
name: pmem-csi-operator
Expand Down Expand Up @@ -53,19 +66,6 @@ rules:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: pmem-csi-operator-event
namespace: pmem-csi
rules:
- apiGroups:
- ""
resources:
- events
verbs:
- '*'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: pmem-csi-operator
Expand All @@ -86,21 +86,21 @@ rules:
- apiGroups:
- pmem-csi.intel.com
resources:
- deployments
- deployments/status
- deployments/finalizers
- pmemcsideployments
- pmemcsideployments/status
- pmemcsideployments/finalizers
verbs:
- '*'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: pmem-csi-operator
namespace: pmem-csi
name: pmem-csi-operator-event
namespace: default
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: pmem-csi-operator
name: pmem-csi-operator-event
subjects:
- kind: ServiceAccount
name: pmem-csi-operator
Expand All @@ -109,12 +109,12 @@ subjects:
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: pmem-csi-operator-event
name: pmem-csi-operator
namespace: pmem-csi
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: pmem-csi-operator-event
name: pmem-csi-operator
subjects:
- kind: ServiceAccount
name: pmem-csi-operator
Expand Down
6 changes: 3 additions & 3 deletions deploy/operator/pmem-csi-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ rules:
- apiGroups:
- pmem-csi.intel.com
resources:
- deployments
- deployments/status
- deployments/finalizers
- pmemcsideployments
- pmemcsideployments/status
- pmemcsideployments/finalizers
verbs:
- '*'
---
Expand Down
4 changes: 2 additions & 2 deletions docs/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,8 @@ on a Kubernetes cluster. This operator is based on the CoreOS [operator-sdk](htt
tools and APIs.

The driver deployment is controlled by a cluster-scoped [custom resource](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/)
named [`Deployment`](./install.md#pmem-csi-deployment-crd) in the
named [`PmemCSIDeployment`](./install.md#pmem-csi-deployment-crd) in the
`pmem-csi.intel.com/v1beta1` API group. The operator runs inside the cluster
and listens for deployment changes. It makes sure that the required Kubernetes
objects are created for a driver deployment.
Refer to [Deployment CRD](./install.md#deployment) for details.
Refer to [PmemCSIDeployment CRD](./install.md#pmem-csi-deployment-crd) for details.
Loading

0 comments on commit d0e499c

Please sign in to comment.