Skip to content

Commit 356f1ab

Browse files
authored
Merge pull request #2 from Madhan-SWE/feature_remove_pvm_instance_id_v2
Remove PVM Instance Id from deployment file
2 parents 7a1c861 + 5a308ce commit 356f1ab

20 files changed

+220
-68
lines changed

block/pod.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ spec:
1414
volumes:
1515
- name: data
1616
persistentVolumeClaim:
17-
claimName: block-claim
17+
claimName: block-claim

block/pvc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ spec:
99
storageClassName: powervs-sc
1010
resources:
1111
requests:
12-
storage: 10Gi
12+
storage: 10Gi

cmd/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ func main() {
3838
driver.WithDebug(options.ServerOptions.Debug),
3939
driver.WithVolumeAttachLimit(options.NodeOptions.VolumeAttachLimit),
4040
//driver.WithKubernetesClusterID(options.ControllerOptions.KubernetesClusterID),
41-
driver.WithPVMCloudInstanceID(options.ServerOptions.PVMCloudInstanceID),
4241
)
4342
if err != nil {
4443
klog.Fatalln(err)

cmd/options/server_options.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,11 @@ import (
2828
type ServerOptions struct {
2929
// Endpoint is the endpoint that the driver server should listen on.
3030
Endpoint string
31-
// PowerVS Cloud Instance ID
32-
PVMCloudInstanceID string
3331
// Debug
3432
Debug bool
3533
}
3634

3735
func (s *ServerOptions) AddFlags(fs *flag.FlagSet) {
3836
fs.StringVar(&s.Endpoint, "endpoint", driver.DefaultCSIEndpoint, "Endpoint for the CSI driver server")
39-
fs.StringVar(&s.PVMCloudInstanceID, "pvm-cloud-instance-id","","ID of the PVM Cloud Instance ID")
40-
fs.BoolVar(&s.Debug, "debug",false,"Debug option PowerVS client(Prints API requests and replies)")
37+
fs.BoolVar(&s.Debug, "debug", false, "Debug option PowerVS client(Prints API requests and replies)")
4138
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
kind: ClusterRole
3+
apiVersion: rbac.authorization.k8s.io/v1
4+
metadata:
5+
name: powervs-node-role
6+
labels:
7+
app.kubernetes.io/name: powervs-csi-driver
8+
rules:
9+
- apiGroups: [""]
10+
resources: ["nodes"]
11+
verbs: ["get"]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
kind: ClusterRoleBinding
3+
apiVersion: rbac.authorization.k8s.io/v1
4+
metadata:
5+
name: powervs-csi-node-getter-binding
6+
labels:
7+
app.kubernetes.io/name: powervs-csi-driver
8+
subjects:
9+
- kind: ServiceAccount
10+
name: powervs-csi-node-sa
11+
namespace: kube-system
12+
roleRef:
13+
kind: ClusterRole
14+
name: powervs-node-role
15+
apiGroup: rbac.authorization.k8s.io

deploy/kubernetes/base/controller.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,14 @@ spec:
3333
- --endpoint=$(CSI_ENDPOINT)
3434
- --logtostderr
3535
- --v=5
36-
- --pvm-cloud-instance-id=7845d372-d4e1-46b8-91fc-41051c984601
3736
- --debug
3837
env:
3938
- name: CSI_ENDPOINT
4039
value: unix:///var/lib/csi/sockets/pluginproxy/csi.sock
40+
- name: CSI_NODE_NAME
41+
valueFrom:
42+
fieldRef:
43+
fieldPath: spec.nodeName
4144
- name: IBMCLOUD_API_KEY
4245
valueFrom:
4346
secretKeyRef:

deploy/kubernetes/base/node.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ spec:
2020
nodeSelector:
2121
kubernetes.io/os: linux
2222
hostNetwork: true
23+
serviceAccountName: powervs-csi-node-sa
2324
priorityClassName: system-node-critical
2425
tolerations:
2526
- operator: Exists
@@ -35,11 +36,14 @@ spec:
3536
# - --volume-attach-limit=42
3637
- --logtostderr
3738
- --v=5
38-
- --pvm-cloud-instance-id=7845d372-d4e1-46b8-91fc-41051c984601
3939
- --debug
4040
env:
4141
- name: CSI_ENDPOINT
4242
value: unix:/csi/csi.sock
43+
- name: CSI_NODE_NAME
44+
valueFrom:
45+
fieldRef:
46+
fieldPath: spec.nodeName
4347
- name: IBMCLOUD_API_KEY
4448
valueFrom:
4549
secretKeyRef:
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: powervs-csi-node-sa
6+
namespace: kube-system
7+
labels:
8+
app.kubernetes.io/name: powervs-csi-driver

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ require (
1010
github.com/dgrijalva/jwt-go v3.2.0+incompatible
1111
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
1212
google.golang.org/grpc v1.27.0
13+
k8s.io/api v0.19.4
1314
k8s.io/apimachinery v0.19.4
15+
k8s.io/client-go v0.19.4
1416
k8s.io/klog/v2 v2.4.0
1517
k8s.io/kubernetes v1.19.4
1618
k8s.io/utils v0.0.0-20200729134348-d5654de09c73

0 commit comments

Comments
 (0)