Skip to content

Commit e1a806e

Browse files
dkoshkintuxtof
authored andcommitted
build: variable for resource names specific to Nutanix
1 parent 4187366 commit e1a806e

File tree

9 files changed

+36
-35
lines changed

9 files changed

+36
-35
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ NAME READY STATUS RESTARTS AGE
3030
objectstorage-controller-6fc5f89444-4ws72 1/1 Running 0 2d6h
3131
```
3232

33-
#### Install object storage provisioner sidecar with the Nutanix cosi driver
33+
#### Install object storage provisioner sidecar with the Nutanix COSI driver
3434

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

7979
## Quickstart
@@ -170,21 +170,21 @@ Update the `objectstorage-provisioner` secret that is used by the running provis
170170
Then restart the provisioner pod so that the new secret changes getting mounted on the new pod and will thereon be used.
171171
```
172172
$ kubectl -n ntnx-system get pods
173-
NAME READY STATUS RESTARTS AGE
174-
objectstorage-provisioner-6c8df56cc6-lqr26 2/2 Running 0 26h
173+
NAME READY STATUS RESTARTS AGE
174+
cosi-driver-nutanix-6cd467d7df-btvpp 2/2 Running 0 3m7s
175175
```
176176
177177
```
178-
$ kubectl delete pod objectstorage-provisioner-6c8df56cc6-lqr26 -n ntnx-system
178+
$ kubectl delete pod cosi-driver-nutanix-6cd467d7df-btvpp -n ntnx-system
179179
```
180180
New pod comes up which will be having the updated config
181181
```
182182
$ kubectl -n ntnx-system get pods
183-
NAME READY STATUS RESTARTS AGE
184-
objectstorage-provisioner-5f3we89tt2-tfy357 2/2 Running 0 2s
183+
NAME READY STATUS RESTARTS AGE
184+
cosi-driver-nutanix-6cd467d7df-lkfmc 2/2 Running 0 3s
185185
```
186186
187-
## Building Nutanix cosi driver container image
187+
## Building Nutanix COSI driver container image
188188
Code can be compiled using:
189189
```sh
190190
$ git clone https://github.com/nutanix-cloud-native/cosi-driver-nutanix

charts/templates/deploy.yaml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
{{ include "cosi-driver-nutanix.resource.annotations" . | indent 4 }}
66
labels:
77
{{ include "cosi-driver-nutanix.resource.labels" . | indent 4 }}
8-
name: objectstorage-provisioner
8+
name: {{ include "cosi-driver-nutanix.name" . }}
99
namespace: {{ .Release.Namespace }}
1010
spec:
1111
minReadySeconds: 30
@@ -28,32 +28,33 @@ spec:
2828
{{ include "cosi-driver-nutanix.resource.labels" . | indent 8 }}
2929
spec:
3030
containers:
31-
- envFrom:
32-
- secretRef:
33-
name: objectstorage-provisioner
31+
- name: cosi-driver-nutanix
3432
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
3533
imagePullPolicy: {{ .Values.image.pullPolicy }}
36-
name: cosi-driver-nutanix
34+
envFrom:
35+
- secretRef:
36+
name: {{ include "cosi-driver-nutanix.name" . }}
3737
volumeMounts:
3838
- mountPath: /var/lib/cosi
3939
name: socket
40-
- name: objectstorage-provisioner-sidecar
40+
- name: objectstorage-sidecar
4141
image: "{{ .Values.objectstorageProvisionerSidecar.image.registry }}/{{ .Values.objectstorageProvisionerSidecar.image.repository }}:{{ .Values.objectstorageProvisionerSidecar.image.tag }}"
4242
imagePullPolicy: {{ .Values.objectstorageProvisionerSidecar.image.pullPolicy }}
4343
args:
4444
- "--v={{ .Values.objectstorageProvisionerSidecar.logLevel }}"
4545
envFrom:
4646
- secretRef:
47-
name: objectstorage-provisioner
47+
name: {{ include "cosi-driver-nutanix.name" . }}
4848
env:
4949
- name: POD_NAMESPACE
5050
valueFrom:
5151
fieldRef:
52-
fieldPath: metadata.namespace
52+
fieldPath:
53+
metadata.namespace
5354
volumeMounts:
5455
- mountPath: /var/lib/cosi
5556
name: socket
56-
serviceAccountName: objectstorage-provisioner-sa
57+
serviceAccountName: {{ include "cosi-driver-nutanix.name" . }}
5758
volumes:
5859
- emptyDir: {}
5960
name: socket

charts/templates/rbac.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
{{ include "cosi-driver-nutanix.resource.annotations" . | indent 4 }}
66
labels:
77
{{ include "cosi-driver-nutanix.resource.labels" . | indent 4 }}
8-
name: objectstorage-provisioner-role
8+
name: {{ include "cosi-driver-nutanix.name" . }}
99
rules:
1010
- apiGroups: ["objectstorage.k8s.io"]
1111
resources: ["buckets", "bucketaccesses","buckets/status", "bucketaccesses/status", "bucketaccessclasses", "bucketaccessclasses/status", "bucketclaims", "bucketclaims/status"]
@@ -24,12 +24,12 @@ metadata:
2424
{{ include "cosi-driver-nutanix.resource.annotations" . | indent 4 }}
2525
labels:
2626
{{ include "cosi-driver-nutanix.resource.labels" . | indent 4 }}
27-
name: objectstorage-provisioner-role-binding
27+
name: {{ include "cosi-driver-nutanix.name" . }}
2828
roleRef:
2929
apiGroup: rbac.authorization.k8s.io
3030
kind: ClusterRole
31-
name: objectstorage-provisioner-role
31+
name: {{ include "cosi-driver-nutanix.name" . }}
3232
subjects:
3333
- kind: ServiceAccount
34-
name: objectstorage-provisioner-sa
34+
name: {{ include "cosi-driver-nutanix.name" . }}
3535
namespace: {{ .Release.Namespace }}

charts/templates/sa.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ metadata:
55
{{ include "cosi-driver-nutanix.resource.annotations" . | indent 4 }}
66
labels:
77
{{ include "cosi-driver-nutanix.resource.labels" . | indent 4 }}
8-
name: objectstorage-provisioner-sa
8+
name: {{ include "cosi-driver-nutanix.name" . }}
99
namespace: {{ .Release.Namespace }}

charts/templates/secret.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata:
66
{{ include "cosi-driver-nutanix.resource.annotations" . | indent 4 }}
77
labels:
88
{{ include "cosi-driver-nutanix.resource.labels" . | indent 4 }}
9-
name: objectstorage-provisioner
9+
name: {{ include "cosi-driver-nutanix.name" . }}
1010
namespace: {{ .Release.Namespace }}
1111
stringData:
1212
ACCESS_KEY: {{ required "access_key is required." .Values.secret.access_key | quote }}

project/resources/deployment.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: apps/v1
22
kind: Deployment
33
metadata:
4-
name: objectstorage-provisioner
4+
name: cosi-driver-nutanix
55
labels:
66
app.kubernetes.io/part-of: container-object-storage-interface
77
app.kubernetes.io/component: driver-ntnx
@@ -31,7 +31,7 @@ spec:
3131
app.kubernetes.io/version: main
3232
app.kubernetes.io/name: cosi-driver-ntnx
3333
spec:
34-
serviceAccountName: objectstorage-provisioner-sa
34+
serviceAccountName: cosi-driver-nutanix
3535
volumes:
3636
- name: socket
3737
emptyDir: {}
@@ -41,18 +41,18 @@ spec:
4141
imagePullPolicy: IfNotPresent
4242
envFrom:
4343
- secretRef:
44-
name: objectstorage-provisioner
44+
name: cosi-driver-nutanix
4545
volumeMounts:
4646
- mountPath: /var/lib/cosi
4747
name: socket
48-
- name: objectstorage-provisioner-sidecar
48+
- name: objectstorage-sidecar
4949
image: k8s-staging-sig-storage/objectstorage-sidecar/objectstorage-sidecar:v20221117-v0.1.0-22-g0e67387
5050
imagePullPolicy: Always
5151
args:
5252
- "--v=5"
5353
envFrom:
5454
- secretRef:
55-
name: objectstorage-provisioner
55+
name: cosi-driver-nutanix
5656
env:
5757
- name: POD_NAMESPACE
5858
valueFrom:

project/resources/rbac.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
kind: ClusterRole
33
apiVersion: rbac.authorization.k8s.io/v1
44
metadata:
5-
name: objectstorage-provisioner-role
5+
name: cosi-driver-nutanix
66
labels:
77
app.kubernetes.io/part-of: container-object-storage-interface
88
app.kubernetes.io/component: driver-ntnx
@@ -22,17 +22,17 @@ rules:
2222
kind: ClusterRoleBinding
2323
apiVersion: rbac.authorization.k8s.io/v1
2424
metadata:
25-
name: objectstorage-provisioner-role-binding
25+
name: cosi-driver-nutanix
2626
labels:
2727
app.kubernetes.io/part-of: container-object-storage-interface
2828
app.kubernetes.io/component: driver-ntnx
2929
app.kubernetes.io/version: main
3030
app.kubernetes.io/name: cosi-driver-ntnx
3131
subjects:
3232
- kind: ServiceAccount
33-
name: objectstorage-provisioner-sa
33+
name: cosi-driver-nutanix
3434
namespace: default # must set to default. see https://github.com/kubernetes-sigs/kustomize/issues/1377#issuecomment-694731163
3535
roleRef:
3636
kind: ClusterRole
37-
name: objectstorage-provisioner-role
37+
name: cosi-driver-nutanix
3838
apiGroup: rbac.authorization.k8s.io

project/resources/sa.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: v1
33
kind: ServiceAccount
44
metadata:
5-
name: objectstorage-provisioner-sa
5+
name: cosi-driver-nutanix
66
namespace: default # must set to default. see https://github.com/kubernetes-sigs/kustomize/issues/1377#issuecomment-694731163
77
labels:
88
app.kubernetes.io/part-of: container-object-storage-interface

project/resources/secret.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
kind: Secret
33
metadata:
4-
name: objectstorage-provisioner
4+
name: cosi-driver-nutanix
55
labels:
66
app.kubernetes.io/part-of: container-object-storage-interface
77
app.kubernetes.io/component: driver-ntnx

0 commit comments

Comments
 (0)