Skip to content

Commit

Permalink
Merge pull request #5 from sbezverk/travis_docker
Browse files Browse the repository at this point in the history
Adding Docker and modifying travis
  • Loading branch information
sbezverk authored Mar 16, 2018
2 parents 852a11a + 7771ece commit 1f02f88
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: go

# Needed for e2e tests
sudo: true
go: 1.9.x
go_import_path: github.com/kubernetes-csi/livenessprobe
Expand All @@ -12,3 +11,9 @@ script:
- go fmt $(go list ./... | grep -v vendor) | wc -l | grep 0
- go vet $(go list ./... | grep -v vendor)
- go test $(go list ./... | grep -v vendor)
after_success:
- if [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
sudo make livenessprobe-container;
docker login -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}" quay.io;
docker push quay.io/k8scsi/livenessprobe:canary;
fi
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2018 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.

FROM alpine
LABEL maintainers="Kubernetes Authors"
LABEL description="CSI Driver liveness probe"

COPY ./bin/livenessprobe /livenessprobe
ENTRYPOINT ["/livenessprobe"]
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

REGISTRY_NAME = quay.io/k8scsi
IMAGE_VERSION = canary

.PHONY: all liveness clean test

ifdef V
Expand All @@ -30,6 +33,9 @@ macos-livenessprobe:
mkdir -p bin
CGO_ENABLED=0 GOOS=darwin go build -a -ldflags '-extldflags "-static"' -o ./bin/livenessprobe.osx ./cmd

livenessprobe-container: livenessprobe
docker build -t $(REGISTRY_NAME)/livenessprobe:$(IMAGE_VERSION) -f ./Dockerfile .

clean:
rm -rf bin

Expand Down
22 changes: 22 additions & 0 deletions deployment/kubernetes/livenessprobe-sidecar.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# This yaml must be used ONLY as a side car for CSI driver
#
- name: liveness-probe
image: quay.io/k8scsi/livenessprobe:v0.2.0
imagePullPolicy: Always
command: ["/bin/sh"]
args: ["-c", "while true; do sleep 10;done"]
livenessProbe:
exec:
command:
- ./livenessprobe
- --v=6
- --csi-address=/csi/csi.sock
- --connection-timeout=3s
initialDelaySeconds: 10
timeoutSeconds: 3
periodSeconds: 2
failureThreshold: 1
volumeMounts:
- mountPath: /csi
name: socket-dir

0 comments on commit 1f02f88

Please sign in to comment.