Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

Federation test #423

Merged
merged 7 commits into from
Aug 22, 2023
Merged

Federation test #423

merged 7 commits into from
Aug 22, 2023

Conversation

drewwells
Copy link
Contributor

@drewwells drewwells commented Aug 4, 2023

The helm tests are very limited. This test will pull the federation keys and verify a minted jwt with them.

@drewwells drewwells force-pushed the federationTest branch 8 times, most recently from aa801fb to b905d08 Compare August 5, 2023 21:41
@drewwells drewwells marked this pull request as ready for review August 6, 2023 04:29
Copy link
Contributor

@kfox1111 kfox1111 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looking pretty good now. Thanks for working on this. Some questions/issues inline.

@kfox1111
Copy link
Contributor

kfox1111 commented Aug 6, 2023

Here's something that seems to work as a base. I've asked for the ability for spire-agent to write to a file directly, so we wouldn't need the busybox thing.

apiVersion: batch/v1
kind: Job
metadata:
  name: test
spec:
  template:
    metadata:
      name: test
    spec:
      restartPolicy: Never
      initContainers:
      - name: static-busybox
        image: busybox:uclibc
        command:
        - sh
        - -c
        - |
          cp /bin/busybox /workdir/busybox
          chmod +x /workdir/busybox
        volumeMounts:
        - name: workdir
          mountPath: /workdir
      - name: gettoken
        image: ghcr.io/spiffe/spire-agent:1.7.1
        command:
        - /workdir/busybox
        - sh
        - -c
        - |
          while true; do
            /opt/spire/bin/spire-agent api fetch jwt -audience foo -format json -socketPath /spire-agent/spire-agent.sock -timeout 5s > /workdir/jwt.json
            [ $? -eq 0 ] && break
            sleep 1
          done
        volumeMounts:
        - name: workdir
          mountPath: /workdir
        - name: spire-api
          mountPath: /spire-agent
          readOnly: true
      containers:
      - name: testtoken
        image: cgr.dev/chainguard/slim-toolkit-debug:5.2.15
        command:
        - /bin/bash
        - -c
        - |
          jq . /workdir/jwt.json
        volumeMounts:
        - name: workdir
          mountPath: /workdir
      volumes:
      - name: spire-api
        csi:
          driver: csi.spiffe.io
          readOnly: true
      - name: workdir
        emptyDir: {}

@faisal-memon faisal-memon added this to the 0.12.0 milestone Aug 8, 2023
@drewwells drewwells marked this pull request as draft August 8, 2023 16:48
@drewwells drewwells marked this pull request as ready for review August 10, 2023 20:06
@drewwells drewwells force-pushed the federationTest branch 3 times, most recently from 6d75141 to d7197b2 Compare August 14, 2023 20:39
@kfox1111
Copy link
Contributor

There a reason to run as root? I would think the pod's identity should work reguardless of which user its using? Thinking this will break on the production example.

@drewwells
Copy link
Contributor Author

There a reason to run as root? I would think the pod's identity should work reguardless of which user its using? Thinking this will break on the production example.

hope not, using some big uids and giving the tests a whirl

@kfox1111 kfox1111 marked this pull request as draft August 14, 2023 20:54
@kfox1111
Copy link
Contributor

Marking draft as there has been ongoing active development for a while. When your ready for more review, please hit the "Ready for review" button

@drewwells
Copy link
Contributor Author

drewwells commented Aug 16, 2023 via email

Signed-off-by: Drew Wells <dwells@infoblox.com>
@drewwells
Copy link
Contributor Author

@kfox1111 Those sha tags are failing, where did you get those

resolve reference "cgr.dev/chainguard/slim-toolkit-debug@sha256:96ab1600d945b4a99c8610b5c8b31e346da63dc20573a26bb0777dd0190db5d4": cgr.dev/chainguard/slim-toolkit-debug@sha256:96ab1600d945b4a99c8610b5c8b31e346da63dc20573a26bb0777dd0190db5d4: not found

@kfox1111
Copy link
Contributor

I was pretty sure I test pulled it. Sorry.

You can get the newest with:

crane digest cgr.dev/chainguard/slim-toolkit-debug:latest

so, this looks to be the newest:

cgr.dev/chainguard/slim-toolkit-debug:latest@sha256:d717d0a2c88518f8e36d9cfe1571639a40617e8c4291e34876d46bdeefb1ab5a

Copy link
Contributor

@marcofranssen marcofranssen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few nitpicks and suggestions, as well some questions.

drewwells and others added 2 commits August 16, 2023 11:28
Signed-off-by: Drew Wells <drew.wells00@gmail.com>
Signed-off-by: Drew Wells <dwells@infoblox.com>
Signed-off-by: Drew Wells <dwells@infoblox.com>
Copy link
Contributor

@kfox1111 kfox1111 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I figured out why the tests are failing. Mentioned inline. Couple of files that don't need changing anymore left and then I'm good with approving this. Its working well :)

@faisal-memon faisal-memon modified the milestones: 0.12.0, 0.12.1 Aug 17, 2023
Co-authored-by: kfox1111 <Kevin.Fox@pnnl.gov>
Signed-off-by: Drew Wells <drew.wells00@gmail.com>
Copy link
Contributor

@kfox1111 kfox1111 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks! :)

Copy link
Contributor

@marcofranssen marcofranssen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@marcofranssen marcofranssen enabled auto-merge (squash) August 22, 2023 18:07
@marcofranssen marcofranssen merged commit cbe0001 into spiffe:main Aug 22, 2023
23 checks passed
marcofranssen added a commit that referenced this pull request Sep 15, 2023
* 38f0af4 Add support for Vault UpstreamAuthority plugin - K8s Auth (#415)
* 1aac2d4 Bump docker/login-action from 2 to 3
* 1f90867 Allow configuration of priorityClassName on spire-server statefulset (#480)
* 9ad2ed5 option to configure agent sds (#479)
* 693ce08 Remove ## values section from chart readms
* 65d5695 Migrate to readme-generator for helm maintained by bitnami (#431)
* dcc60a2 fix(charts/spire/spire-agent): podmonitor templating (#478)
* 48adb88 Bump actions/checkout from 3.6.0 to 4.0.0
* d1f52d6 Bump sigstore/cosign-installer from 3.1.1 to 3.1.2 (#473)
* 5273f4e Switch mysql and postgresql tests to HA Production configs (#471)
* e81a59a ingress-nginx production tests and spiffe-oidc-discovery-provider example (#136)
* b05175e Bump actions/checkout from 3.5.3 to 3.6.0
* 51cba5b Add customPlugins and unsupportedBuiltInPlugins sections to spire-server (#198)
* f4ee2c2 Bump github.com/onsi/ginkgo/v2 from 2.11.0 to 2.12.0 in /tests (#468)
* c817dd2 support datastore password secret created by external resources (#464)
* 71ac5af Split steps in check-versions wf for easier debugging (#467)
* d91403a Scan for updates to new images (#466)
* 7a5456e Bump helm.sh/helm/v3 from 3.11.3 to 3.12.3 in /tests (#462)
* cbe0001 Federation test (#423)

Signed-off-by: Marco Franssen <marco.franssen@gmail.com>
marcofranssen added a commit that referenced this pull request Sep 15, 2023
* 38f0af4 Add support for Vault UpstreamAuthority plugin - K8s Auth (#415)
* 1aac2d4 Bump docker/login-action from 2 to 3
* 1f90867 Allow configuration of priorityClassName on spire-server statefulset (#480)
* 9ad2ed5 option to configure agent sds (#479)
* 693ce08 Remove ## values section from chart readms
* 65d5695 Migrate to readme-generator for helm maintained by bitnami (#431)
* dcc60a2 fix(charts/spire/spire-agent): podmonitor templating (#478)
* 48adb88 Bump actions/checkout from 3.6.0 to 4.0.0
* d1f52d6 Bump sigstore/cosign-installer from 3.1.1 to 3.1.2 (#473)
* 5273f4e Switch mysql and postgresql tests to HA Production configs (#471)
* e81a59a ingress-nginx production tests and spiffe-oidc-discovery-provider example (#136)
* b05175e Bump actions/checkout from 3.5.3 to 3.6.0
* 51cba5b Add customPlugins and unsupportedBuiltInPlugins sections to spire-server (#198)
* f4ee2c2 Bump github.com/onsi/ginkgo/v2 from 2.11.0 to 2.12.0 in /tests (#468)
* c817dd2 support datastore password secret created by external resources (#464)
* 71ac5af Split steps in check-versions wf for easier debugging (#467)
* d91403a Scan for updates to new images (#466)
* 7a5456e Bump helm.sh/helm/v3 from 3.11.3 to 3.12.3 in /tests (#462)
* cbe0001 Federation test (#423)

Signed-off-by: Marco Franssen <marco.franssen@gmail.com>
marcofranssen added a commit that referenced this pull request Sep 15, 2023
* 38f0af4 Add support for Vault UpstreamAuthority plugin - K8s Auth (#415)
* 1aac2d4 Bump docker/login-action from 2 to 3
* 1f90867 Allow configuration of priorityClassName on spire-server statefulset (#480)
* 9ad2ed5 option to configure agent sds (#479)
* 693ce08 Remove ## values section from chart readms
* 65d5695 Migrate to readme-generator for helm maintained by bitnami (#431)
* dcc60a2 fix(charts/spire/spire-agent): podmonitor templating (#478)
* 48adb88 Bump actions/checkout from 3.6.0 to 4.0.0
* d1f52d6 Bump sigstore/cosign-installer from 3.1.1 to 3.1.2 (#473)
* 5273f4e Switch mysql and postgresql tests to HA Production configs (#471)
* e81a59a ingress-nginx production tests and spiffe-oidc-discovery-provider example (#136)
* b05175e Bump actions/checkout from 3.5.3 to 3.6.0
* 51cba5b Add customPlugins and unsupportedBuiltInPlugins sections to spire-server (#198)
* f4ee2c2 Bump github.com/onsi/ginkgo/v2 from 2.11.0 to 2.12.0 in /tests (#468)
* c817dd2 support datastore password secret created by external resources (#464)
* 71ac5af Split steps in check-versions wf for easier debugging (#467)
* d91403a Scan for updates to new images (#466)
* 7a5456e Bump helm.sh/helm/v3 from 3.11.3 to 3.12.3 in /tests (#462)
* cbe0001 Federation test (#423)

Signed-off-by: Marco Franssen <marco.franssen@gmail.com>
marcofranssen added a commit that referenced this pull request Sep 15, 2023
* 38f0af4 Add support for Vault UpstreamAuthority plugin - K8s Auth (#415)
* 1aac2d4 Bump docker/login-action from 2 to 3
* 1f90867 Allow configuration of priorityClassName on spire-server statefulset (#480)
* 9ad2ed5 option to configure agent sds (#479)
* 693ce08 Remove ## values section from chart readms
* 65d5695 Migrate to readme-generator for helm maintained by bitnami (#431)
* dcc60a2 fix(charts/spire/spire-agent): podmonitor templating (#478)
* 48adb88 Bump actions/checkout from 3.6.0 to 4.0.0
* d1f52d6 Bump sigstore/cosign-installer from 3.1.1 to 3.1.2 (#473)
* 5273f4e Switch mysql and postgresql tests to HA Production configs (#471)
* e81a59a ingress-nginx production tests and spiffe-oidc-discovery-provider example (#136)
* b05175e Bump actions/checkout from 3.5.3 to 3.6.0
* 51cba5b Add customPlugins and unsupportedBuiltInPlugins sections to spire-server (#198)
* f4ee2c2 Bump github.com/onsi/ginkgo/v2 from 2.11.0 to 2.12.0 in /tests (#468)
* c817dd2 support datastore password secret created by external resources (#464)
* 71ac5af Split steps in check-versions wf for easier debugging (#467)
* d91403a Scan for updates to new images (#466)
* 7a5456e Bump helm.sh/helm/v3 from 3.11.3 to 3.12.3 in /tests (#462)
* cbe0001 Federation test (#423)

Signed-off-by: Marco Franssen <marco.franssen@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants