-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #303 from ByteStorage/cloud-feature
Cloud feature
- Loading branch information
Showing
8 changed files
with
135 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
build-image: | ||
@echo "Building docker image..." | ||
hack/build-docker-image.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM ubuntu:18.04 | ||
|
||
WORKDIR /app | ||
|
||
COPY bin/flydb-server /app/flydb-server | ||
|
||
RUN chmod +x /app/flydb-server | ||
|
||
CMD ["/app/flydb-server"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
DOCKER_USERNAME="${DOCKER_USERNAME:-bytestorage}" | ||
IMAGE_NAME="${IMAGE_NAME:-flydb}" | ||
TAG="${TAG:-latest}" | ||
|
||
# check docker command | ||
if ! [ -x "$(command -v docker)" ]; then | ||
echo "Docker is not installed" | ||
exit 1 | ||
fi | ||
|
||
# check go command | ||
if ! [ -x "$(command -v go)" ]; then | ||
echo "Go is not installed" | ||
exit 1 | ||
fi | ||
|
||
if [ -z "$IMAGE_NAME" ] || [ -z "$TAG" ]; then | ||
echo "Please set DOCKER_USERNAME, IMAGE_NAME and TAG environment variables" | ||
exit 1 | ||
fi | ||
|
||
go build -o bin/flydb-server cmd/server/cli/flydb-server.go | ||
|
||
echo "IMAGE_NAME: $IMAGE_NAME" | ||
echo "TAG: $TAG" | ||
|
||
# build docker image | ||
docker build -t "$DOCKER_USERNAME/$IMAGE_NAME:$TAG" -f docker/Dockerfile . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: flydb-deployment | ||
namespace: flydb-system | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: flydb | ||
template: | ||
metadata: | ||
labels: | ||
app: flydb | ||
spec: | ||
containers: | ||
- name: flydb-container | ||
image: bytestorage/flydb:v1.0 | ||
imagePullPolicy: IfNotPresent | ||
ports: | ||
- containerPort: 8999 | ||
hostPort: 8999 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: flydb-system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: flydb-service | ||
namespace: flydb-system | ||
spec: | ||
selector: | ||
app: flydb | ||
ports: | ||
- protocol: TCP | ||
port: 8999 | ||
targetPort: 8999 | ||
type: NodePort |