-
Notifications
You must be signed in to change notification settings - Fork 7
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
Migration commands need to be run before starting image, api and auth containers #29
Comments
@ToshKoevoets : The migrations are already done during container initialization with the initContainers command. So I think there should be no need for this? |
Migrations need to be run on every update of a container. This doesnt seem to
happen now. Api errors unless I add Migration script. Init-db is only on
creating right?
I don't know what the correct way of doing this, best way to update a container would be one that has an order. What is proposed way of rolling out migrations with helm?
Currenlty im autodeploying the development server via travis with a sh script like this:
#!/bin/bash
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin;
docker push ${DOCKER_PUBLIC_USERNAME}/${DOCKER_IMAGE_NAME}:${TRAVIS_BUILD_ID}
docker tag ${DOCKER_PUBLIC_USERNAME}/${DOCKER_IMAGE_NAME}:${TRAVIS_BUILD_ID} ${DOCKER_PUBLIC_USERNAME}/${DOCKER_IMAGE_NAME}:devel
#for now tag with development in future with specific bracch tags
docker push ${DOCKER_PUBLIC_USERNAME}/${DOCKER_IMAGE_NAME}:devel
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
mkdir ${HOME}/.kube
echo "$KUBE_CONFIG" | base64 --decode > ${HOME}/.kube/config
echo "Deploying: deployment/${K8S_DEPLOYMENT_NAME}"
kubectl set image deployment/${K8S_DEPLOYMENT_NAME} ${K8S_DEPLOYMENT_NAME}=${DOCKER_PUBLIC_USERNAME}/${DOCKER_IMAGE_NAME}:${TRAVIS_BUILD_ID} --record -n ${K8S_NAMESPACE}
echo "Deployed: " ${DOCKER_PUBLIC_USERNAME}/${DOCKER_IMAGE_NAME}:${TRAVIS_BUILD_ID}
…On Mon, 22 Jun 2020, 16:44 diederikgithub, ***@***.***> wrote:
@ToshKoevoets <https://github.com/ToshKoevoets> : The migrations are
already done during container initialization with the initContainers
command. So I think there should be no need for this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/Amsterdam/openstad-kubernetes/issues/29#issuecomment-647563705>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJEFAFQQXS72TVDZHTZX7LRX5U47ANCNFSM4ODYV63Q>
.
|
Updating the image must trigger the initContainers, so I'm not sure what is wrong. Tried it myself with: The change course is recorded (kubectl get deployment openstad-api -o yaml): |
Okay will have to debug then, deploy with travis only started working when I add node migrate.js to the npm start command. |
@ToshKoevoets Did you manage to debug it? |
I've tried adding migrate command in deployment files, but I'm not sure I did it the right way, don't seem to get it working.
I've tried, on k8s/deployment/api.yaml
For dev environment I've solved it for now by adding command to npm start. Not sure what is better.
For api it is done by
For image and auth it is managed with
The text was updated successfully, but these errors were encountered: