You've already forked athens-proxy-charts
feat(certificates): support certificates
The following patch enables you to generate certificates using cert-manager or, alternatively, to mount a secret with TLS certificates. The HTTP server is then automatically configured to use the TLS certificates to encrypt HTTP traffic. If an ingress controller is also used, such as the nginx-ingress controller, the necessary annotations must still be set to inform the nginx-ingress controller that the HTTP upstream server communicates via HTTPS.
This commit is contained in:
73
unittests/deployment/certificate.yaml
Normal file
73
unittests/deployment/certificate.yaml
Normal file
@@ -0,0 +1,73 @@
|
||||
chart:
|
||||
appVersion: 0.1.0
|
||||
version: 0.1.0
|
||||
suite: Deployment template
|
||||
release:
|
||||
name: athens-proxy-unittest
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/configMapDownloadMode.yaml
|
||||
- templates/configMapGitConfig.yaml
|
||||
- templates/deployment.yaml
|
||||
- templates/secretNetRC.yaml
|
||||
- templates/secretSSH.yaml
|
||||
tests:
|
||||
- it: Rendering default without tls config
|
||||
asserts:
|
||||
- notContains:
|
||||
path: spec.template.spec.containers[0].env
|
||||
content:
|
||||
name: ATHENS_TLSCERT_FILE
|
||||
value: /etc/athens-proxy/tls/tls.crt
|
||||
template: templates/deployment.yaml
|
||||
- notContains:
|
||||
path: spec.template.spec.containers[0].env
|
||||
content:
|
||||
name: ATHENS_TLSKEY_FILE
|
||||
value: /etc/athens-proxy/tls/tls.key
|
||||
template: templates/deployment.yaml
|
||||
- notContains:
|
||||
path: spec.template.spec.containers[0].volumeMounts
|
||||
content:
|
||||
name: tls
|
||||
mountPath: /etc/athens-proxy/tls
|
||||
template: templates/deployment.yaml
|
||||
- notContains:
|
||||
path: spec.template.spec.volumes
|
||||
content:
|
||||
name: tls
|
||||
secretRef:
|
||||
name: athens-proxy-unittest-tls
|
||||
template: templates/deployment.yaml
|
||||
|
||||
- it: Rendering with tls config
|
||||
set:
|
||||
certificate.enabled: true
|
||||
certificate.new.issuerRef.kind: ClusterIssuer
|
||||
certificate.new.issuerRef.name: MyIssuer
|
||||
asserts:
|
||||
- contains:
|
||||
path: spec.template.spec.containers[0].env
|
||||
content:
|
||||
name: ATHENS_TLSCERT_FILE
|
||||
value: /etc/athens-proxy/tls/tls.crt
|
||||
template: templates/deployment.yaml
|
||||
- contains:
|
||||
path: spec.template.spec.containers[0].env
|
||||
content:
|
||||
name: ATHENS_TLSKEY_FILE
|
||||
value: /etc/athens-proxy/tls/tls.key
|
||||
template: templates/deployment.yaml
|
||||
- contains:
|
||||
path: spec.template.spec.containers[0].volumeMounts
|
||||
content:
|
||||
name: tls
|
||||
mountPath: /etc/athens-proxy/tls
|
||||
template: templates/deployment.yaml
|
||||
- contains:
|
||||
path: spec.template.spec.volumes
|
||||
content:
|
||||
name: tls
|
||||
secret:
|
||||
secretName: athens-proxy-unittest-tls
|
||||
template: templates/deployment.yaml
|
||||
Reference in New Issue
Block a user