|
| 1 | +name: K8s Create Service Mesh |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + inputs: |
| 6 | + concierge-resources-yaml: |
| 7 | + description: "Yaml file describing the resources to deploy for Pinniped Concierge" |
| 8 | + type: string |
| 9 | + required: true |
| 10 | + jwt-authenticator-yaml: |
| 11 | + description: "Yaml file describing the JWT authenticator used by Pinniped Concierge" |
| 12 | + type: string |
| 13 | + required: true |
| 14 | + concierge-http-proxy-yaml: |
| 15 | + description: "Yaml file describing the HTTP Proxy for the Pinniped Concierge imposter URL" |
| 16 | + type: string |
| 17 | + required: true |
| 18 | + concierge-impersonator-url: |
| 19 | + description: "The impersonator URL for the Pinniped Concierge" |
| 20 | + type: string |
| 21 | + required: true |
| 22 | + git-lfs: |
| 23 | + description: "Checkout the project with git lfs" |
| 24 | + type: boolean |
| 25 | + default: false |
| 26 | + workflow_dispatch: |
| 27 | + |
| 28 | +jobs: |
| 29 | + k8s-setup-app: |
| 30 | + runs-on: [self-hosted, docker] |
| 31 | + if: contains('["acpoppe","KlausNie","nasirky"]', github.triggering_actor) |
| 32 | + steps: |
| 33 | + - uses: actions/checkout@v4 |
| 34 | + with: |
| 35 | + lfs: ${{ inputs.git-lfs }} |
| 36 | + - uses: azure/setup-kubectl@v3 |
| 37 | + - uses: azure/k8s-set-context@v3 |
| 38 | + with: |
| 39 | + method: kubeconfig |
| 40 | + kubeconfig: ${{ secrets.KUBE_CONFIG }} |
| 41 | + context: ${{ secrets.KUBE_CONTEXT }} |
| 42 | + - uses: azure/setup-helm@v3 |
| 43 | + with: |
| 44 | + version: "3.13.3" |
| 45 | + |
| 46 | + - name: Helm Install Contour |
| 47 | + run: | |
| 48 | + kubectl apply -f https://projectcontour.io/quickstart/contour.yaml |
| 49 | +
|
| 50 | + - name: Replace unique workload ID (must be unique among clusters) |
| 51 | + uses: richardrigutins/replace-in-files@v2 |
| 52 | + with: |
| 53 | + files: ${{ inputs.jwt-authenticator-yaml }} |
| 54 | + search-text: '<PINNIPED_AUDIENCE>' |
| 55 | + replacement-text: workload-${{ github.run_id }}-${{ github.run_attempt }} |
| 56 | + |
| 57 | + - name: Replace Impersonator URL in resources |
| 58 | + uses: richardrigutins/replace-in-files@v2 |
| 59 | + with: |
| 60 | + files: ${{ inputs.concierge-resources-yaml }} |
| 61 | + search-text: '<PINNIPED_IMPERSONATOR_URL>' |
| 62 | + replacement-text: ${{ inputs.concierge-impersonator-url }} |
| 63 | + |
| 64 | + - name: Replace Impersonator URL in HTTP Proxy |
| 65 | + uses: richardrigutins/replace-in-files@v2 |
| 66 | + with: |
| 67 | + files: ${{ inputs.concierge-http-proxy-yaml }} |
| 68 | + search-text: '<PINNIPED_IMPERSONATOR_URL>' |
| 69 | + replacement-text: ${{ inputs.concierge-impersonator-url }} |
| 70 | + |
| 71 | + - name: Apply Pinniped Concierge CRDs |
| 72 | + run: | |
| 73 | + kubectl apply -f "https://get.pinniped.dev/v0.38.0/install-pinniped-concierge-crds.yaml" |
| 74 | + - name: Sleep to allow creds to apply |
| 75 | + run: | |
| 76 | + sleep 10 |
| 77 | + - name: Apply Pinniped Concierge Resources |
| 78 | + run: | |
| 79 | + kubectl apply -f ${{ inputs.concierge-resources-yaml }} |
| 80 | + - name: Apply Pinniped JWT Authenticator |
| 81 | + run: | |
| 82 | + kubectl apply -f ${{ inputs.jwt-authenticator-yaml }} |
| 83 | + - name: Apply Pinniped Concierge HTTP Proxy |
| 84 | + run: | |
| 85 | + kubectl apply -f ${{ inputs.concierge-http-proxy-yaml }} |
| 86 | +
|
0 commit comments