Skip to content

Commit

Permalink
build: variable for resource names specific to Nutanix
Browse files Browse the repository at this point in the history
  • Loading branch information
dkoshkin authored and tuxtof committed Jan 15, 2025
1 parent fc63dbf commit 80ffe57
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 35 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ NAME READY STATUS RESTARTS AGE
objectstorage-controller-6fc5f89444-4ws72 1/1 Running 0 2d6h
```

#### Install object storage provisioner sidecar with the Nutanix cosi driver
#### Install object storage provisioner sidecar with the Nutanix COSI driver

```sh
$ git clone https://github.com/nutanix-cloud-native/cosi-driver-nutanix
Expand Down Expand Up @@ -72,8 +72,8 @@ After updating the above file, execute these commands:
```sh
$ kubectl apply -k project/.
$ kubectl -n ntnx-system get pods
NAME READY STATUS RESTARTS AGE
objectstorage-provisioner-6c8df56cc6-lqr26 2/2 Running 0 26h
NAME READY STATUS RESTARTS AGE
cosi-driver-nutanix-6cd467d7df-btvpp 2/2 Running 0 3m5s
```

## Quickstart
Expand Down Expand Up @@ -170,21 +170,21 @@ Update the `objectstorage-provisioner` secret that is used by the running provis
Then restart the provisioner pod so that the new secret changes getting mounted on the new pod and will thereon be used.
```
$ kubectl -n ntnx-system get pods
NAME READY STATUS RESTARTS AGE
objectstorage-provisioner-6c8df56cc6-lqr26 2/2 Running 0 26h
NAME READY STATUS RESTARTS AGE
cosi-driver-nutanix-6cd467d7df-btvpp 2/2 Running 0 3m7s
```
```
$ kubectl delete pod objectstorage-provisioner-6c8df56cc6-lqr26 -n ntnx-system
$ kubectl delete pod cosi-driver-nutanix-6cd467d7df-btvpp -n ntnx-system
```
New pod comes up which will be having the updated config
```
$ kubectl -n ntnx-system get pods
NAME READY STATUS RESTARTS AGE
objectstorage-provisioner-5f3we89tt2-tfy357 2/2 Running 0 2s
NAME READY STATUS RESTARTS AGE
cosi-driver-nutanix-6cd467d7df-lkfmc 2/2 Running 0 3s
```
## Building Nutanix cosi driver container image
## Building Nutanix COSI driver container image
Code can be compiled using:
```sh
$ git clone https://github.com/nutanix-cloud-native/cosi-driver-nutanix
Expand Down
19 changes: 10 additions & 9 deletions charts/templates/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
{{ include "cosi-driver-nutanix.resource.annotations" . | indent 4 }}
labels:
{{ include "cosi-driver-nutanix.resource.labels" . | indent 4 }}
name: objectstorage-provisioner
name: {{ include "cosi-driver-nutanix.name" . }}
namespace: {{ .Release.Namespace }}
spec:
minReadySeconds: 30
Expand All @@ -28,32 +28,33 @@ spec:
{{ include "cosi-driver-nutanix.resource.labels" . | indent 8 }}
spec:
containers:
- envFrom:
- secretRef:
name: objectstorage-provisioner
- name: cosi-driver-nutanix
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
name: cosi-driver-nutanix
envFrom:
- secretRef:
name: {{ include "cosi-driver-nutanix.name" . }}
volumeMounts:
- mountPath: /var/lib/cosi
name: socket
- name: objectstorage-provisioner-sidecar
- name: objectstorage-sidecar
image: "{{ .Values.objectstorageProvisionerSidecar.image.registry }}/{{ .Values.objectstorageProvisionerSidecar.image.repository }}:{{ .Values.objectstorageProvisionerSidecar.image.tag }}"
imagePullPolicy: {{ .Values.objectstorageProvisionerSidecar.image.pullPolicy }}
args:
- "--v={{ .Values.objectstorageProvisionerSidecar.logLevel }}"
envFrom:
- secretRef:
name: objectstorage-provisioner
name: {{ include "cosi-driver-nutanix.name" . }}
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
fieldPath:
metadata.namespace
volumeMounts:
- mountPath: /var/lib/cosi
name: socket
serviceAccountName: objectstorage-provisioner-sa
serviceAccountName: {{ include "cosi-driver-nutanix.name" . }}
volumes:
- emptyDir: {}
name: socket
8 changes: 4 additions & 4 deletions charts/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
{{ include "cosi-driver-nutanix.resource.annotations" . | indent 4 }}
labels:
{{ include "cosi-driver-nutanix.resource.labels" . | indent 4 }}
name: objectstorage-provisioner-role
name: {{ include "cosi-driver-nutanix.name" . }}
rules:
- apiGroups: ["objectstorage.k8s.io"]
resources: ["buckets", "bucketaccesses","buckets/status", "bucketaccesses/status", "bucketaccessclasses", "bucketaccessclasses/status", "bucketclaims", "bucketclaims/status"]
Expand All @@ -24,12 +24,12 @@ metadata:
{{ include "cosi-driver-nutanix.resource.annotations" . | indent 4 }}
labels:
{{ include "cosi-driver-nutanix.resource.labels" . | indent 4 }}
name: objectstorage-provisioner-role-binding
name: {{ include "cosi-driver-nutanix.name" . }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: objectstorage-provisioner-role
name: {{ include "cosi-driver-nutanix.name" . }}
subjects:
- kind: ServiceAccount
name: objectstorage-provisioner-sa
name: {{ include "cosi-driver-nutanix.name" . }}
namespace: {{ .Release.Namespace }}
2 changes: 1 addition & 1 deletion charts/templates/sa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ metadata:
{{ include "cosi-driver-nutanix.resource.annotations" . | indent 4 }}
labels:
{{ include "cosi-driver-nutanix.resource.labels" . | indent 4 }}
name: objectstorage-provisioner-sa
name: {{ include "cosi-driver-nutanix.name" . }}
namespace: {{ .Release.Namespace }}
2 changes: 1 addition & 1 deletion charts/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
{{ include "cosi-driver-nutanix.resource.annotations" . | indent 4 }}
labels:
{{ include "cosi-driver-nutanix.resource.labels" . | indent 4 }}
name: objectstorage-provisioner
name: {{ include "cosi-driver-nutanix.name" . }}
namespace: {{ .Release.Namespace }}
stringData:
ACCESS_KEY: {{ required "access_key is required." .Values.secret.access_key | quote }}
Expand Down
10 changes: 5 additions & 5 deletions project/resources/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: objectstorage-provisioner
name: cosi-driver-nutanix
labels:
app.kubernetes.io/part-of: container-object-storage-interface
app.kubernetes.io/component: driver-ntnx
Expand Down Expand Up @@ -31,7 +31,7 @@ spec:
app.kubernetes.io/version: main
app.kubernetes.io/name: cosi-driver-ntnx
spec:
serviceAccountName: objectstorage-provisioner-sa
serviceAccountName: cosi-driver-nutanix
volumes:
- name: socket
emptyDir: {}
Expand All @@ -41,18 +41,18 @@ spec:
imagePullPolicy: IfNotPresent
envFrom:
- secretRef:
name: objectstorage-provisioner
name: cosi-driver-nutanix
volumeMounts:
- mountPath: /var/lib/cosi
name: socket
- name: objectstorage-provisioner-sidecar
- name: objectstorage-sidecar
image: k8s-staging-sig-storage/objectstorage-sidecar/objectstorage-sidecar:v20221117-v0.1.0-22-g0e67387
imagePullPolicy: Always
args:
- "--v=5"
envFrom:
- secretRef:
name: objectstorage-provisioner
name: cosi-driver-nutanix
env:
- name: POD_NAMESPACE
valueFrom:
Expand Down
8 changes: 4 additions & 4 deletions project/resources/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: objectstorage-provisioner-role
name: cosi-driver-nutanix
labels:
app.kubernetes.io/part-of: container-object-storage-interface
app.kubernetes.io/component: driver-ntnx
Expand All @@ -22,17 +22,17 @@ rules:
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: objectstorage-provisioner-role-binding
name: cosi-driver-nutanix
labels:
app.kubernetes.io/part-of: container-object-storage-interface
app.kubernetes.io/component: driver-ntnx
app.kubernetes.io/version: main
app.kubernetes.io/name: cosi-driver-ntnx
subjects:
- kind: ServiceAccount
name: objectstorage-provisioner-sa
name: cosi-driver-nutanix
namespace: default # must set to default. see https://github.com/kubernetes-sigs/kustomize/issues/1377#issuecomment-694731163
roleRef:
kind: ClusterRole
name: objectstorage-provisioner-role
name: cosi-driver-nutanix
apiGroup: rbac.authorization.k8s.io
2 changes: 1 addition & 1 deletion project/resources/sa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: objectstorage-provisioner-sa
name: cosi-driver-nutanix
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
Expand Down
2 changes: 1 addition & 1 deletion project/resources/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: objectstorage-provisioner
name: cosi-driver-nutanix
labels:
app.kubernetes.io/part-of: container-object-storage-interface
app.kubernetes.io/component: driver-ntnx
Expand Down

0 comments on commit 80ffe57

Please sign in to comment.