Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demos for legacy, mesh and SDK use cases #5

Open
wants to merge 32 commits into
base: main
Choose a base branch
from

Conversation

mattbates
Copy link
Contributor

@mattbates mattbates commented Nov 1, 2024

  • use ko for leaner/secure container builds
  • update Justfile and use dependencies
  • A "legacy" ping-pong server that uses static, long-lived certs (mounted as secrets) for TLS. This will be used in an example to demonstrate cofidectl workload discover (with secret discovery). Depends on feat: Cache CI-built cloud-provider-kind Docker image cofidectl#84.
  • a ping-pong server enhanced with the Cofide SDK for easy-mTLS
  • ping-pong servers report back client and server SPIFFE IDs (to help demonstrate cross-TZ federation in action)

follow-up PR:

  • a ping-pong server for mesh use cases

@mattbates mattbates self-assigned this Nov 1, 2024
Copy link
Contributor

@jsnctl jsnctl left a comment

Choose a reason for hiding this comment

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

just build is failing for me at the moment

kind.local/client-97313deb5607fb51139af2cb3defb0fc:133a86cf38c89c216b3898fdbdbfe7bc48aefa9a2905bd994e5d21f1d354f47a
ko build -L github.com/cofide/cofide-demos/workloads/cofide/server
Error: failed to publish images: importpath "ko://github.com/cofide/cofide-demos/workloads/cofide/server" is not supported: importpath is not `package main`
error: Recipe `build-cofide-ping-pong` failed on line 75 with exit code 1

Justfile Show resolved Hide resolved
Justfile Outdated Show resolved Hide resolved
Justfile Outdated Show resolved Hide resolved
Justfile Outdated Show resolved Hide resolved
Justfile Outdated Show resolved Hide resolved

## Quickstart

### Deploy a single trust zone Cofide instance
Copy link
Contributor

Choose a reason for hiding this comment

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

How do we define a Cofide "instance"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Cofide 'stack' - ie in this local install, SPIRE. I thought instance worked well, especially as it'd also be applicable for when we provides it via SaaS.

# Cofide Demos

This repository has an example `ping-pong` application used to demonstrate Cofide's open source tools, including `cofidectl` and the Cofide Go SDK. The examples include ping-pong in a single Cofide trust-zone, as well as an example of ping-pong federated across trust-zones with multiple clusters.

Copy link
Contributor

Choose a reason for hiding this comment

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

There's probably a bunch more context required here on SPIFFE, mTLS, cofidectl, etc. We can follow up with that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, I'll add some more context. I think we'll likely need extra docs that describe in more detail too.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
workloads/ping-pong-cofide/client/main.go Show resolved Hide resolved
workloads/ping-pong-cofide/server/main.go Show resolved Hide resolved
@jsnctl jsnctl self-requested a review November 5, 2024 16:23
Justfile Outdated
Comment on lines 68 to 81
# Build the legacy ping-pong applications
build-ping-pong:
ko build -L github.com/cofide/cofide-demos/workloads/ping-pong/server
ko build -L github.com/cofide/cofide-demos/workloads/ping-pong/client

# Build the ping-pong applications enhanced with the Cofide SDK
build-cofide-ping-pong:
ko build -L github.com/cofide/cofide-demos/workloads/cofide/server
ko build -L github.com/cofide/cofide-demos/workloads/cofide/client

# Build the ping-pong applications to be deployed in an Istio service mesh
build-ping-pong-mesh:
ko build -L github.com/cofide/cofide-demos/workloads/ping-pong-mesh/server
ko build -L github.com/cofide/cofide-demos/workloads/ping-pong-mesh/client
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks as if these need to be updated to reflect the filesystem (explains the build problems I was having before)

Also seeing this after an inplace adjustment:

Error: failed to publish images: error building "ko://github.com/cofide/cofide-demos/workloads/ping-pong-cofide/server": build: go build: exit status 1: # github.com/cofide/cofide-demos/workloads/ping-pong-cofide/server
workloads/ping-pong-cofide/server/main.go:73:27: server.GetIdentity undefined (type *cofide_http_server.Server has no field or method GetIdentity)

Copy link
Contributor Author

@mattbates mattbates Nov 5, 2024

Choose a reason for hiding this comment

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

It's because it relies on updates in the cofide-go-sdk with the new GetIdentity method:

https://github.com/cofide/cofide-sdk-go/pull/12

@markgoddard
Copy link
Contributor

Don't we have most of this now in the main branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants