An action providing kubernetes log tailing.
steps:
# Will tail logs of all pods with name app, labeled with current commit.
# Once "Application started." string is found, will successfully exit.
- name: Tail logs
uses: ironhalik/stern-action@v1
with:
config: ${{ secrets.CONFIG }} # base64 encoded or neat
search-term: app
namespace: my-awesome-app
selector: commit==${{ github.sha }}
until: "Application started."
Supported inputs are:
debugcan be enabled explicitly via action input, or is implicitly enabled when a job is rerun with debug enabled. Will make kubectl and related scripts verbose.configkubectl config file. Can be either a whole config file (e.g. via ${{ secrets.CONFIG }}), or base64 encoded.eks_clusterThe name of the EKS cluster to get config for. Will use AWS CLI to generate a valid config. Will need standardaws-clienv vars and eks:DescribeCluster permission. Mutually exclusive withconfig.contextkubectl config context to use. Not needed if the config has a context already selected.eks_role_arnIAM role ARN that should be assumed byaws-cliwhen interacting with EKS cluster.namespacenamespace to use. You can use env vars here.search-termwhat pods to tail.selectorkubectl selector to use for tailing pods.sincesince when should we tail logs.untilwill stop tailing when it finds the sepcified string.timeouthow long to try tailing for.
Many thanks to the creators of the tools included:
kubectl, helm, stern, aws-cli