Skip to content

Commit

Permalink
Merge pull request #12 from childsb/docker_rename
Browse files Browse the repository at this point in the history
Docker container updates
  • Loading branch information
childsb authored Dec 1, 2017
2 parents 542525a + 35d3c51 commit d48d5fe
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ COPY ./examples/flex-debug.sh /opt/csi-provisioner/
COPY ./_output/csi-provisioner /opt/csi-provisioner/


ENTRYPOINT ["/opt/csi-flex/flex-provision"]
ENTRYPOINT ["/opt/csi-provisioner/csi-provisioner"]

8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

IMAGE = k8scsi/csi-provision

VERSION :=
TAG := $(shell git describe --abbrev=0 --tags HEAD 2>/dev/null)
COMMIT := $(shell git rev-parse HEAD)
Expand Down Expand Up @@ -42,9 +44,13 @@ deps:
.PHONY: deps

quick-container:
docker build -t kube-csi-provision:latest .
docker build -t $(IMAGE):$(VERSION) .
.PHONY: quick-container

push-container:
docker push $(IMAGE):$(VERSION)
.PHONY: push-container

provisioner:
mkdir -p _output
go build -i -o _output/csi-provisioner ./cmd/csi-provisioner/
Expand Down
4 changes: 2 additions & 2 deletions cmd/csi-provisioner/csi-provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ import (
)

var (
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.")
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.")
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.")
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.")
csiEndpoint = flag.String("csiendpoint", "/tmp/csi.sock", "The gRPC endpoint for Target CSI Volume")
csiEndpoint = flag.String("csi-address", "/tmp/csi.sock", "The gRPC endpoint for Target CSI Volume")
connectionTimeout = flag.Duration("connection-timeout", 10*time.Second, "Timeout for waiting for CSI driver socket.")

provisionController *controller.ProvisionController
Expand Down
93 changes: 93 additions & 0 deletions deploy/kubernetes/statefulset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# This YAML file contains all API objects that are necessary to run external
# CSI provisioner.
#
# In production, this needs to be in separate files, e.g. service account and
# role and role binding needs to be created once, while stateful set may
# require some tuning.
#
# In addition, mock CSI driver is hardcoded as the CSI driver.

apiVersion: v1
kind: ServiceAccount
metadata:
name: csi-provisioner

---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: external-provisioner-runner
rules:
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "update"]

---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: csi-provisioner-role
subjects:
- kind: ServiceAccount
name: csi-provisioner
namespace: default
roleRef:
kind: ClusterRole
name: external-provisioner-runner
apiGroup: rbac.authorization.k8s.io

---
kind: Service
apiVersion: v1
metadata:
name: csi-provisioner
labels:
app: csi-provisioner
spec:
selector:
app: csi-provisioner
ports:
- name: dummy
port: 12345

---
kind: StatefulSet
apiVersion: apps/v1beta1
metadata:
name: csi-provisioner
spec:
serviceName: "csi-provisioner"
replicas: 1
template:
metadata:
labels:
app: csi-provisioner
spec:
serviceAccount: csi-provisioner
containers:
- name: csi-provisioner
image: docker.io/k8scsi/csi-provisioner
args:
- "--provisioner=csi-flex"
- "--csi-address=$(ADDRESS)"
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/mock.socket
imagePullPolicy: "IfNotPresent"
volumeMounts:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/

- name: mock-driver
image: docker.io/k8scsi/mock-plugin
env:
- name: CSI_ENDPOINT
value: /var/lib/csi/sockets/pluginproxy/mock.socket
volumeMounts:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/

volumes:
- name: socket-dir
emptyDir:

0 comments on commit d48d5fe

Please sign in to comment.