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 #21 from schemahero/mysql
Support for mysql tables
- Loading branch information
Showing
104 changed files
with
9,602 additions
and
807 deletions.
There are no files selected for viewing
File renamed without changes.
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,17 @@ | ||
# Build the manager binary | ||
FROM golang:1.10.3 as builder | ||
|
||
# Copy in the go src | ||
WORKDIR /go/src/github.com/schemahero/schemahero | ||
COPY pkg/ pkg/ | ||
COPY cmd/ cmd/ | ||
COPY vendor/ vendor/ | ||
|
||
# Build | ||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o schemahero github.com/schemahero/schemahero/cmd/schemahero | ||
|
||
# Copy schemahero into a thin image | ||
FROM ubuntu:latest | ||
WORKDIR / | ||
COPY --from=builder /go/src/github.com/schemahero/schemahero/schemahero . | ||
ENTRYPOINT ["/schemahero"] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,90 @@ | ||
|
||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: mysql | ||
labels: | ||
app: mysql | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- name: mysql | ||
port: 3306 | ||
targetPort: mysql | ||
selector: | ||
app: mysql | ||
--- | ||
apiVersion: apps/v1beta1 | ||
kind: StatefulSet | ||
metadata: | ||
name: mysql | ||
spec: | ||
serviceName: mysql | ||
template: | ||
metadata: | ||
labels: | ||
app: mysql | ||
spec: | ||
initContainers: | ||
- name: "remove-lost-found" | ||
image: "busybox:1.25.0" | ||
imagePullPolicy: IfNotPresent | ||
command: ["rm", "-fr", "/var/lib/mysql/lost+found"] | ||
volumeMounts: | ||
- name: schemahero-testdb-mysql | ||
mountPath: /var/lib/mysql | ||
containers: | ||
- name: mysql | ||
image: mysql:5.6 | ||
imagePullPolicy: IfNotPresent | ||
env: | ||
- name: MYSQL_ROOT_PASSWORD | ||
value: password | ||
- name: MYSQL_ROOT_HOST | ||
value: '%' | ||
- name: MYSQL_DATABASE | ||
value: testdb | ||
- name: MYSQL_USER | ||
value: testuser | ||
- name: MYSQL_PASSWORD | ||
value: password | ||
|
||
ports: | ||
- name: mysql | ||
containerPort: 3306 | ||
livenessProbe: | ||
exec: | ||
command: | ||
- sh | ||
- -c | ||
- mysqladmin ping -u root -p${MYSQL_ROOT_PASSWORD} | ||
initialDelaySeconds: 30 | ||
timeoutSeconds: 5 | ||
failureThreshold: 3 | ||
readinessProbe: | ||
exec: | ||
command: | ||
- sh | ||
- -c | ||
- mysqladmin ping -u root -p${MYSQL_ROOT_PASSWORD} | ||
initialDelaySeconds: 5 | ||
timeoutSeconds: 1 | ||
periodSeconds: 10 | ||
volumeMounts: | ||
- name: schemahero-testdb-mysql | ||
mountPath: /var/lib/mysql | ||
|
||
volumes: | ||
- name: schemahero-testdb-mysql | ||
persistentVolumeClaim: | ||
claimName: schemahero-testdb-mysql | ||
|
||
volumeClaimTemplates: | ||
- metadata: | ||
name: schemahero-testdb-mysql | ||
spec: | ||
accessModes: | ||
- "ReadWriteOnce" | ||
resources: | ||
requests: | ||
storage: 1Gi |
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,12 @@ | ||
apiVersion: databases.schemahero.io/v1alpha1 | ||
kind: Database | ||
metadata: | ||
labels: | ||
controller-tools.k8s.io: "1.0" | ||
name: testdb | ||
schemahero: | ||
image: "localhost:32000/schemahero/schemahero" | ||
connection: | ||
mysql: | ||
uri: | ||
value: testuser:password@tcp(mysql:3306)/testdb?tls=false |
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
Oops, something went wrong.