Skip to content

Commit d48d5fe

Browse files
authored
Merge pull request #12 from childsb/docker_rename
Docker container updates
2 parents 542525a + 35d3c51 commit d48d5fe

File tree

4 files changed

+103
-4
lines changed

4 files changed

+103
-4
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ COPY ./examples/flex-debug.sh /opt/csi-provisioner/
1616
COPY ./_output/csi-provisioner /opt/csi-provisioner/
1717

1818

19-
ENTRYPOINT ["/opt/csi-flex/flex-provision"]
19+
ENTRYPOINT ["/opt/csi-provisioner/csi-provisioner"]
2020

Makefile

+7-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
IMAGE = k8scsi/csi-provision
16+
1517
VERSION :=
1618
TAG := $(shell git describe --abbrev=0 --tags HEAD 2>/dev/null)
1719
COMMIT := $(shell git rev-parse HEAD)
@@ -42,9 +44,13 @@ deps:
4244
.PHONY: deps
4345

4446
quick-container:
45-
docker build -t kube-csi-provision:latest .
47+
docker build -t $(IMAGE):$(VERSION) .
4648
.PHONY: quick-container
4749

50+
push-container:
51+
docker push $(IMAGE):$(VERSION)
52+
.PHONY: push-container
53+
4854
provisioner:
4955
mkdir -p _output
5056
go build -i -o _output/csi-provisioner ./cmd/csi-provisioner/

cmd/csi-provisioner/csi-provisioner.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ import (
3535
)
3636

3737
var (
38-
provisioner = flag.String("provisioner", "k8s.io/default", "Name of the provisioner. The provisioner will only provision volumes for claims that request a StorageClass with a provisioner field set equal to this name.")
38+
provisioner = flag.String("provisioner", "k8s.io/flex", "Name of the provisioner. The provisioner will only provision volumes for claims that request a StorageClass with a provisioner field set equal to this name.")
3939
master = flag.String("master", "", "Master URL to build a client config from. Either this or kubeconfig needs to be set if the provisioner is being run out of cluster.")
4040
kubeconfig = flag.String("kubeconfig", "/var/run/kubernetes/admin.kubeconfig", "Absolute path to the kubeconfig file. Either this or master needs to be set if the provisioner is being run out of cluster.")
41-
csiEndpoint = flag.String("csiendpoint", "/tmp/csi.sock", "The gRPC endpoint for Target CSI Volume")
41+
csiEndpoint = flag.String("csi-address", "/tmp/csi.sock", "The gRPC endpoint for Target CSI Volume")
4242
connectionTimeout = flag.Duration("connection-timeout", 10*time.Second, "Timeout for waiting for CSI driver socket.")
4343

4444
provisionController *controller.ProvisionController

deploy/kubernetes/statefulset.yaml

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# This YAML file contains all API objects that are necessary to run external
2+
# CSI provisioner.
3+
#
4+
# In production, this needs to be in separate files, e.g. service account and
5+
# role and role binding needs to be created once, while stateful set may
6+
# require some tuning.
7+
#
8+
# In addition, mock CSI driver is hardcoded as the CSI driver.
9+
10+
apiVersion: v1
11+
kind: ServiceAccount
12+
metadata:
13+
name: csi-provisioner
14+
15+
---
16+
kind: ClusterRole
17+
apiVersion: rbac.authorization.k8s.io/v1
18+
metadata:
19+
name: external-provisioner-runner
20+
rules:
21+
- apiGroups: [""]
22+
resources: ["persistentvolumes"]
23+
verbs: ["get", "list", "watch", "update"]
24+
25+
---
26+
kind: ClusterRoleBinding
27+
apiVersion: rbac.authorization.k8s.io/v1
28+
metadata:
29+
name: csi-provisioner-role
30+
subjects:
31+
- kind: ServiceAccount
32+
name: csi-provisioner
33+
namespace: default
34+
roleRef:
35+
kind: ClusterRole
36+
name: external-provisioner-runner
37+
apiGroup: rbac.authorization.k8s.io
38+
39+
---
40+
kind: Service
41+
apiVersion: v1
42+
metadata:
43+
name: csi-provisioner
44+
labels:
45+
app: csi-provisioner
46+
spec:
47+
selector:
48+
app: csi-provisioner
49+
ports:
50+
- name: dummy
51+
port: 12345
52+
53+
---
54+
kind: StatefulSet
55+
apiVersion: apps/v1beta1
56+
metadata:
57+
name: csi-provisioner
58+
spec:
59+
serviceName: "csi-provisioner"
60+
replicas: 1
61+
template:
62+
metadata:
63+
labels:
64+
app: csi-provisioner
65+
spec:
66+
serviceAccount: csi-provisioner
67+
containers:
68+
- name: csi-provisioner
69+
image: docker.io/k8scsi/csi-provisioner
70+
args:
71+
- "--provisioner=csi-flex"
72+
- "--csi-address=$(ADDRESS)"
73+
env:
74+
- name: ADDRESS
75+
value: /var/lib/csi/sockets/pluginproxy/mock.socket
76+
imagePullPolicy: "IfNotPresent"
77+
volumeMounts:
78+
- name: socket-dir
79+
mountPath: /var/lib/csi/sockets/pluginproxy/
80+
81+
- name: mock-driver
82+
image: docker.io/k8scsi/mock-plugin
83+
env:
84+
- name: CSI_ENDPOINT
85+
value: /var/lib/csi/sockets/pluginproxy/mock.socket
86+
volumeMounts:
87+
- name: socket-dir
88+
mountPath: /var/lib/csi/sockets/pluginproxy/
89+
90+
volumes:
91+
- name: socket-dir
92+
emptyDir:
93+

0 commit comments

Comments
 (0)