Skip to content

Adding Docker and modifying travis #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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