From dba4835e931623fc65a8ce228a912109167581e2 Mon Sep 17 00:00:00 2001 From: Michelle Au Date: Thu, 9 Jan 2020 13:23:00 -0800 Subject: [PATCH 1/2] remove deprecated connection-timeout arg --- README.md | 4 - cmd/livenessprobe/main.go | 3 - .../hostpath-with-livenessprobe.yaml | 201 ------------------ .../kubernetes/livenessprobe-sidecar.yaml | 5 +- 4 files changed, 2 insertions(+), 211 deletions(-) delete mode 100644 deployment/kubernetes/hostpath-with-livenessprobe.yaml diff --git a/README.md b/README.md index d6ee3b04..4cdb3c13 100644 --- a/README.md +++ b/README.md @@ -77,10 +77,6 @@ spec: * All glog / klog arguments are supported, such as `-v ` or `-alsologtostderr`. -#### Deprecated arguments - -* `--connection-timeout `: This option was used to limit establishing connection to CSI driver. Currently, the option does not have any effect and the external-provisioner tries to connect to CSI driver socket indefinitely. It is recommended to run ReadinessProbe on the driver to ensure that the driver comes up in reasonable time. - ## Community, discussion, contribution, and support Learn how to engage with the Kubernetes community on the [community page](http://kubernetes.io/community/). diff --git a/cmd/livenessprobe/main.go b/cmd/livenessprobe/main.go index 51dd2972..e0e310b5 100644 --- a/cmd/livenessprobe/main.go +++ b/cmd/livenessprobe/main.go @@ -26,7 +26,6 @@ import ( "k8s.io/klog" connlib "github.com/kubernetes-csi/csi-lib-utils/connection" - "github.com/kubernetes-csi/csi-lib-utils/deprecatedflags" "github.com/kubernetes-csi/csi-lib-utils/rpc" "google.golang.org/grpc" @@ -37,8 +36,6 @@ var ( probeTimeout = flag.Duration("probe-timeout", time.Second, "Probe timeout in seconds") csiAddress = flag.String("csi-address", "/run/csi/socket", "Address of the CSI driver socket.") healthzPort = flag.String("health-port", "9808", "TCP ports for listening healthz requests") - - _ = deprecatedflags.Add("connection-timeout") ) type healthProbe struct { diff --git a/deployment/kubernetes/hostpath-with-livenessprobe.yaml b/deployment/kubernetes/hostpath-with-livenessprobe.yaml deleted file mode 100644 index 043ae4a3..00000000 --- a/deployment/kubernetes/hostpath-with-livenessprobe.yaml +++ /dev/null @@ -1,201 +0,0 @@ -apiVersion: storage.k8s.io/v1 -kind: StorageClass -metadata: - name: csi-hostpath-sc -provisioner: csi-hostpath -parameters: - csiProvisionerSecretName: csi-secret - csiProvisionerSecretNamespace: default -reclaimPolicy: Delete -volumeBindingMode: Immediate ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: csi-service-account - namespace: default ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: csi-cluster-role -rules: -- apiGroups: - - "" - resources: - - persistentvolumes - verbs: - - create - - delete - - get - - list - - watch - - update -- apiGroups: - - "" - resources: - - secrets - verbs: - - get - - list -- apiGroups: - - "" - resources: - - persistentvolumeclaims - verbs: - - get - - list - - watch - - update -- apiGroups: - - "" - resources: - - nodes - verbs: - - get - - list - - watch - - update -- apiGroups: - - storage.k8s.io - resources: - - volumeattachments - verbs: - - get - - list - - watch - - update -- apiGroups: - - storage.k8s.io - resources: - - storageclasses - verbs: - - get - - list - - watch -- apiGroups: - - "" - resources: - - events - verbs: - - list - - watch - - create - - update - - patch ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: csi-role-binding -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: csi-cluster-role -subjects: -- kind: ServiceAccount - name: csi-service-account - namespace: default ---- -apiVersion: v1 -kind: Pod -metadata: - labels: - app: hostpath-driver - name: csi-hostpath-plugin - namespace: default -spec: - serviceAccount: csi-service-account - containers: - - name: external-provisioner - args: - - --v=5 - - --provisioner=csi-hostpath - - --csi-address=/csi/csi.sock - image: quay.io/k8scsi/csi-provisioner:v0.2.0 - imagePullPolicy: Always - volumeMounts: - - mountPath: /csi - name: socket-dir - - name: driver-registrar - args: - - --v=5 - - --csi-address=/csi/csi.sock - env: - - name: KUBE_NODE_NAME - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: spec.nodeName - image: quay.io/k8scsi/driver-registrar:v0.2.0 - imagePullPolicy: Always - volumeMounts: - - mountPath: /csi - name: socket-dir - - name: external-attacher - args: - - --v=5 - - --csi-address=$(ADDRESS) - env: - - name: ADDRESS - value: /csi/csi.sock - image: quay.io/k8scsi/csi-attacher:v0.2.0 - imagePullPolicy: Always - volumeMounts: - - mountPath: /csi - name: socket-dir - - name: hostpath-driver - image: quay.io/k8scsi/hostpathplugin:v0.2.0 - imagePullPolicy: Always - securityContext: - privileged: true - ports: - - containerPort: 9808 - name: healthz - protocol: TCP - livenessProbe: - failureThreshold: 5 - httpGet: - path: /healthz - port: healthz - initialDelaySeconds: 10 - timeoutSeconds: 3 - periodSeconds: 2 - failureThreshold: 1 - volumeMounts: - - mountPath: /csi - name: socket-dir - - mountPath: /var/lib/kubelet/pods - mountPropagation: Bidirectional - name: mountpoint-dir - args: - - --v=5 - - --endpoint=$(CSI_ENDPOINT) - - --nodeid=$(KUBE_NODE_NAME) - env: - - name: CSI_ENDPOINT - value: unix:///csi/csi.sock - - name: KUBE_NODE_NAME - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: spec.nodeName - - name: liveness-probe - imagePullPolicy: Always - volumeMounts: - - mountPath: /csi - name: socket-dir - image: quay.io/k8scsi/livenessprobe:v0.2.0 - args: - - --v=5 - - --csi-address=/csi/csi.sock - - --connection-timeout=3s - volumes: - - hostPath: - path: /var/lib/kubelet/plugins/csi-hostpath - type: DirectoryOrCreate - name: socket-dir - - hostPath: - path: /var/lib/kubelet/pods - type: DirectoryOrCreate - name: mountpoint-dir diff --git a/deployment/kubernetes/livenessprobe-sidecar.yaml b/deployment/kubernetes/livenessprobe-sidecar.yaml index 0fc93ce7..2fdc6a6d 100644 --- a/deployment/kubernetes/livenessprobe-sidecar.yaml +++ b/deployment/kubernetes/livenessprobe-sidecar.yaml @@ -1,5 +1,5 @@ - name: hostpath-driver - image: quay.io/k8scsi/hostpathplugin:v0.2.0 + image: quay.io/k8scsi/hostpathplugin:canary imagePullPolicy: Always securityContext: privileged: true @@ -47,9 +47,8 @@ volumeMounts: - mountPath: /csi name: socket-dir - image: quay.io/k8scsi/livenessprobe:v0.2.0 + image: quay.io/k8scsi/livenessprobe:canary args: - --v=5 - --csi-address=/csi/csi.sock - - --connection-timeout=3s # From 062b2feb0003b9579a06d3a58d2f689f159d656c Mon Sep 17 00:00:00 2001 From: Michelle Au Date: Thu, 9 Jan 2020 13:37:19 -0800 Subject: [PATCH 2/2] update vendor --- .../deprecatedflags/deprecatedflags.go | 57 ------------------- vendor/modules.txt | 1 - 2 files changed, 58 deletions(-) delete mode 100644 vendor/github.com/kubernetes-csi/csi-lib-utils/deprecatedflags/deprecatedflags.go diff --git a/vendor/github.com/kubernetes-csi/csi-lib-utils/deprecatedflags/deprecatedflags.go b/vendor/github.com/kubernetes-csi/csi-lib-utils/deprecatedflags/deprecatedflags.go deleted file mode 100644 index 9b035044..00000000 --- a/vendor/github.com/kubernetes-csi/csi-lib-utils/deprecatedflags/deprecatedflags.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package deprecatedflags can be used to declare a flag that is no -// longer supported. -package deprecatedflags - -import ( - "flag" - - "k8s.io/klog" -) - -// Add defines a deprecated option which used to take some kind of -// value. The type of the argument no longer matters, it gets ignored -// and instead using the option triggers a deprecation warning. The -// return code can be safely ignored and is only provided to support -// replacing functions like flag.Int in a global variable section. -func Add(name string) bool { - flag.Var(deprecated{name: name}, name, "This option is deprecated.") - return true -} - -// AddBool defines a deprecated boolean option. Otherwise it behaves -// like Add. -func AddBool(name string) bool { - flag.Var(deprecated{name: name, isBool: true}, name, "This option is deprecated.") - return true -} - -type deprecated struct { - name string - isBool bool -} - -var _ flag.Value = deprecated{} - -func (d deprecated) String() string { return "" } -func (d deprecated) Set(value string) error { - klog.Warningf("Warning: option %s=%q is deprecated and has no effect", d.name, value) - return nil -} -func (d deprecated) Type() string { return "" } -func (d deprecated) IsBoolFlag() bool { return d.isBool } diff --git a/vendor/modules.txt b/vendor/modules.txt index 51637a01..6932e4d2 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -13,7 +13,6 @@ github.com/golang/protobuf/ptypes/timestamp github.com/golang/protobuf/ptypes/wrappers # github.com/kubernetes-csi/csi-lib-utils v0.6.1 github.com/kubernetes-csi/csi-lib-utils/connection -github.com/kubernetes-csi/csi-lib-utils/deprecatedflags github.com/kubernetes-csi/csi-lib-utils/protosanitizer github.com/kubernetes-csi/csi-lib-utils/rpc # github.com/kubernetes-csi/csi-test v2.0.0+incompatible