When need to apply temporary patches to the CircleCI service to fix issues or update configurations. This guide will show you how to connect to a Kubernetes pod using REPL and make necessary changes.
Prerequisites
-
Access to your Kubernetes cluster.
-
kubectl
installed and configured.
Instructions
Step 1: Confirm the Service Pod
First, make sure you can identify the pod in your CircleCI namespace. This time we are specifying app=frontend
but this will change depending on the service we want to patch. Use the following command to confirm the pod name:
namespace="circleci-server"
kubectl get po -n $namespace -l app=frontend -o jsonpath='{.items[0].metadata.name}'
Step 2: Access pod and run command
Once you have confirm the pod name, you can connect to it using REPL. Execute the following command:
namespace="circleci-server"
kubectl exec "$(kubectl get po -n $namespace -l app=frontend -o jsonpath='{.items[0].metadata.name}')" -i -n $namespace -- lein repl :connect 6005 <<EOD
;; Your code or configuration changes go here
EOD
Replace ;; Your code or configuration changes go here
with the actual code or configuration changes you need to apply.
Important Note
This patch is temporary and will be reset if the service (deployment) is re-rolled. For a permanent solution, wait for the official patch release.
Comments
Article is closed for comments.