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

Feat/add secret dynamically #172

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion helm_chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The following table lists the configurable parameters of the Permission Manager
| `replicaCount` | | 1 |
| `image.repository` | | "quay.io/sighup/permission-manager" |
| `image.pullPolicy` | | "IfNotPresent" |
| `image.tag` | | "v1.9.0" |
| `image.tag` | | "v1.9.0" |
| `imagePullSecrets` | | [] |
| `nameOverride` | | "" |
| `fullnameOverride` | | "" |
Expand All @@ -36,6 +36,9 @@ The following table lists the configurable parameters of the Permission Manager
| `tolerations` | | [] |
| `affinity` | | {} |
| `config.clusterName` | | "" |
| `secret.exists` | | "false" |
| `secret.name` | | "" |
| `secret.annotations` | | "" |
| `config.controlPlaneAddress` | | "" |
| `config.basicAuthPassword` | | "" |
| `config.templates` | | [{"name": "operation", "rules": [{"apiGroups": ["*"], "resources": ["*"], "verbs": ["*"]}]}, {"name": "developer", "rules": [{"apiGroups": ["*"], "resources": ["configmaps", "endpoints", "persistentvolumeclaims", "pods", "pods/log", "pods/portforward", "podtemplates", "replicationcontrollers", "resourcequotas", "secrets", "services", "events", "daemonsets", "deployments", "replicasets", "ingresses", "networkpolicies", "poddisruptionbudgets"], "verbs": ["*"]}]}] |
6 changes: 6 additions & 0 deletions helm_chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,15 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{ if .Values.secret.exists }}
envFrom:
- secretRef:
name: {{ .Values.secret.name }}
{{ else }}
envFrom:
- secretRef:
name: {{ include "permission-manager.fullname" . }}
{{ end }}
ports:
- name: http
containerPort: 4000
Expand Down
6 changes: 6 additions & 0 deletions helm_chart/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
{{- if not .Values.secret.exists }}
apiVersion: v1
kind: Secret
metadata:
name: {{include "permission-manager.fullname" .}}
labels: {{- include "permission-manager.labels" . | nindent 4}}
{{- with .Values.secret.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
type: Opaque
stringData:
PORT: "4000" # port where server is exposed
CLUSTER_NAME: {{required ".config.clusterName is required. Its value will be used in the generated user kubeconfig to identify the cluster." .Values.config.clusterName}}
CONTROL_PLANE_ADDRESS: {{required ".config.controlPlaneAddress is required. Its value will be used in the generated user kubeconfig as the address of the Kubernetes API server." .Values.config.controlPlaneAddress}}
BASIC_AUTH_PASSWORD: {{required "config.basicAuthPassword is required. Its value will be used as the password to access Permission Manager's UI" .Values.config.basicAuthPassword}}
{{- end }}
7 changes: 7 additions & 0 deletions helm_chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ tolerations: []

affinity: {}

secret:
# If you want to use your own secret, just set "exist" to true and create the secret in the correct namespace.
exist: false
# If the secret exist, set the name below
name: permission-manager
# Annotations to add to the secret
annotations: {}
#
# Application configuration:
config:
Expand Down