Skip to content

Commit

Permalink
Merge pull request #107 from port-labs/port-agent-add-self-signed-cer…
Browse files Browse the repository at this point in the history
…t-secret

added self signed certificate support for port-agent
  • Loading branch information
stavbernazport authored May 19, 2024
2 parents e81355d + 31ae33b commit 1c102ae
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/port-agent/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: port-agent
description: A Helm chart for Port Agent
type: application
version: 0.7.11
version: 0.7.12
appVersion: "v0.7.0"
home: https://getport.io/
sources:
Expand Down
9 changes: 7 additions & 2 deletions charts/port-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,13 @@ The following table lists the configuration parameters of the `port-agent` chart
| `nodeSelector` | NodeSelector applied to the pod | `{}` |
| `tolerations` | Tolerations applied to the pod | `[]` |
| `affinity` | Affinity applied to the pod | `{}` |
| `selfSignedCertificate.enabled` | Enable self-signed certificate trust for the integration. | `false` |
| `selfSignedCertificate.certificate` | The value of the self-signed certificate (only when `selfSignedCertificate.enabled=true`) | `""` |
| `selfSignedCertificate` | Self Signed certificate for the agent | `{}` |
| `selfSignedCertificate.enabled` | Enable self-signed certificate trust for the agent | `false` |
| `selfSignedCertificate.certificate` | The value of the self-signed certificate (only when `selfSignedCertificate.enabled=true`) | `""` |
| `selfSignedCertificate.secret` | Secret with self-signed certificate | `{}` |
| `selfSignedCertificate.secret.useExistingSecret` | Enable this if you wish to use your own secret with the self-signed certificate | `false` |
| `selfSignedCertificate.secret.key` | The key in the existing self-signed certificate secret | `crt` |
| `selfSignedCertificate.secret.name` | The name of an existing secret containing the self-signed certificate | `""` |

To override values in `helm install`, use either the `--set` flag or the `--set-file` flag to set individual values from
a file.
Expand Down
2 changes: 1 addition & 1 deletion charts/port-agent/templates/certificate_secret.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.selfSignedCertificate.enabled }}
{{- if and .Values.selfSignedCertificate.enabled (not .Values.selfSignedCertificate.secret.useExistingSecret) }}
apiVersion: v1
kind: Secret
metadata:
Expand Down
11 changes: 10 additions & 1 deletion charts/port-agent/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,16 @@ spec:
configMap:
name: {{ include "port-agent.fullname" . }}
{{- end }}
{{- if .Values.selfSignedCertificate.enabled }}
{{- if and .Values.selfSignedCertificate.enabled .Values.selfSignedCertificate.secret.useExistingSecret }}
- name: certificates
projected:
sources:
- secret:
name: {{ .Values.selfSignedCertificate.secret.name }}
items:
- key: {{ .Values.selfSignedCertificate.secret.key }}
path: cert.crt
{{- else if .Values.selfSignedCertificate.enabled }}
- name: certificates
projected:
sources:
Expand Down
4 changes: 4 additions & 0 deletions charts/port-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,7 @@ affinity: {}
selfSignedCertificate:
enabled: false
certificate: ""
secret:
name: ""
key: crt
useExistingSecret: false

0 comments on commit 1c102ae

Please sign in to comment.