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

Commit

Permalink
Merge pull request #5 from scality/feature/S3C-9228-deploy-COSI-with-…
Browse files Browse the repository at this point in the history
…sidecar

Scality COSI driver deployment with sidecar
  • Loading branch information
anurag4DSB authored Oct 16, 2024
2 parents f9b93bd + 5779c06 commit ada8b89
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 40 deletions.
8 changes: 8 additions & 0 deletions cosi-examples/bucketclaim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
kind: BucketClaim
apiVersion: objectstorage.k8s.io/v1alpha1
metadata:
name: bucket-claim-1
spec:
bucketClassName: bucket-1-name-prefix
protocols:
- s3
9 changes: 9 additions & 0 deletions cosi-examples/bucketclass.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
kind: BucketClass
apiVersion: objectstorage.k8s.io/v1alpha1
metadata:
name: bucket-1-name-prefix # name of the bucket
driverName: cosi.scality.com
deletionPolicy: Delete
parameters:
COSI_OBJECT_STORAGE_PROVIDER_SECRET_NAME: s3-secret-for-cosi
COSI_OBJECT_STORAGE_PROVIDER_SECRET_NAMESPACE: default
11 changes: 11 additions & 0 deletions cosi-examples/s3-secret-for-cosi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Secret
metadata:
name: s3-secret-for-cosi
namespace: default
type: Opaque
stringData:
COSI_S3_ACCESS_KEY_ID: accessKey1 # Plain text access key
COSI_S3_ACCESS_SECRET_KEY: verySecretKey1 # Plain text secret key
COSI_S3_ENDPOINT: http://localhost:8000 # Plain text endpoint
COSI_S3_REGION: us-west-1 # Plain text region
30 changes: 15 additions & 15 deletions kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: sample-cosi-driver
namespace: scality-cosi-driver

commonAnnotations:
cosi.storage.k8s.io/authors: "Kubernetes Authors"
Expand All @@ -10,13 +10,13 @@ commonAnnotations:

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

configMapGenerator:
- name: cosi-driver-sample-config
env: resources/cosi-driver-sample.properties
- name: cosi-driver-scality-config
env: resources/cosi-driver-scality.properties
generatorOptions:
disableNameSuffixHash: true
labels:
Expand All @@ -32,31 +32,31 @@ configurations:
- resources/kustomizeconfig.yaml

vars:
- name: PROVISIONER_IMAGE_ORG
- name: IMAGE_ORG
objref:
name: cosi-driver-config
name: cosi-driver-scality-config
kind: ConfigMap
apiVersion: v1
fieldref:
fieldpath: data.OBJECTSTORAGE_PROVISIONER_IMAGE_ORG
- name: PROVISIONER_IMAGE_VERSION
- name: IMAGE_VERSION
objref:
name: cosi-driver-config
name: cosi-driver-scality-config
kind: ConfigMap
apiVersion: v1
fieldref:
fieldpath: data.OBJECTSTORAGE_PROVISIONER_IMAGE_VERSION
- name: DRIVER_IMAGE_ORG
- name: SCALITY_IMAGE_ORG
objref:
name: cosi-driver-config
name: cosi-driver-scality-config
kind: ConfigMap
apiVersion: v1
fieldref:
fieldpath: data.DRIVER_IMAGE_ORG
- name: DRIVER_IMAGE_VERSION
fieldpath: data.SCALITY_DRIVER_IMAGE_ORG
- name: SCALITY_IMAGE_VERSION
objref:
name: cosi-driver-config
name: cosi-driver-scality-config
kind: ConfigMap
apiVersion: v1
fieldref:
fieldpath: data.DRIVER_IMAGE_VERSION
fieldpath: data.SCALITY_DRIVER_IMAGE_VERSION
4 changes: 2 additions & 2 deletions resources/cosi-driver.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
OBJECTSTORAGE_PROVISIONER_IMAGE_ORG=quay.io/containerobjectstorage
OBJECTSTORAGE_PROVISIONER_IMAGE_VERSION=canary
DRIVER_IMAGE_ORG=ghcr.io/scality/cosi
DRIVER_IMAGE_VERSION=latest
SCALITY_DRIVER_IMAGE_ORG=ghcr.io/scality/cosi
SCALITY_DRIVER_IMAGE_VERSION=latest
29 changes: 17 additions & 12 deletions resources/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ metadata:
name: objectstorage-provisioner
labels:
app.kubernetes.io/part-of: container-object-storage-interface
app.kubernetes.io/component: driver-sample
app.kubernetes.io/component: driver-scality
app.kubernetes.io/version: main
app.kubernetes.io/name: cosi-driver-sample
app.kubernetes.io/name: cosi-driver-scality
spec:
replicas: 1
minReadySeconds: 30
Expand All @@ -20,36 +20,41 @@ spec:
selector:
matchLabels:
app.kubernetes.io/part-of: container-object-storage-interface
app.kubernetes.io/component: driver-sample
app.kubernetes.io/component: driver-scality
app.kubernetes.io/version: main
app.kubernetes.io/name: cosi-driver-sample
app.kubernetes.io/name: cosi-driver-scality
template:
metadata:
labels:
app.kubernetes.io/part-of: container-object-storage-interface
app.kubernetes.io/component: driver-sample
app.kubernetes.io/component: driver-scality
app.kubernetes.io/version: main
app.kubernetes.io/name: cosi-driver-sample
app.kubernetes.io/name: cosi-driver-scality
spec:
serviceAccountName: objectstorage-provisioner-sa
volumes:
- name: socket
emptyDir: {}
containers:
- name: cosi-driver
image: $(DRIVER_IMAGE_ORG)/sample-cosi-driver:$(DRIVER_IMAGE_VERSION)
imagePullPolicy: Always
- name: scality-cosi-driver
image: $(SCALITY_IMAGE_ORG)/scality-cosi-driver:$(SCALITY_IMAGE_VERSION)
imagePullPolicy: IfNotPresent
args:
- "--driver-prefix=cosi"
- "--v=5" # Verbose mode
volumeMounts:
- mountPath: /var/lib/cosi
name: socket
- name: objectstorage-provisioner-sidecar
image: $(PROVISIONER_IMAGE_ORG)/objectstorage-sidecar:$(PROVISIONER_IMAGE_VERSION)
imagePullPolicy: Always
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=5" # Verbose mode
volumeMounts:
- mountPath: /var/lib/cosi
name: socket
6 changes: 3 additions & 3 deletions resources/ns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
apiVersion: v1
kind: Namespace
metadata:
name: sample-cosi-driver
name: scality-cosi-driver
labels:
app.kubernetes.io/part-of: container-object-storage-interface
app.kubernetes.io/component: driver-sample
app.kubernetes.io/component: driver-scality
app.kubernetes.io/version: main
app.kubernetes.io/name: cosi-driver-sample
app.kubernetes.io/name: cosi-driver-scality
12 changes: 6 additions & 6 deletions resources/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ metadata:
name: objectstorage-provisioner-role
labels:
app.kubernetes.io/part-of: container-object-storage-interface
app.kubernetes.io/component: driver-sample
app.kubernetes.io/component: driver-scality
app.kubernetes.io/version: main
app.kubernetes.io/name: cosi-driver-sample
app.kubernetes.io/name: cosi-driver-scality
rules:
- apiGroups: ["objectstorage.k8s.io"]
resources: ["buckets", "bucketaccesses","buckets/status", "bucketaccesses/status"]
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: ["events"]
resources: ["secrets", "events"]
verbs: ["get", "delete", "update", "create"]
---
kind: ClusterRoleBinding
Expand All @@ -25,9 +25,9 @@ metadata:
name: objectstorage-provisioner-role-binding
labels:
app.kubernetes.io/part-of: container-object-storage-interface
app.kubernetes.io/component: driver-sample
app.kubernetes.io/component: driver-scality
app.kubernetes.io/version: main
app.kubernetes.io/name: cosi-driver-sample
app.kubernetes.io/name: cosi-driver-scality
subjects:
- kind: ServiceAccount
name: objectstorage-provisioner-sa
Expand Down
4 changes: 2 additions & 2 deletions resources/sa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ metadata:
namespace: default # must set to default. see https://github.com/kubernetes-sigs/kustomize/issues/1377#issuecomment-694731163
labels:
app.kubernetes.io/part-of: container-object-storage-interface
app.kubernetes.io/component: driver-sample
app.kubernetes.io/component: driver-scality
app.kubernetes.io/version: main
app.kubernetes.io/name: cosi-driver-sample
app.kubernetes.io/name: cosi-driver-scality

0 comments on commit ada8b89

Please sign in to comment.