vmware-tanzu / tanzu-source-controller

Tanzu Source Controller enables app devs to fetch OCI images and maven artifacts from remote source code repository. The controller follows the spirit of the FluxCD Source Controller.
Apache License 2.0
7 stars 5 forks source link

Enable `HTTPS` for source artifact URL defined in `.status.artifact.url` #4

Open rashedkvm opened 2 years ago

rashedkvm commented 2 years ago

Enable TLS for source artifact download URL

The current implementation of source controller API ImageRepository and MavenArtifact expose the resulting source artifact at a HTTP URL defined in .status.artifact.url. The source artifact URL is not exposed externally and is only available to in-cluster consumers. This feature request requires TLS for the source artifact download endpoint.

Additional context An accepted solution for this Proposal must include the requirements listed below.

Proposal

Here is a mock shape of the fixed name secret

apiVersion: v1
data:
  ca.crt: …
  tls.crt: …
  tls.key: …
kind: Secret
metadata:
  name: source-server-cert
  namespace: source-system
type: kubernetes.io/tls

Here is a mock of the proposed API status

status:
  artifact:                 # existing type `Artifact`
    ...
    url: "http://..."
  secureArtifact:           # New type `SecureArtifact` = `Artifact` + CABundle
    ...
    url: "https://..."
    caBundle: ""

Testing

kvmw commented 2 years ago

PR vmware-tanzu/source-controller#307 has the initial implementation for this feature.

It enables source controller to use either HTTP or HTTPS. the default is HTTP, unless server private key and certificate is provided which enables HTTPS.

rashedkvm commented 2 years ago

PR vmware-tanzu/source-controller#307 has the initial implementation for this feature.

It enables source controller to use either HTTP or HTTPS. the default is HTTP, unless server private key and certificate is provided which enables HTTPS.

@kvmw is this still the design/approach to enable HTTPS?

kvmw commented 2 years ago
kvmw commented 2 years ago

@rashedkvm using cert-manager we have met the following two requirements: