feat(memcached): add memcached App (#1307)
This commit is contained in:
@@ -0,0 +1,24 @@
|
|||||||
|
# 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
|
||||||
|
*~
|
||||||
|
# Various IDEs
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
||||||
|
.vscode/
|
||||||
|
# OWNERS file for Kubernetes
|
||||||
|
OWNERS
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
apiVersion: v2
|
||||||
|
appVersion: "14.0.0"
|
||||||
|
dependencies:
|
||||||
|
- name: common
|
||||||
|
repository: https://truecharts.org
|
||||||
|
version: 8.5.4
|
||||||
|
deprecated: false
|
||||||
|
description: Memcached is a memory-backed database caching solution
|
||||||
|
home: https://github.com/truecharts/apps/tree/master/stable/memcached
|
||||||
|
icon: https://bitnami.com/assets/stacks/memcached/img/memcached-stack-220x234.png
|
||||||
|
keywords:
|
||||||
|
- memcached
|
||||||
|
- database
|
||||||
|
- cache
|
||||||
|
kubeVersion: '>=1.16.0-0'
|
||||||
|
maintainers:
|
||||||
|
- email: info@truecharts.org
|
||||||
|
name: TrueCharts
|
||||||
|
url: truecharts.org
|
||||||
|
name: memcached
|
||||||
|
sources:
|
||||||
|
- https://github.com/bitnami/bitnami-docker-memcached
|
||||||
|
- http://memcached.org/
|
||||||
|
type: application
|
||||||
|
version: 0.0.1
|
||||||
|
annotations:
|
||||||
|
truecharts.org/catagories: |
|
||||||
|
- database
|
||||||
|
- cache
|
||||||
|
truecharts.org/SCALE-support: "true"
|
||||||
|
truecharts.org/grade: U
|
||||||
@@ -0,0 +1,270 @@
|
|||||||
|
# Include{groups}
|
||||||
|
questions:
|
||||||
|
- variable: portal
|
||||||
|
group: "Container Image"
|
||||||
|
label: "Configure Portal Button"
|
||||||
|
schema:
|
||||||
|
type: dict
|
||||||
|
hidden: true
|
||||||
|
attrs:
|
||||||
|
- variable: enabled
|
||||||
|
label: "Enable"
|
||||||
|
description: "enable the portal button"
|
||||||
|
schema:
|
||||||
|
hidden: true
|
||||||
|
editable: false
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
# Include{global}
|
||||||
|
- variable: controller
|
||||||
|
group: "Controller"
|
||||||
|
label: ""
|
||||||
|
schema:
|
||||||
|
type: dict
|
||||||
|
attrs:
|
||||||
|
- variable: advanced
|
||||||
|
label: "Show Advanced Controller Settings"
|
||||||
|
schema:
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
show_subquestions_if: true
|
||||||
|
subquestions:
|
||||||
|
- variable: type
|
||||||
|
description: "Please specify type of workload to deploy"
|
||||||
|
label: "(Advanced) Controller Type"
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
default: "deployment"
|
||||||
|
required: true
|
||||||
|
enum:
|
||||||
|
- value: "deployment"
|
||||||
|
description: "Deployment"
|
||||||
|
- value: "statefulset"
|
||||||
|
description: "Statefulset"
|
||||||
|
- value: "daemonset"
|
||||||
|
description: "Daemonset"
|
||||||
|
- variable: replicas
|
||||||
|
description: "Number of desired pod replicas"
|
||||||
|
label: "Desired Replicas"
|
||||||
|
schema:
|
||||||
|
type: int
|
||||||
|
default: 1
|
||||||
|
required: true
|
||||||
|
- variable: strategy
|
||||||
|
description: "Please specify type of workload to deploy"
|
||||||
|
label: "(Advanced) Update Strategy"
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
default: "Recreate"
|
||||||
|
required: true
|
||||||
|
enum:
|
||||||
|
- value: "Recreate"
|
||||||
|
description: "Recreate: Kill existing pods before creating new ones"
|
||||||
|
- value: "RollingUpdate"
|
||||||
|
description: "RollingUpdate: Create new pods and then kill old ones"
|
||||||
|
- value: "OnDelete"
|
||||||
|
description: "(Legacy) OnDelete: ignore .spec.template changes"
|
||||||
|
# Include{controllerExpert}
|
||||||
|
|
||||||
|
- variable: env
|
||||||
|
group: "Container Configuration"
|
||||||
|
label: "Image Environment"
|
||||||
|
schema:
|
||||||
|
type: dict
|
||||||
|
attrs:
|
||||||
|
# Include{fixedEnv}
|
||||||
|
|
||||||
|
# Include{containerConfig}
|
||||||
|
|
||||||
|
- variable: postgresqlDatabase
|
||||||
|
group: "App Configuration"
|
||||||
|
label: "Database Name"
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
default: "mydatabase"
|
||||||
|
required: true
|
||||||
|
- variable: postgresqlUsername
|
||||||
|
group: "App Configuration"
|
||||||
|
label: "Database User"
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
default: "mydatabaseuser"
|
||||||
|
required: true
|
||||||
|
- variable: postgresqlPassword
|
||||||
|
group: "App Configuration"
|
||||||
|
label: "Database Password"
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
default: ""
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- variable: service
|
||||||
|
group: "Networking and Services"
|
||||||
|
label: "Configure Service(s)"
|
||||||
|
schema:
|
||||||
|
type: dict
|
||||||
|
attrs:
|
||||||
|
- variable: main
|
||||||
|
label: "Main Service"
|
||||||
|
description: "The Primary service on which the healthcheck runs, often the webUI"
|
||||||
|
schema:
|
||||||
|
type: dict
|
||||||
|
attrs:
|
||||||
|
# Include{serviceSelector}
|
||||||
|
- variable: main
|
||||||
|
label: "Main Service Port Configuration"
|
||||||
|
schema:
|
||||||
|
type: dict
|
||||||
|
attrs:
|
||||||
|
- variable: advanced
|
||||||
|
label: "Show Advanced settings"
|
||||||
|
schema:
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
show_subquestions_if: true
|
||||||
|
subquestions:
|
||||||
|
- variable: protocol
|
||||||
|
label: "Port Type"
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
default: "TCP"
|
||||||
|
enum:
|
||||||
|
- value: HTTP
|
||||||
|
description: "HTTP"
|
||||||
|
- value: "HTTPS"
|
||||||
|
description: "HTTPS"
|
||||||
|
- value: TCP
|
||||||
|
description: "TCP"
|
||||||
|
- value: "UDP"
|
||||||
|
description: "UDP"
|
||||||
|
- variable: nodePort
|
||||||
|
label: "Node Port (Optional)"
|
||||||
|
description: "This port gets exposed to the node. Only considered when service type is NodePort, Simple or LoadBalancer"
|
||||||
|
schema:
|
||||||
|
type: int
|
||||||
|
min: 9000
|
||||||
|
max: 65535
|
||||||
|
- variable: targetPort
|
||||||
|
label: "Target Port"
|
||||||
|
description: "The internal(!) port on the container the Application runs on"
|
||||||
|
schema:
|
||||||
|
type: int
|
||||||
|
default: 11211
|
||||||
|
|
||||||
|
- variable: port
|
||||||
|
label: "Container Port"
|
||||||
|
schema:
|
||||||
|
type: int
|
||||||
|
default: 11211
|
||||||
|
editable: true
|
||||||
|
required: true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- variable: serviceexpert
|
||||||
|
group: "Networking and Services"
|
||||||
|
label: "Show Expert Config"
|
||||||
|
schema:
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
show_subquestions_if: true
|
||||||
|
subquestions:
|
||||||
|
- variable: hostNetwork
|
||||||
|
group: "Networking and Services"
|
||||||
|
label: "Host-Networking (Complicated)"
|
||||||
|
schema:
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
|
# Include{serviceExpert}
|
||||||
|
|
||||||
|
# Include{serviceList}
|
||||||
|
|
||||||
|
# Include{persistenceList}
|
||||||
|
|
||||||
|
# Include{ingressList}
|
||||||
|
|
||||||
|
- variable: advancedSecurity
|
||||||
|
label: "Show Advanced Security Settings"
|
||||||
|
group: "Security and Permissions"
|
||||||
|
schema:
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
show_subquestions_if: true
|
||||||
|
subquestions:
|
||||||
|
- variable: securityContext
|
||||||
|
label: "Security Context"
|
||||||
|
schema:
|
||||||
|
type: dict
|
||||||
|
attrs:
|
||||||
|
- variable: privileged
|
||||||
|
label: "Privileged mode"
|
||||||
|
schema:
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
- variable: readOnlyRootFilesystem
|
||||||
|
label: "ReadOnly Root Filesystem"
|
||||||
|
schema:
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
- variable: allowPrivilegeEscalation
|
||||||
|
label: "Allow Privilege Escalation"
|
||||||
|
schema:
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
- variable: runAsNonRoot
|
||||||
|
label: "runAsNonRoot"
|
||||||
|
schema:
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
|
||||||
|
- variable: podSecurityContext
|
||||||
|
group: "Security and Permissions"
|
||||||
|
label: "Pod Security Context"
|
||||||
|
schema:
|
||||||
|
type: dict
|
||||||
|
attrs:
|
||||||
|
- variable: runAsUser
|
||||||
|
label: "runAsUser"
|
||||||
|
description: "The UserID of the user running the application"
|
||||||
|
schema:
|
||||||
|
type: int
|
||||||
|
default: 568
|
||||||
|
- variable: runAsGroup
|
||||||
|
label: "runAsGroup"
|
||||||
|
description: The groupID this App of the user running the application"
|
||||||
|
schema:
|
||||||
|
type: int
|
||||||
|
default: 568
|
||||||
|
- variable: fsGroup
|
||||||
|
label: "fsGroup"
|
||||||
|
description: "The group that should own ALL storage."
|
||||||
|
schema:
|
||||||
|
type: int
|
||||||
|
default: 568
|
||||||
|
- variable: supplementalGroups
|
||||||
|
label: "supplemental Groups"
|
||||||
|
schema:
|
||||||
|
type: list
|
||||||
|
default: []
|
||||||
|
items:
|
||||||
|
- variable: supplementalGroupsEntry
|
||||||
|
label: "supplemental Group"
|
||||||
|
schema:
|
||||||
|
type: int
|
||||||
|
- variable: fsGroupChangePolicy
|
||||||
|
label: "When should we take ownership?"
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
default: "OnRootMismatch"
|
||||||
|
enum:
|
||||||
|
- value: "OnRootMismatch"
|
||||||
|
description: "OnRootMismatch"
|
||||||
|
- value: "Always"
|
||||||
|
description: "Always"
|
||||||
|
|
||||||
|
# Include{resources}
|
||||||
|
|
||||||
|
# Include{advanced}
|
||||||
|
|
||||||
|
# Include{addons}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: "postgres-backup-hook-config-map"
|
||||||
|
annotations:
|
||||||
|
rollme: {{ randAlphaNum 5 | quote }}
|
||||||
|
data:
|
||||||
|
entrypoint.sh: |-
|
||||||
|
#!/bin/sh
|
||||||
|
cmd="/docker-entrypoint.sh postgres"
|
||||||
|
eval "${cmd}" & disown;
|
||||||
|
until pg_isready; do
|
||||||
|
sleep 5;
|
||||||
|
done;
|
||||||
|
pg_dump -U {{ .Values.postgresqlUser }} -d {{ .Values.postgresqlDatabase }} > /dbbackups/$BACKUP_NAME;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
{{ include "common.all" . }}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
labels:
|
||||||
|
{{- include "common.labels" . | nindent 4 }}
|
||||||
|
annotations:
|
||||||
|
{{- with .Values.annotations }}
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
postgresql-password: {{ ( .Values.postgresqlPassword | default "empty" ) | b64enc | quote }}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
{{- if and ( .Values.enableUpgradeBackup ) ( .Values.ixChartContext ) -}}
|
||||||
|
{{- if .Values.ixChartContext.isUpgrade -}}
|
||||||
|
{{- $upgradeDict := .Values.ixChartContext.upgradeMetadata -}}
|
||||||
|
{{ $values := (. | mustDeepCopy) }}
|
||||||
|
---
|
||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: "pre-upgrade-hook2"
|
||||||
|
annotations:
|
||||||
|
"helm.sh/hook": pre-upgrade
|
||||||
|
"helm.sh/hook-weight": "1"
|
||||||
|
"helm.sh/hook-delete-policy": hook-succeeded
|
||||||
|
rollme: {{ randAlphaNum 5 | quote }}
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
name: "pre-upgrade-hook2"
|
||||||
|
spec:
|
||||||
|
restartPolicy: Never
|
||||||
|
containers:
|
||||||
|
- name: {{ .Chart.Name }}-postgres-backup
|
||||||
|
image: {{ printf "%v:%v" .Values.image.repository .Values.image.tag}}
|
||||||
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
|
env:
|
||||||
|
- name: BACKUP_NAME
|
||||||
|
value: {{- printf "postgres-backup-from-%s-to-%s-revision-%d" $upgradeDict.oldChartVersion $upgradeDict.newChartVersion (int64 $upgradeDict.preUpgradeRevision) -}}
|
||||||
|
- name: POSTGRES_USER
|
||||||
|
value: {{ .Values.postgresqlUsername | quote }}
|
||||||
|
- name: POSTGRES_DB
|
||||||
|
value: {{ .Values.postgresqlDatabase | quote }}
|
||||||
|
- name: POSTGRES_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ ( .Values.existingSecret | default ( include "common.names.fullname" . ) ) | quote }}
|
||||||
|
key: "postgresql-password"
|
||||||
|
command:
|
||||||
|
- "/bin/backup_entrypoint.sh"
|
||||||
|
volumeMounts:
|
||||||
|
- name: backup-script-configmap
|
||||||
|
mountPath: /bin/backup_entrypoint.sh
|
||||||
|
readOnly: true
|
||||||
|
subPath: entrypoint.sh
|
||||||
|
{{- with (include "common.controller.volumeMounts" . | trim) }}
|
||||||
|
{{ nindent 4 . }}
|
||||||
|
{{- end }}
|
||||||
|
volumes:
|
||||||
|
- name: backup-script-configmap
|
||||||
|
configMap:
|
||||||
|
defaultMode: 0700
|
||||||
|
name: "postgres-backup-hook-config-map"
|
||||||
|
{{- with (include "common.controller.volumes" . | trim) }}
|
||||||
|
{{- nindent 2 . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
image:
|
||||||
|
repository: bitnami/memcached
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
tag: 1.6.12@sha256:f02e8e24e90ce1e3ce132964bea7a9af70d1e13510d8c1c8a6e66c2fed1f4621
|
||||||
|
|
||||||
|
service:
|
||||||
|
main:
|
||||||
|
ports:
|
||||||
|
main:
|
||||||
|
port: 11211
|
||||||
|
targetPort: 11211
|
||||||
Reference in New Issue
Block a user