Mysql
score.yaml
(view on GitHub)
:
apiVersion: score.dev/v1b1
metadata:
name: my-workload
containers:
my-container:
image: busybox
command: ["/bin/sh"]
args: ["-c", "while true; do echo $MYSQL_HOST; sleep 5; done"]
variables:
MYSQL_HOST: ${resources.my-mysql.host}
MYSQL_PORT: ${resources.my-mysql.port}
MYSQL_DATABASE: ${resources.my-mysql.database}
MYSQL_USERNAME: ${resources.my-mysql.username}
MYSQL_PASSWORD: ${resources.my-mysql.password}
resources:
my-mysql:
type: mysql
Initialize your local workspace, by using the default provisioners:
score-commpose init
Get the provisioners definition:
score-compose provisioners list
Generate the platform specific manifests:
score-commpose generate score.yaml
See the resource outputs:
score-commpose resources list
You can run the following command on each resource listed with the previous command to get their outputs
:
score-commpose resources get-outputs
Deploy the generated manifests:
docker compose up -d
See the running containers:
docker ps
Initialize your local workspace, by using the default provisioners:
score-k8s init
Get the provisioners definition:
score-k8s provisioners list
Generate the platform specific manifests:
score-k8s generate score.yaml
See the resource outputs:
score-k8s resources list
You can run the following command on each resource listed with the previous command to get their outputs
:
score-k8s resources get-outputs
Deploy the generated manifests:
kubectl apply -f manifests.yaml
See the running containers:
kubectl get all