Skip to content

Commit

Permalink
SUBMARINE-366. Support submarine link database in k8s
Browse files Browse the repository at this point in the history
### What is this PR for?
We need to make the submarine database run in k8s, and let the submarine server connect to the database.

### What type of PR is it?
[Feature]

### Todos
* [ ] - Task

### What is the Jira issue?
* https://issues.apache.org/jira/browse/SUBMARINE-366

### How should this be tested?
* https://travis-ci.org/liuxunorg/submarine/builds/643813734

### Screenshots (if appropriate)

![image](https://user-images.githubusercontent.com/3677382/73445852-97d9a500-4396-11ea-86be-dbed4bdf0e1d.png)

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Author: Xun Liu <liuxun@apache.org>

Closes #169 from liuxunorg/SUBMARINE-366 and squashes the following commits:

e741833 [Xun Liu] SUBMARINE-366. Support submarine link database in k8s
  • Loading branch information
xunliu committed Jan 30, 2020
1 parent b4c67cd commit 97829b7
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
5 changes: 4 additions & 1 deletion submarine-cloud/hack/kind-cluster-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ esac
done

clusterName=${clusterName:-kind}
nodeNum=${nodeNum:-3}
nodeNum=${nodeNum:-1}
k8sVersion=${k8sVersion:-v1.12.8}
volumeNum=${volumeNum:-1}

Expand Down Expand Up @@ -269,13 +269,16 @@ docker-image <image>' command to load images into nodes.
EOF

# Run submarine in kind cluster
echo ""
echo -n "Do you want to run submarine in kind cluster now? [y/n]"
read myselect
if [[ "$myselect" == "y" || "$myselect" == "Y" ]]; then
docker pull apache/submarine:operator-0.3.0-SNAPSHOT
kind load docker-image apache/submarine:operator-0.3.0-SNAPSHOT
kubectl apply -f $ROOT/manifests/submarine-operator/

docker pull apache/submarine:database-0.3.0-SNAPSHOT
kind load docker-image apache/submarine:database-0.3.0-SNAPSHOT
docker pull apache/submarine:server-0.3.0-SNAPSHOT
kind load docker-image apache/submarine:server-0.3.0-SNAPSHOT
kubectl apply -f $ROOT/manifests/submarine-cluster/
Expand Down
37 changes: 37 additions & 0 deletions submarine-cloud/manifests/submarine-cluster/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,40 @@ spec:
periodSeconds: 10
successThreshold: 1
failureThreshold: 3

---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: submarine-database
spec:
replicas: 1
selector:
matchLabels:
app: submarine-database
template:
metadata:
labels:
app: submarine-database
spec:
containers:
- name: submarine-database
image: apache/submarine:database-0.3.0-SNAPSHOT
ports:
- containerPort: 3306
env:
- name: MYSQL_ROOT_PASSWORD
value: "password" # Same submarine-site.xml mysql password

---
apiVersion: v1
kind: Service
metadata:
name: submarine-database
spec:
ports:
- name: submarine-database
port: 3306
targetPort: 3306
selector:
app: submarine-database

0 comments on commit 97829b7

Please sign in to comment.