Skip to content
New issue

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

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

Already on GitHub? # to your account

Introducing initial helm-chart for version 0.21.5 #344

Merged
merged 2 commits into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
62 changes: 62 additions & 0 deletions helm-charts/0.21.5/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# /*
# | Protect your secrets, protect your sensitive data.
# : Explore VMware Secrets Manager docs at https://vsecm.com/
# </
# <>/ keep your secrets… secret
# >/
# <>/' Copyright 2023–present VMware, Inc.
# >/' SPDX-License-Identifier: BSD-2-Clause
# */

apiVersion: v2
name: vsecm
description: Helm chart for VMware Secrets Manager

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
sources:
- https://github.com/vmware-tanzu/secrets-manager

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.21.5

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.21.5"
home: https://vsecm.com/
# TODO: update icon when available
# icon:
keywords:
- secrets
- kubernetes
- secrets-manager
- spire
- spiffe
- zero-trust
- cloud-native
- edge
- secret-management
- security

dependencies:
- name: spire
repository: file://charts/spire
version: 0.21.5
condition: global.deploySpire
- name: safe
repository: file://charts/safe
version: 0.21.5
- name: sentinel
repository: file://charts/sentinel
version: 0.21.5
47 changes: 47 additions & 0 deletions helm-charts/0.21.5/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# VMware Secrets Manager (VSecM) Helm Chart
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/vsecm)](https://artifacthub.io/packages/helm/vsecm/vsecm)

VMware Secrets Manager keeps your secrets secret. With VSecM, you can rest assured that your sensitive data is always secure and protected. VSecM is perfect for securely storing arbitrary configuration information at a central location and securely dispatching it to workloads.

## Installation

To use VMware Secrets Manager, follow the steps below:

1. Add VMware Secrets Manager Helm repository:

```bash
helm repo add vsecm https://vmware-tanzu.github.io/secrets-manager/
```

2. Update helm repository:

```bash
helm repo update
```

3. Install VMware Secrets Manager using Helm:

```bash
helm install vsecm vsecm/vsecm --version 0.21.4
```

## Options

The following options can be passed to the `helm install` command to set global variables:

- `--set global.deploySpire=<true/false>`: This flag can be passed to install or skip Spire.
- `--set global.baseImage=<distroless/distroless-fips/photon/photos-fips>`: This flag can be passed to install VSecM with the given baseImage Docker image.

Default values are `true` and `distroless` for `global.deploySpire` and `global.baseImage` respectively.

Here's an example command with the above options:

```bash
helm install vsecm vsecm/helm-charts --version 0.21.4 --set global.deploySpire=true --set global.baseImage=distroless
```

Make sure to replace `<true/false>` and `<distroless/distroless-fips/photon/photos-fips>` with the desired values.

## License

This project is licensed under the [BSD 2-Clause License](https://github.com/vmware-tanzu/secrets-manager/blob/main/LICENSE).
23 changes: 23 additions & 0 deletions helm-charts/0.21.5/charts/safe/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
34 changes: 34 additions & 0 deletions helm-charts/0.21.5/charts/safe/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# /*
# | Protect your secrets, protect your sensitive data.
# : Explore VMware Secrets Manager docs at https://vsecm.com/
# </
# <>/ keep your secrets… secret
# >/
# <>/' Copyright 2023–present VMware, Inc.
# >/' SPDX-License-Identifier: BSD-2-Clause
# */

apiVersion: v2
name: safe
description: Helm chart for VMware Secrets Manager (VSecM) Safe

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.21.5

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.21.5"
114 changes: 114 additions & 0 deletions helm-charts/0.21.5/charts/safe/templates/Deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# /*
# | Protect your secrets, protect your sensitive data.
# : Explore VMware Secrets Manager docs at https://vsecm.com/
# </
# <>/ keep your secrets… secret
# >/
# <>/' Copyright 2023–present VMware, Inc.
# >/' SPDX-License-Identifier: BSD-2-Clause
# */

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "safe.fullname" . }}
namespace: {{ .Values.global.vsecm.namespace }}
labels:
{{- include "safe.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "safe.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "safe.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "safe.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: main
image: "{{ .Values.global.registry }}/{{- include "safe.repository" .}}:{{ .Values.global.images.safe.tag }}"
imagePullPolicy: {{ .Values.global.images.safe.pullPolicy }}
ports:
- containerPort: 8443
volumeMounts:
- name: spire-agent-socket
mountPath: /spire-agent-socket
readOnly: true
- name: vsecm-data
mountPath: /data
- name: vsecm-age
mountPath: /key
readOnly: true
#
# You can configure VSecM Safe by providing environment variables.
#
# See https://vsecm.com/configuration for more information about
# these environment variables.
#
# When you don’t explicitly provide env vars here, VSecM Safe
# will assume the default values outlined in the given link above.
#
env:
{{- range .Values.environments }}
- name: {{ .name }}
value: {{ .value | quote }}
{{- end }}
- name: VSECM_SENTINEL_SVID_PREFIX
value: "spiffe://vsecm.com/workload/vsecm-sentinel/ns/{{ .Values.global.vsecm.namespace }}/sa/vsecm-sentinel/n/"
- name: VSECM_SAFE_SVID_PREFIX
value: "spiffe://vsecm.com/workload/vsecm-safe/ns/{{ .Values.global.vsecm.namespace }}/sa/vsecm-safe/n/"
- name: VSECM_PROBE_LIVENESS_PORT
value: ":{{ .Values.livenessPort }}"
- name: VSECM_PROBE_READINESS_PORT
value: ":{{ .Values.readynessPort }}"
- name: VSECM_SYSTEM_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
livenessProbe:
httpGet:
path: /
port: {{ .Values.livenessPort }}
initialDelaySeconds: 1
periodSeconds: 10
readinessProbe:
httpGet:
path: /
port: {{ .Values.readynessPort }}
initialDelaySeconds: 1
periodSeconds: 10
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
# Using SPIFFE CSI Driver to bind to the SPIRE Agent Socket
# ref: https://github.com/spiffe/spiffe-csi
- name: spire-agent-socket
csi:
driver: "csi.spiffe.io"
readOnly: true
# `vsecm-data` is used to persist the encrypted backups of the secrets.
- name: vsecm-data
hostPath:
path: /var/local/vsecm/data
type: DirectoryOrCreate
# `vsecm-age` stores the encryption keys to restore secrets from vsecm-data.
- name: vsecm-age
secret:
secretName: {{ .Values.ageKeySecretName }}
items:
- key: KEY_TXT
path: key.txt
90 changes: 90 additions & 0 deletions helm-charts/0.21.5/charts/safe/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# /*
# | Protect your secrets, protect your sensitive data.
# : Explore VMware Secrets Manager docs at https://vsecm.com/
# </
# <>/ keep your secrets… secret
# >/
# <>/' Copyright 2023–present VMware, Inc.
# >/' SPDX-License-Identifier: BSD-2-Clause
# */

{{/*
Expand the name of the chart.
*/}}
{{- define "safe.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "safe.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "safe.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "safe.labels" -}}
helm.sh/chart: {{ include "safe.chart" . }}
{{ include "safe.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "safe.selectorLabels" -}}
app.kubernetes.io/name: {{ include "safe.fullname" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/part-of: {{ .Values.global.vsecm.namespace }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "safe.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "safe.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Define image for vsecm safe
*/}}
{{- define "safe.repository" -}}
{{- if eq (lower $.Values.global.baseImage) "distroless" }}
{{- .Values.global.images.safe.distrolessRepository }}
{{- else if eq (lower $.Values.global.baseImage) "distroless-fips" }}
{{- .Values.global.images.safe.distrolessFipsRepository }}
{{- else if eq (lower $.Values.global.baseImage) "photon" }}
{{- .Values.global.images.safe.photonRepository }}
{{- else if eq (lower $.Values.global.baseImage) "photon-fips" }}
{{- .Values.global.images.safe.photonFipsRepository }}
{{- else }}
{{- .Values.global.images.safe.distrolessRepository }}
{{- end }}
{{- end }}
Loading