Merge pull request #1 from honestbee/support_multi_container_deployments

Support multi-container deployments
This commit is contained in:
Vincent De Smet 2017-03-07 17:08:33 +07:00 committed by GitHub
commit 8a5e33151c
2 changed files with 19 additions and 4 deletions

View File

@ -14,7 +14,7 @@ This pipeline will update the `my-deployment` deployment with the image tagged `
container: my-container container: my-container
tag: ${DRONE_COMMIT_SHA:8} tag: ${DRONE_COMMIT_SHA:8}
Deploying several new containers, eg in a scheduler-worker setup. Make sure your container `name` in your manifest is the same for each pod. Deploying containers across several deployments, eg in a scheduler-worker setup. Make sure your container `name` in your manifest is the same for each pod.
pipeline: pipeline:
deploy: deploy:
@ -24,6 +24,18 @@ Deploying several new containers, eg in a scheduler-worker setup. Make sure your
container: my-container container: my-container
tag: ${DRONE_COMMIT_SHA:8} tag: ${DRONE_COMMIT_SHA:8}
Deploying multiple containers within the same deployment.
pipeline:
deploy:
image: quay.io/honestbee/drone-kubernetes
deployment: my-deployment
repo: myorg/myrepo
container: [container1, container2]
tag: ${DRONE_COMMIT_SHA:8}
**NOTE**: Combining multi container deployments across multiple deployments is not recommended
This more complex example demonstrates how to deploy to several environments based on the branch, in a `app` namespace This more complex example demonstrates how to deploy to several environments based on the branch, in a `app` namespace
pipeline: pipeline:

View File

@ -29,9 +29,12 @@ kubectl config set-context default --cluster=default --user=default
kubectl config use-context default kubectl config use-context default
# kubectl version # kubectl version
IFS=',' read -r -a DEPLOYMENTS <<< "$PLUGIN_DEPLOYMENT" IFS=',' read -r -a DEPLOYMENTS <<< "${PLUGIN_DEPLOYMENT}"
IFS=',' read -r -a CONTAINERS <<< "${PLUGIN_CONTAINER}"
for DEPLOY in ${DEPLOYMENTS[@]}; do for DEPLOY in ${DEPLOYMENTS[@]}; do
echo Deploying to $KUBERNETES_SERVER echo Deploying to $KUBERNETES_SERVER
for CONTAINER in ${CONTAINERS[@]}; do
kubectl -n ${PLUGIN_NAMESPACE} set image deployment/${DEPLOY} \ kubectl -n ${PLUGIN_NAMESPACE} set image deployment/${DEPLOY} \
${PLUGIN_CONTAINER}=${PLUGIN_REPO}:${PLUGIN_TAG} ${CONTAINER}=${PLUGIN_REPO}:${PLUGIN_TAG}
done
done done