Created
December 6, 2021 13:58
-
-
Save inductor/2934e5123f90463a825f8903b2b79dd5 to your computer and use it in GitHub Desktop.
CronJob.yaml
This file contains hidden or 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
apiVersion: batch/v1 | |
kind: CronJob | |
metadata: | |
name: fetch-cfp-info | |
spec: | |
schedule: "*/1 * * * *" | |
jobTemplate: | |
spec: | |
template: | |
spec: | |
containers: | |
- name: hello | |
image: mysql:8.0 | |
command: | |
- mysql -u root -p somedb -e "select * from proposals"; mysql -u root -p somedb -e "insert into proposals VALUES ()" | |
restartPolicy: OnFailure | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: dreamkast-mysql-o11y | |
labels: | |
app: dreamkast-o11y | |
spec: | |
ports: | |
- port: 3306 | |
selector: | |
app: dreamkast | |
tier: mysql | |
clusterIP: None | |
--- | |
apiVersion: v1 | |
kind: PersistentVolumeClaim | |
metadata: | |
name: mysql-o11y-pv-claim | |
labels: | |
app: dreamkast-o11y | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
resources: | |
requests: | |
storage: 5Gi | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: dreamkast-mysql-o11y | |
labels: | |
app: dreamkast-o11y | |
spec: | |
selector: | |
matchLabels: | |
app: dreamkast-o11y | |
tier: mysql | |
strategy: | |
type: Recreate | |
template: | |
metadata: | |
labels: | |
app: dreamkast-o11y | |
tier: mysql | |
spec: | |
containers: | |
- image: mysql:8.0 | |
name: mysql | |
args: | |
- --character-set-server=utf8mb4 | |
- --collation-server=utf8mb4_unicode_ci | |
- --default-authentication-plugin=mysql_native_password | |
env: | |
- name: MYSQL_USER | |
value: user | |
- name: MYSQL_PASSWORD | |
value: password | |
- name: MYSQL_ROOT_PASSWORD | |
value: password | |
- name: MYSQL_DATABASE | |
value: dreamkast | |
ports: | |
- containerPort: 3306 | |
name: mysql | |
volumeMounts: | |
- name: mysql-persistent-storage | |
mountPath: /var/lib/mysql | |
volumes: | |
- name: mysql-persistent-storage | |
persistentVolumeClaim: | |
claimName: mysql-pv-claim |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment