Skip to content
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

优化mysql-cloud.yaml和mysql.yaml #37

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
81 changes: 21 additions & 60 deletions mysql-cloud.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
---
# Source: naftis/templates/namespace.yaml
apiVersion: v1
kind: Namespace
metadata:
name: naftis
---
# Source: mysql/templates/secrets.yaml

apiVersion: v1
kind: Secret
metadata:
Expand All @@ -12,15 +17,10 @@ metadata:
heritage: "Tiller"
type: Opaque
data:

mysql-root-password: "V2xSbmNHaDNVV1k1VlE9PQ=="


mysql-password: "bmFmdGlzSXNBd2Vzb21l"

---
# Source: mysql/templates/initializationFiles-configmap.yaml

apiVersion: v1
kind: ConfigMap
metadata:
Expand Down Expand Up @@ -147,7 +147,6 @@ data:
KEY `idx_cfgs_deleted_at` (`deleted_at`),
KEY `task_tmpl_id` (`task_tmpl_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=147 DEFAULT CHARSET=utf8mb4;

---
# Source: mysql/templates/tests/test-configmap.yaml
apiVersion: v1
Expand All @@ -164,11 +163,23 @@ data:
@test "Testing MySQL Connection" {
mysql --host=naftis-mysql --port=3306 -u root -pWlRncGh3UWY5VQ==
}


---
# Source: mysql/templates/pvc.yaml

kind: PersistentVolume
apiVersion: v1
metadata:
name: naftis-pv
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/data"
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
Expand All @@ -185,7 +196,6 @@ spec:
requests:
storage: "8Gi"
storageClassName: "manual"

---
# Source: mysql/templates/svc.yaml
apiVersion: v1
Expand All @@ -205,52 +215,6 @@ spec:
targetPort: mysql
selector:
app: naftis-mysql

---
# Source: mysql/templates/tests/test.yaml
apiVersion: v1
kind: Pod
metadata:
name: naftis-mysql-test
labels:
app: naftis-mysql
chart: "mysql-0.8.2"
heritage: "Tiller"
release: "naftis"
annotations:
"helm.sh/hook": test-success
spec:
initContainers:
- name: test-framework
image: dduportal/bats:0.4.0
command:
- "bash"
- "-c"
- |
set -ex
# copy bats to tools dir
cp -R /usr/local/libexec/ /tools/bats/
volumeMounts:
- mountPath: /tools
name: tools
containers:
- name: naftis-test
image: "mysql:5.7.14"
command: ["/tools/bats/bats", "-t", "/tests/run.sh"]
volumeMounts:
- mountPath: /tests
name: tests
readOnly: true
- mountPath: /tools
name: tools
volumes:
- name: tests
configMap:
name: naftis-mysql-test
- name: tools
emptyDir: {}
restartPolicy: Never

---
# Source: mysql/templates/deployment.yaml
apiVersion: extensions/v1beta1
Expand Down Expand Up @@ -284,7 +248,6 @@ spec:
requests:
cpu: 100m
memory: 256Mi

env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
Expand Down Expand Up @@ -337,6 +300,4 @@ spec:
- name: data
persistentVolumeClaim:
claimName: naftis-mysql
---
# Source: mysql/templates/configurationFiles-configmap.yaml

115 changes: 4 additions & 111 deletions mysql.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@

---
kind: PersistentVolume
# Source: naftis/templates/namespace.yaml
apiVersion: v1
kind: Namespace
metadata:
name: naftis-pv
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/data"
---


name: naftis
---
# Source: mysql/templates/secrets.yaml

apiVersion: v1
kind: Secret
metadata:
Expand All @@ -31,15 +17,10 @@ metadata:
heritage: "Tiller"
type: Opaque
data:

mysql-root-password: "V2xSbmNHaDNVV1k1VlE9PQ=="


mysql-password: "bmFmdGlzSXNBd2Vzb21l"

---
# Source: mysql/templates/initializationFiles-configmap.yaml

apiVersion: v1
kind: ConfigMap
metadata:
Expand Down Expand Up @@ -167,44 +148,6 @@ data:
KEY `task_tmpl_id` (`task_tmpl_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=147 DEFAULT CHARSET=utf8mb4;

---
# Source: mysql/templates/tests/test-configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: naftis-mysql-test
labels:
app: naftis-mysql
chart: "mysql-0.8.2"
heritage: "Tiller"
release: "naftis"
data:
run.sh: |-
@test "Testing MySQL Connection" {
mysql --host=naftis-mysql --port=3306 -u root -pWlRncGh3UWY5VQ==
}


---
# Source: mysql/templates/pvc.yaml

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: naftis-mysql
labels:
app: naftis-mysql
chart: "mysql-0.8.2"
release: "naftis"
heritage: "Tiller"
spec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: "8Gi"
storageClassName: "manual"

---
# Source: mysql/templates/svc.yaml
apiVersion: v1
Expand All @@ -224,52 +167,6 @@ spec:
targetPort: mysql
selector:
app: naftis-mysql

---
# Source: mysql/templates/tests/test.yaml
apiVersion: v1
kind: Pod
metadata:
name: naftis-mysql-test
labels:
app: naftis-mysql
chart: "mysql-0.8.2"
heritage: "Tiller"
release: "naftis"
annotations:
"helm.sh/hook": test-success
spec:
initContainers:
- name: test-framework
image: dduportal/bats:0.4.0
command:
- "bash"
- "-c"
- |
set -ex
# copy bats to tools dir
cp -R /usr/local/libexec/ /tools/bats/
volumeMounts:
- mountPath: /tools
name: tools
containers:
- name: naftis-test
image: "mysql:5.7.14"
command: ["/tools/bats/bats", "-t", "/tests/run.sh"]
volumeMounts:
- mountPath: /tests
name: tests
readOnly: true
- mountPath: /tools
name: tools
volumes:
- name: tests
configMap:
name: naftis-mysql-test
- name: tools
emptyDir: {}
restartPolicy: Never

---
# Source: mysql/templates/deployment.yaml
apiVersion: extensions/v1beta1
Expand Down Expand Up @@ -303,7 +200,6 @@ spec:
requests:
cpu: 100m
memory: 256Mi

env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
Expand Down Expand Up @@ -354,8 +250,5 @@ spec:
configMap:
name: naftis-mysql-initialization
- name: data
persistentVolumeClaim:
claimName: naftis-mysql
---
# Source: mysql/templates/configurationFiles-configmap.yaml
emptyDir: {}

7 changes: 0 additions & 7 deletions naftis.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
---
# Source: naftis/templates/namespace.yaml
apiVersion: v1
kind: Namespace
metadata:
name: naftis
---
# Source: naftis/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
Expand Down Expand Up @@ -169,7 +163,6 @@ spec:
requests:
cpu: 20m
memory: 32Mi

volumes:
- name: naftis-config
configMap:
Expand Down