Manual deployment/rollback
This document is relevant if ArgoCD is down for some reason and you MUST deploy to staging or production.
The CI pipeline is independent of ArgoCD, so the part that builds your application, generates the deployment configurations (aka. manifests/yamls) and commits them into the GitOps repository is not affected by ArgoCD outage. However, the pipeline will fail, since the last step that tells ArgoCD to deploy the new version of your app will not succeed. That said, the configuration is in the GitOps repo, you just have to deploy it manually, if it’s urgent.
The methods described on this page are not recommended. If there is no ongoing incident that you can only fix by deploying a new version, please wait for ArgoCD to be restored.
Using this method, the pre/post-deploy commands will not be run in the expected order, but the pods executing them will be deployed together with all other resources. If the particular version you’re planning to deploy this way has an important pre/post deploy step (ex. a new migration to the DB has to be run before deploying the new version) please find the detailed guide for that case here.
Use the below guide if that is not the case.
- Go to the emartech/gap-applications.git repository.
- Either clone it to your local machine or browse online, navigate to your application folder:
<your namespace/team name>/<application-name>/<environment(stage/prod)>(ex.cloud-platform/gap-docs/stage). - Confirm that last commit is the one you want to deploy.
- If you’re browsing online, save the
manifest.yamlfile to your local machine. - Make sure your kubectl context points to the right cluster. If unsure, use
kubectl config current-context
- Deploy the manifest bundle to the cluster:
kubectl apply -f ./manifests.yaml -n <your-namespace>
- Use
k9s(or your favourite k8s tool) to observe the rollout of your deployments (ink9suse:deployand wait until all deployments have replaced their replicas with the new version).
- Get your
manifests.yamlfile following steps 1-4 of the guide above and open it in a code editor. - Find the pre-deploy pod: search for
hookName: pre-deployand cut the whole pod object (between---) from themanifests.yamlfile. - Create a new file with the name
pre-deploy.yamland paste the pod’s code into it. - Do the same with post-deploy if you have one, just look for the
hookName: post-deploylabel and name the filepost-deploy.yaml. - Make sure your kubectl context points to the right cluster. If unsure, use
kubectl config current-context
- Deploy the pre-deploy pod:
kubectl apply -f pre-deploy.yaml -n <your-namespace>
- Wait until the pod finishes execution:
kubectl wait --for=condition=Completed pod/<application-name>-pre-deploy -n <your-namespace>
(or use k9s -> :pod -> /pre-deploy and wait until the status is Completed).
- Deploy the
manifests.yamlto the cluster:
kubectl apply -f ./manifests.yaml -n <your-namespace>
- Use
k9s(or your favourite k8s tool) to observe the rollout of your deployments (ink9suse:deployand wait until all deployments have replaced their replicas to the new version). - If you have post-deploy, repeat the steps 6-7 with
post-deploy.yaml.
- Go to the emartech/gap-applications.git repository and clone it to your local machine.
- Check out your applicaton’s branch:
git checkout <your-namespace>-<your-application-name> # ex. cloud-platform-gap-docs
- Use
git logto find the commit you want to rollback to (ex.895cd7be0f35ef19bab858cdfdfb5969860f15d8) - Check out that commit:
git checkout 895cd7be0f35ef19bab858cdfdfb5969860f15d8
- Navigate to your application folder:
<your namespace/team name>/<application-name>/<environment(stage/prod)>(ex.cloud-platform/gap-docs/stage). - Make sure your kubectl context points to the right cluster. If unsure, use
kubectl config current-context
- Deploy the manifest bundle to the cluster:
kubectl apply -f ./manifests.yaml -n <your-namespace>
- Use
k9s(or your favourite k8s tool) to observe the rollout of your deployments (ink9suse:deployand wait until all deployments have replaced their replicas to the new version).
- Follow the simple-guide steps 1-5 and open the
manifests.yamlfile in your editor. - Find the pre-deploy pod: search for
hookName: pre-deployand cut it from themanifests.yamlfile. - Create a new file with the name
pre-deploy.yamland paste the pod’s code into it. - Do the same with post-deploy if you have one, just look for the
hookName: post-deploylabel and name the filepost-deploy.yaml. - Make sure your kubectl context points to the right cluster. If unsure, use
kubectl config current-context
- Deploy the pre-deploy pod:
kubectl apply -f pre-deploy.yaml -n <your-namespace>
- Wait until the pod finishes execution:
kubectl wait --for=condition=Completed pod/<application-name>-pre-deploy -n <your-namespace>
(or use k9s -> :pod -> /pre-deploy and wait until the status is Completed).
- Deploy the
manifests.yamlto the cluster:
kubectl apply -f ./manifests.yaml -n <your-namespace>
- Use
k9s(or your favourite k8s tool) to observe the rollout of your deployments (ink9suse:deployand wait until all deployments have replaced their replicas to the new version). - If you have post-deploy, repeat the steps 6-7 with
post-deploy.yaml.