Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
COSI-11: update-kustomize-files-for-COSI-driver
Browse files Browse the repository at this point in the history
- restructured and re-organized kustomize files for COSI driver
- possibility of expandability using overlays in the future
- deleted forked kustomize files from resources directory
  • Loading branch information
anurag4DSB committed Nov 4, 2024
1 parent 57390d1 commit a62e8d9
Show file tree
Hide file tree
Showing 14 changed files with 132 additions and 184 deletions.
59 changes: 1 addition & 58 deletions kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,62 +1,5 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: scality-cosi-driver

commonAnnotations:
cosi.storage.k8s.io/authors: "Kubernetes Authors"
cosi.storage.k8s.io/license: "Apache V2"
cosi.storage.k8s.io/support: "https://github.com/kubernetes-sigs/container-object-storage-api"

commonLabels:
app.kubernetes.io/part-of: container-object-storage-interface
app.kubernetes.io/component: driver-scality
app.kubernetes.io/version: main
app.kubernetes.io/name: cosi-driver-scality

configMapGenerator:
- name: cosi-driver-scality-config
env: resources/cosi-driver-scality.properties
generatorOptions:
disableNameSuffixHash: true
labels:
generated-by: "kustomize"

resources:
- resources/ns.yaml
- resources/sa.yaml
- resources/rbac.yaml
- resources/deployment.yaml

configurations:
- resources/kustomizeconfig.yaml

vars:
- name: IMAGE_ORG
objref:
name: cosi-driver-scality-config
kind: ConfigMap
apiVersion: v1
fieldref:
fieldpath: data.OBJECTSTORAGE_PROVISIONER_IMAGE_ORG
- name: IMAGE_VERSION
objref:
name: cosi-driver-scality-config
kind: ConfigMap
apiVersion: v1
fieldref:
fieldpath: data.OBJECTSTORAGE_PROVISIONER_IMAGE_VERSION
- name: SCALITY_IMAGE_ORG
objref:
name: cosi-driver-scality-config
kind: ConfigMap
apiVersion: v1
fieldref:
fieldpath: data.SCALITY_DRIVER_IMAGE_ORG
- name: SCALITY_IMAGE_VERSION
objref:
name: cosi-driver-scality-config
kind: ConfigMap
apiVersion: v1
fieldref:
fieldpath: data.SCALITY_DRIVER_IMAGE_VERSION
- kustomize/overlays
45 changes: 45 additions & 0 deletions kustomize/base/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: scality-cosi-driver
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: scality-cosi-driver
template:
metadata:
labels:
app.kubernetes.io/name: scality-cosi-driver
app.kubernetes.io/part-of: container-object-storage-interface
app.kubernetes.io/component: driver
app.kubernetes.io/version: main
app.kubernetes.io/managed-by: kustomize
spec:
serviceAccountName: scality-object-storage-provisioner
containers:
- name: scality-cosi-driver
image: ghcr.io/scality/cosi:latest
imagePullPolicy: IfNotPresent
args:
- "--driver-prefix=cosi"
- "--v=$(COSI_DRIVER_LOG_LEVEL)"
volumeMounts:
- mountPath: /var/lib/cosi
name: socket
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: objectstorage-provisioner-sidecar
image: gcr.io/k8s-staging-sig-storage/objectstorage-sidecar:latest
imagePullPolicy: IfNotPresent
args:
- "--v=$(OBJECTSTORAGE_PROVISIONER_SIDECAR_LOG_LEVEL)"
volumeMounts:
- mountPath: /var/lib/cosi
name: socket
volumes:
- name: socket
emptyDir: {}
10 changes: 10 additions & 0 deletions kustomize/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: scality-object-storage

resources:
- namespace.yaml
- serviceaccount.yaml
- rbac.yaml
- deployment.yaml
4 changes: 4 additions & 0 deletions kustomize/base/namespace.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: scality-object-storage
28 changes: 28 additions & 0 deletions kustomize/base/rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: scality-object-storage-provisioner-role
rules:
- apiGroups: ["objectstorage.k8s.io"]
resources: ["buckets", "bucketaccesses", "bucketclaims", "bucketaccessclasses", "buckets/status", "bucketaccesses/status", "bucketclaims/status", "bucketaccessclasses/status"]
verbs: ["get", "list", "watch", "update", "create", "delete"]
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["get", "watch", "list", "delete", "update", "create"]
- apiGroups: [""]
resources: ["secrets", "events"]
verbs: ["get", "delete", "update", "create"]

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: scality-object-storage-provisioner-role-binding
subjects:
- kind: ServiceAccount
name: scality-object-storage-provisioner
namespace: default
roleRef:
kind: ClusterRole
name: scality-object-storage-provisioner-role
apiGroup: rbac.authorization.k8s.io
5 changes: 5 additions & 0 deletions kustomize/base/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: scality-object-storage-provisioner
namespace: default
37 changes: 37 additions & 0 deletions kustomize/overlays/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

configMapGenerator:
- name: scality-cosi-driver-properties
env: scality-cosi-driver.properties
generatorOptions:
disableNameSuffixHash: true
labels:
generated-by: "kustomize"

resources:
- ../base

commonLabels:
app.kubernetes.io/version: main
app.kubernetes.io/component: driver
app.kubernetes.io/name: scality-cosi-driver
app.kubernetes.io/part-of: container-object-storage-interface
app.kubernetes.io/managed-by: kustomize

vars:
- name: COSI_DRIVER_LOG_LEVEL
objref:
name: scality-cosi-driver-properties
kind: ConfigMap
apiVersion: v1
fieldref:
fieldpath: data.COSI_DRIVER_LOG_LEVEL

- name: OBJECTSTORAGE_PROVISIONER_SIDECAR_LOG_LEVEL
objref:
name: scality-cosi-driver-properties
kind: ConfigMap
apiVersion: v1
fieldref:
fieldpath: data.OBJECTSTORAGE_PROVISIONER_SIDECAR_LOG_LEVEL
2 changes: 2 additions & 0 deletions kustomize/overlays/scality-cosi-driver.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
COSI_DRIVER_LOG_LEVEL=5
OBJECTSTORAGE_PROVISIONER_SIDECAR_LOG_LEVEL=5
4 changes: 0 additions & 4 deletions resources/cosi-driver.properties

This file was deleted.

60 changes: 0 additions & 60 deletions resources/deployment.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions resources/kustomizeconfig.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions resources/ns.yaml

This file was deleted.

38 changes: 0 additions & 38 deletions resources/rbac.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions resources/sa.yaml

This file was deleted.

0 comments on commit a62e8d9

Please sign in to comment.