Skip to content

Commit

Permalink
use ubuntu:16.04 as base images which can run qbd
Browse files Browse the repository at this point in the history
Signed-off-by: zhangmin <[email protected]>
  • Loading branch information
min-zh committed Aug 12, 2020
1 parent 474085c commit 1ddc5ed
Show file tree
Hide file tree
Showing 10 changed files with 1,470 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ before_install:
- docker tag k8s.gcr.io/debian-base:v1.0.0 gcr.azk8s.cn/google_containers/debian-base:v1.0.0

script:
- make neonsan-container
- make container
16 changes: 12 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@

.PHONY: all disk

NEONSAN_IMAGE_NAME=csiplugin/csi-neonsan
NEONSAN_IMAGE_VERSION=v1.2.0-rc2
IMAGE=csiplugin/csi-neonsan
TAG=v1.2.0-rc2
IMAGE_UBUNTU=csiplugin/csi-neonsan-ubuntu
TAG_UBUNTU=v1.2.0
RELEASE_VERSION=v1.2.0
ROOT_PATH=$(pwd)
PACKAGE_LIST=./cmd/... ./pkg/...
Expand All @@ -28,12 +30,18 @@ neonsan-plugin:
neonsan-plugin-debug:
go build -gcflags "all=-N -l" -mod=vendor -o deploy/neonsan/plugin/neonsan-plugin-debug ./cmd/neonsan

neonsan-container:
docker build -t ${NEONSAN_IMAGE_NAME}:${NEONSAN_IMAGE_VERSION} -f deploy/neonsan/docker/Dockerfile .
container:
docker build -t ${IMAGE}:${TAG} -f deploy/neonsan/docker/Dockerfile .

container-ubuntu:
docker build -t ${IMAGE_UBUNTU}:${TAG_UBUNTU} -f deploy/neonsan/docker/ubuntu/Dockerfile .

yaml:
kustomize build deploy/neonsan/kubernetes/base > deploy/neonsan/kubernetes/release/csi-neonsan-${RELEASE_VERSION}.yaml

yaml-ubuntu:
kustomize build deploy/neonsan/kubernetes/base-ubuntu > deploy/neonsan/kubernetes/release/csi-neonsan-${RELEASE_VERSION}-ubuntu.yaml

release:
cp deploy/neonsan/plugin/* deploy/neonsan/kubernetes/release && cd deploy/neonsan/kubernetes/ && tar -zcvf csi-neonsan-${RELEASE_VERSION}.tar.gz release/*

Expand Down
31 changes: 31 additions & 0 deletions deploy/neonsan/docker/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# +-------------------------------------------------------------------------
# | Copyright (C) 2018 Yunify, Inc.
# +-------------------------------------------------------------------------
# | Licensed under the Apache License, Version 2.0 (the "License");
# | you may not use this work except in compliance with the License.
# | You may obtain a copy of the License in the LICENSE file, or 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 golang:1.12.7-alpine as builder
WORKDIR /qingstor-csi
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -a -mod=vendor -ldflags "-s -w" -o _output/neonsan-csi-driver ./cmd/neonsan

FROM ubuntu:16.04
LABEL maintainers="Yunify"
LABEL description="NeonSAN CSI plugin"
# libcurl3 and libicu55 for qbd
RUN apt-get update -y && \
apt-get install -y libcurl3 libicu55
COPY --from=builder /qingstor-csi/_output/neonsan-csi-driver /neonsan-csi-driver
RUN chmod +x /neonsan-csi-driver && \
mkdir -p /var/log/neonsan-csi-driver
ENTRYPOINT ["/neonsan-csi-driver"]
161 changes: 161 additions & 0 deletions deploy/neonsan/kubernetes/base-ubuntu/controller-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
# Copyright (C) 2018 Yunify, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this work except in compliance with the License.
# You may obtain a copy of the License in the LICENSE file, or 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.

kind: Deployment
apiVersion: apps/v1
metadata:
name: csi-neonsan-controller
namespace: kube-system
spec:
replicas: 1
selector:
matchLabels:
role: controller
template:
metadata:
labels:
role: controller
spec:
serviceAccount: csi-neonsan-controller
containers:
- name: csi-provisioner
image: csiplugin/csi-provisioner:v1.5.0
resources:
limits:
memory: "20Mi"
cpu: "20m"
requests:
memory: "20Mi"
cpu: "20m"
args:
- "--csi-address=$(ADDRESS)"
- "--enable-leader-election"
- "--feature-gates=Topology=true"
- "--leader-election-type=leases"
- "--retry-interval-max=5m"
- "--retry-interval-start=5s"
- "--timeout=90s"
- "--worker-threads=5"
- "--volume-name-prefix=pvc"
- "--v=5"
env:
- name: ADDRESS
value: /csi/csi.sock
imagePullPolicy: "IfNotPresent"
volumeMounts:
- name: socket-dir
mountPath: /csi
- name: csi-attacher
image: csiplugin/csi-attacher:v2.1.1
resources:
limits:
memory: "20Mi"
cpu: "20m"
requests:
memory: "20Mi"
cpu: "20m"
args:
- "--csi-address=$(ADDRESS)"
- "--leader-election"
- "--retry-interval-max=5m"
- "--retry-interval-start=5s"
- "--timeout=90s"
- "--worker-threads=5"
- "--v=5"
env:
- name: ADDRESS
value: /csi/csi.sock
- name: MY_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
imagePullPolicy: "IfNotPresent"
volumeMounts:
- name: socket-dir
mountPath: /csi
- name: csi-snapshotter
image: csiplugin/csi-snapshotter:v2.0.1
resources:
limits:
memory: "20Mi"
cpu: "20m"
requests:
memory: "20Mi"
cpu: "20m"
args:
- "--csi-address=$(ADDRESS)"
- "--leader-election=false"
- "--v=5"
env:
- name: ADDRESS
value: /csi/csi.sock
imagePullPolicy: "IfNotPresent"
volumeMounts:
- name: socket-dir
mountPath: /csi
- name: csi-resizer
image: csiplugin/csi-resizer:v0.4.0
resources:
limits:
memory: "20Mi"
cpu: "20m"
requests:
memory: "20Mi"
cpu: "20m"
args:
- "--csi-address=$(ADDRESS)"
- "--leader-election"
- "--v=5"
env:
- name: ADDRESS
value: /csi/csi.sock
imagePullPolicy: "IfNotPresent"
volumeMounts:
- name: socket-dir
mountPath: /csi
- name: csi-neonsan
image: csiplugin/csi-neonsan:v1.2.0-rc2
resources:
limits:
memory: "50Mi"
cpu: "50m"
requests:
memory: "50Mi"
cpu: "50m"
args:
- "--config=/etc/neonsan/qbd.conf"
- "--drivername=neonsan.csi.qingstor.com"
- "--endpoint=$(CSI_ENDPOINT)"
- "--maxvolume=100"
- "--nodeid=$(NODE_ID)"
- "--v=5"
env:
- name: NODE_ID
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: CSI_ENDPOINT
value: unix://csi/csi.sock
imagePullPolicy: "IfNotPresent"
volumeMounts:
- name: socket-dir
mountPath: /csi
- name: neonsan-config
mountPath: /etc/neonsan
volumes:
- name: socket-dir
emptyDir:
- name: neonsan-config
hostPath:
path: /etc/neonsan
Loading

0 comments on commit 1ddc5ed

Please sign in to comment.