diff --git a/.github/workflows/docker-build-gnupg.yml b/.github/workflows/docker-build-gnupg.yml new file mode 100644 index 0000000..510d7fe --- /dev/null +++ b/.github/workflows/docker-build-gnupg.yml @@ -0,0 +1,53 @@ +name: CI - gnupg +run-name: Build container image with GnuPG suite + +on: + push: + paths: + - 'gnupg/**' + - '.github/workflows/docker-build-gnupg.yml' + branches: + - 'gnupg' + tags: + - '0.*' + - '1.*' + +permissions: + actions: read + checks: read + contents: read + packages: write + repository-projects: read + statuses: read + +jobs: + + build_image: + runs-on: ubuntu-22.04 + env: + {} + steps: + - uses: actions/checkout@v3 + - uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - uses: docker/metadata-action@v4 + id: meta + with: + images: | + ghcr.io/eosc-lot-1/gnupg + - uses: docker/setup-buildx-action@v3 + with: + driver: docker + - uses: docker/build-push-action@v5 + with: + context: ./gnupg/docker/ + file: ./gnupg/docker/Dockerfile + #buildArgs: |- + push: true + tags: | + ghcr.io/eosc-lot-1/gnupg:2-debian + labels: ${{ steps.meta.outputs.labels }} + diff --git a/gnupg/Chart.yaml b/gnupg/Chart.yaml new file mode 100644 index 0000000..d22cd09 --- /dev/null +++ b/gnupg/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: gnupg +description: A Helm chart for GnuPG command + +# 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.0.1 + +# 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: "2" diff --git a/gnupg/docker/Dockerfile b/gnupg/docker/Dockerfile new file mode 100644 index 0000000..ad9865d --- /dev/null +++ b/gnupg/docker/Dockerfile @@ -0,0 +1,3 @@ +FROM debian:12.5-slim + +RUN apt-get update && apt-get install -y gnupg diff --git a/gnupg/templates/NOTES.txt b/gnupg/templates/NOTES.txt new file mode 100644 index 0000000..e69de29 diff --git a/gnupg/templates/_helpers.tpl b/gnupg/templates/_helpers.tpl new file mode 100644 index 0000000..19d3d16 --- /dev/null +++ b/gnupg/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "gnupg.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 "gnupg.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 "gnupg.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "gnupg.labels" -}} +helm.sh/chart: {{ include "gnupg.chart" . }} +{{ include "gnupg.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "gnupg.selectorLabels" -}} +app.kubernetes.io/name: {{ include "gnupg.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "gnupg.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "gnupg.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/gnupg/templates/deploy.yml b/gnupg/templates/deploy.yml new file mode 100644 index 0000000..758ba92 --- /dev/null +++ b/gnupg/templates/deploy.yml @@ -0,0 +1,49 @@ +# vim: set syntax=helm: + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "gnupg.fullname" . }} + labels: + {{- include "gnupg.labels" . | nindent 4 }} +spec: + replicas: 1 + selector: + matchLabels: + {{- include "gnupg.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "gnupg.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "gnupg.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + terminationGracePeriodSeconds: 8 + volumes: + - name: temp + emptyDir: {} + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + command: ['sh'] + stdin: true + volumeMounts: + - name: temp + mountPath: /tmp diff --git a/gnupg/templates/serviceaccount.yaml b/gnupg/templates/serviceaccount.yaml new file mode 100644 index 0000000..d50cab5 --- /dev/null +++ b/gnupg/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "gnupg.serviceAccountName" . }} + labels: + {{- include "gnupg.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/gnupg/values.yaml b/gnupg/values.yaml new file mode 100644 index 0000000..c78c996 --- /dev/null +++ b/gnupg/values.yaml @@ -0,0 +1,36 @@ +image: + repository: gnupg + pullPolicy: IfNotPresent + tag: "0.0.1" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +nodeSelector: {} + +tolerations: [] + +affinity: {}