CronClean Latitude Namespaces #4059
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-License-Identifier: Apache-2.0 | |
| name: "CronClean Latitude Namespaces" | |
| permissions: | |
| contents: read | |
| id-token: write | |
| on: | |
| schedule: | |
| - cron: "0 * * * *" | |
| workflow_dispatch: | |
| jobs: | |
| performance-tests-start: | |
| runs-on: hl-cn-default-lin-sm | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1 | |
| with: | |
| egress-policy: audit | |
| - name: Check out code | |
| uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | |
| - name: Install KubeCtl | |
| uses: step-security/setup-kubectl@2edbf6aff97d814e9dc52827498ac51fe972e6d0 # v4.0.0 | |
| - name: Install Teleport Client | |
| uses: teleport-actions/setup@176c25dfcd19cd31a252f275d579822b243e7b9c # v1.0.6 | |
| with: | |
| version: 18.4.0 | |
| - name: Authorize Teleport SSH Access | |
| id: auth-ssh | |
| uses: teleport-actions/auth@685adaf480dc79262a99220eb158a92136d5abd9 # v2.0.3 | |
| with: | |
| proxy: hashgraph.teleport.sh:443 | |
| token: gh-citr-performance-svcs-bot | |
| certificate-ttl: 24h | |
| - name: Authorize Teleport K8S Access to Dallas Cluster | |
| id: auth-k8s-dal | |
| uses: teleport-actions/auth-k8s@677da98eaa78a5e649d4c5b4012750af4c28af73 # v2.0.3 | |
| with: | |
| proxy: hashgraph.teleport.sh:443 | |
| token: gh-citr-performance-svcs-bot | |
| kubernetes-cluster: k8s.pft.dal.lat.ope.eng.hashgraph.io | |
| certificate-ttl: 24h | |
| - name: List SSH Resources | |
| run: tsh -i "${{ steps.auth-ssh.outputs.identity-file }}" ls | |
| - name: Call clean Dal | |
| run: | | |
| set +e | |
| set +x | |
| for namespace in `kubectl get namespaces | awk '{print $1}' | grep -E 'solo[\-].*[\-]n[0-9]'` | |
| do | |
| echo "Cleaning ${namespace}" | |
| sh "${GITHUB_WORKSPACE}"/.github/workflows/support/citr/cronClean.sh ${namespace} | |
| done | |
| exit 0 | |
| - name: Authorize Teleport K8S Access to Chicago Cluster | |
| id: auth-k8s-chi | |
| uses: teleport-actions/auth-k8s@677da98eaa78a5e649d4c5b4012750af4c28af73 # v2.0.3 | |
| with: | |
| proxy: hashgraph.teleport.sh:443 | |
| token: gh-citr-performance-svcs-bot | |
| kubernetes-cluster: k8s.pft.chi.lat.ope.eng.hashgraph.io | |
| certificate-ttl: 24h | |
| - name: Call clean Chi | |
| run: | | |
| set +e | |
| set +x | |
| for namespace in `kubectl get namespaces | awk '{print $1}' | grep -E 'solo[\-].*[\-]n[0-9]'` | |
| do | |
| echo "Cleaning ${namespace}" | |
| sh "${GITHUB_WORKSPACE}"/.github/workflows/support/citr/cronClean.sh ${namespace} | |
| done | |
| exit 0 |