IBM_CLOUD_USERNAME=...
IBM_CLOUD_PASSWORD=...
ibmcloud login -r jp-tok -u ${IBM_CLOUD_USERNAME} -p ${IBM_CLOUD_PASSWORD} -g Default
ibmcloud ce project create --name blog
ibmcloud ce project select --name blog
Set DATABASE_URL
according to your environment as follows.
If you don't have an accessible PostgreSQL instance, please refer to this documentation.
ibmcloud ce secret create --name blog-db --from-literal DATABASE_URL="postgres://username:[email protected]/blog"
ibmcloud ce app create \
--name blog-api \
-e spring.application.name="\${CE_SUBDOMAIN}:\${CE_APP}" \
-e logging.level.io.opentelemetry.exporter.zipkin.ZipkinSpanExporter="ERROR" \
--env-from-secret blog-db \
--image ghcr.io/categolj/blog-api:native \
--memory 1G \
--cpu 0.5
ibmcloud ce project select --name blog
export KUBECONFIG=$(ibmcloud ce project current --output jsonpath='{.kube_config_file}')
Set DATABASE_URL
according to your environment as follows.
If you don't have an accessible PostgreSQL instance, please refer to this documentation.
kubectl create secret generic blog-db --from-literal DATABASE_URL="postgres://username:[email protected]/blog" --dry-run=client -oyaml | kubectl apply -f-
kubectl apply -f https://github.com/categolj/blog-api/raw/main/deploy/k8s/kservice.yaml