Skip to content

Commit

Permalink
Postgres to helm (rackerlabs#589)
Browse files Browse the repository at this point in the history
* WIP

* Conversion and bugs

Postgres-operator is now deployed with helm. Also Fixed a bug with memcached and set permissions for 2 bin files and corrected a bug in bootstrap.sh

* fix whitespace

* Update bootstrap.sh

* Update memcached-helm-overrides.yaml
  • Loading branch information
aedan authored and mnaghavi committed Dec 9, 2024
1 parent d29e564 commit 028dd9b
Show file tree
Hide file tree
Showing 7 changed files with 704 additions and 526 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@
[submodule "submodules/nginx-gateway-fabric"]
path = submodules/nginx-gateway-fabric
url = https://github.com/nginxinc/nginx-gateway-fabric.git
[submodule "submodules/postgres-operator"]
path = submodules/postgres-operator
url = https://github.com/zalando/postgres-operator.git
172 changes: 141 additions & 31 deletions base-helm-configs/memcached/memcached-helm-overrides.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
## @param global.storageClass Global StorageClass for Persistent Volume(s)
##
global:
imageRegistry: marketplace.azurecr.io
imageRegistry: ""
## E.g.
## imagePullSecrets:
## - myRegistryKeySecretName
Expand Down Expand Up @@ -39,7 +39,6 @@ commonLabels: {}
## @param commonAnnotations Add annotations to all the deployed resources
##
commonAnnotations: {}

## Enable diagnostic mode in the deployment/statefulset
##
diagnosticMode:
Expand All @@ -54,7 +53,6 @@ diagnosticMode:
##
args:
- infinity

## @section Memcached parameters

## Bitnami Memcached image version
Expand All @@ -70,7 +68,7 @@ diagnosticMode:
image:
registry: docker.io
repository: bitnami/memcached
tag: 1.6.17-debian-11-r15
tag: 1.6.32-debian-12-r0
digest: ""
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
Expand Down Expand Up @@ -132,7 +130,6 @@ extraEnvVarsCM: ""
## @param extraEnvVarsSecret Name of existing Secret containing extra env vars for Memcached nodes
##
extraEnvVarsSecret: ""

## @section Deployment/Statefulset parameters

## @param replicaCount Number of Memcached nodes
Expand Down Expand Up @@ -212,21 +209,46 @@ resources:
## Configure Pods Security Context
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
## @param podSecurityContext.enabled Enabled Memcached pods' Security Context
## @param podSecurityContext.fsGroupChangePolicy Set filesystem group change policy
## @param podSecurityContext.sysctls Set kernel settings using the sysctl interface
## @param podSecurityContext.supplementalGroups Set filesystem extra groups
## @param podSecurityContext.fsGroup Set Memcached pod's Security Context fsGroup
##
podSecurityContext:
enabled: true
fsGroupChangePolicy: Always
sysctls: []
supplementalGroups: []
fsGroup: 1001
## Configure Container Security Context
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container
## @param containerSecurityContext.enabled Enabled Memcached containers' Security Context
## @param containerSecurityContext.runAsUser Set Memcached containers' Security Context runAsUser
## @param containerSecurityContext.runAsNonRoot Set Memcached containers' Security Context runAsNonRoot
## @param containerSecurityContext.enabled Enabled containers' Security Context
## @param containerSecurityContext.seLinuxOptions [object,nullable] Set SELinux options in container
## @param containerSecurityContext.runAsUser Set containers' Security Context runAsUser
## @param containerSecurityContext.runAsGroup Set containers' Security Context runAsGroup
## @param containerSecurityContext.runAsNonRoot Set container's Security Context runAsNonRoot
## @param containerSecurityContext.privileged Set container's Security Context privileged
## @param containerSecurityContext.readOnlyRootFilesystem Set container's Security Context readOnlyRootFilesystem
## @param containerSecurityContext.allowPrivilegeEscalation Set container's Security Context allowPrivilegeEscalation
## @param containerSecurityContext.capabilities.drop List of capabilities to be dropped
## @param containerSecurityContext.seccompProfile.type Set container's Security Context seccomp profile
##
containerSecurityContext:
enabled: true
seLinuxOptions: {}
runAsUser: 1001
runAsGroup: 1001
runAsNonRoot: true
privileged: false
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
seccompProfile:
type: "RuntimeDefault"
## @param automountServiceAccountToken Mount Service Account token in pod
##
automountServiceAccountToken: false
## @param hostAliases Add deployment host aliases
## https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/
##
Expand Down Expand Up @@ -280,7 +302,7 @@ affinity:
values:
- worker
## @param nodeSelector Node labels for pod assignment
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/
##
nodeSelector: {}
## @param tolerations Tolerations for pod assignment
Expand Down Expand Up @@ -314,6 +336,10 @@ terminationGracePeriodSeconds: ""
updateStrategy:
type: RollingUpdate
rollingUpdate: {}
## @param emptyDir.medium Override emptyDir Volume type, defaults to emptyDir: {}
## Possible values: "Memory", ""
emptyDir:
medium: ""
## @param extraVolumes Optionally specify extra list of additional volumes for the Memcached pod(s)
## Example Use Case: mount certificates to enable TLS
## e.g:
Expand Down Expand Up @@ -362,6 +388,11 @@ sidecars: []
## containerPort: 1234
##
initContainers: []
## @param enableServiceLinks Whether information about services should be injected into pod's environment variable
## The environment variables injected by service links are not used, but can lead to slow boot times or slow running of the scripts when there are many services in the current namespace.
## If you experience slow pod startups or slow running of the scripts you probably want to set this to `false`.
##
enableServiceLinks: true
## Memcached Autoscaling
## @param autoscaling.enabled Enable memcached statefulset autoscaling (requires architecture: "high-availability")
## @param autoscaling.minReplicas memcached statefulset autoscaling minimum number of replicas
Expand All @@ -387,7 +418,6 @@ pdb:
maxUnavailable: 1

## @section Traffic Exposure parameters

service:
## @param service.type Kubernetes Service type
##
Expand All @@ -404,9 +434,9 @@ service:
memcached: ""
## @param service.sessionAffinity Control where client requests go, to the same pod or round-robin
## Values: ClientIP or None
## ref: https://kubernetes.io/docs/user-guide/services/
## ref: https://kubernetes.io/docs/concepts/services-networking/service/
##
sessionAffinity: None
sessionAffinity: ""
## @param service.sessionAffinityConfig Additional settings for the sessionAffinity
## sessionAffinityConfig:
## clientIP:
Expand All @@ -419,7 +449,7 @@ service:
##
clusterIP: ""
## @param service.loadBalancerIP Memcached service Load Balancer IP
## ref: https://kubernetes.io/docs/user-guide/services/#type-loadbalancer
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-loadbalancer
##
loadBalancerIP: ""
## @param service.loadBalancerSourceRanges Memcached service Load Balancer sources
Expand All @@ -439,7 +469,69 @@ service:
## @param service.extraPorts Extra ports to expose in the Memcached service (normally used with the `sidecar` value)
##
extraPorts: []

## Network Policy configuration
## ref: https://kubernetes.io/docs/concepts/services-networking/network-policies/
##
networkPolicy:
## @param networkPolicy.enabled Enable creation of NetworkPolicy resources
##
enabled: true
## @param networkPolicy.allowExternal The Policy model to apply
## When set to false, only pods with the correct client label will have network access to the ports Memcached is
## listening on. When true, Memcached will accept connections from any source (with the correct destination port).
##
allowExternal: true
## @param networkPolicy.allowExternalEgress Allow the pod to access any range of port and all destinations.
##
allowExternalEgress: true
## @param networkPolicy.addExternalClientAccess Allow access from pods with client label set to "true". Ignored if `networkPolicy.allowExternal` is true.
##
addExternalClientAccess: true
## @param networkPolicy.extraIngress [array] Add extra ingress rules to the NetworkPolicy
## e.g:
## extraIngress:
## - ports:
## - port: 1234
## from:
## - podSelector:
## - matchLabels:
## - role: frontend
## - podSelector:
## - matchExpressions:
## - key: role
## operator: In
## values:
## - frontend
##
extraIngress: []
## @param networkPolicy.extraEgress [array] Add extra ingress rules to the NetworkPolicy
## e.g:
## extraEgress:
## - ports:
## - port: 1234
## to:
## - podSelector:
## - matchLabels:
## - role: frontend
## - podSelector:
## - matchExpressions:
## - key: role
## operator: In
## values:
## - frontend
##
extraEgress: []
## @param networkPolicy.ingressPodMatchLabels [object] Labels to match to allow traffic from other pods. Ignored if `networkPolicy.allowExternal` is true.
## e.g:
## ingressPodMatchLabels:
## my-client: "true"
#
ingressPodMatchLabels: {}
## @param networkPolicy.ingressNSMatchLabels [object] Labels to match to allow traffic from other namespaces. Ignored if `networkPolicy.allowExternal` is true.
## @param networkPolicy.ingressNSPodMatchLabels [object] Pod labels to match to allow traffic from other namespaces. Ignored if `networkPolicy.allowExternal` is true.
##
ingressNSMatchLabels: {}
ingressNSPodMatchLabels: {}
## @section Other Parameters

## Service account for Memcached to use.
Expand All @@ -460,11 +552,10 @@ serviceAccount:
## @param serviceAccount.annotations Additional custom annotations for the ServiceAccount
##
annotations: {}

## @section Persistence parameters

## Enable persistence using Persistent Volume Claims
## ref: https://kubernetes.io/docs/user-guide/persistent-volumes/
## ref: https://kubernetes.io/docs/concepts/storage/persistent-volumes/
##
persistence:
## @param persistence.enabled Enable Memcached data persistence using PVC. If false, use emptyDir
Expand All @@ -488,6 +579,9 @@ persistence:
## @param persistence.annotations Annotations for the PVC
##
annotations: {}
## @param persistence.labels Labels for the PVC
##
labels: {}
## @param persistence.selector Selector to match an existing Persistent Volume for Memcached's data PVC
## If set, the PVC can't have a PV dynamically provisioned for it
## E.g.
Expand All @@ -496,7 +590,6 @@ persistence:
## app: my-app
##
selector: {}

## @section Volume Permissions parameters
##

Expand All @@ -507,17 +600,17 @@ volumePermissions:
## @param volumePermissions.enabled Enable init container that changes the owner and group of the persistent volume
##
enabled: false
## @param volumePermissions.image.registry Init container volume-permissions image registry
## @param volumePermissions.image.repository Init container volume-permissions image repository
## @param volumePermissions.image.tag Init container volume-permissions image tag (immutable tags are recommended)
## @param volumePermissions.image.registry [default: REGISTRY_NAME] Init container volume-permissions image registry
## @param volumePermissions.image.repository [default: REPOSITORY_NAME/os-shell] Init container volume-permissions image repository
## @skip volumePermissions.image.tag Init container volume-permissions image tag (immutable tags are recommended)
## @param volumePermissions.image.digest Init container volume-permissions image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag
## @param volumePermissions.image.pullPolicy Init container volume-permissions image pull policy
## @param volumePermissions.image.pullSecrets Init container volume-permissions image pull secrets
##
image:
registry: docker.io
repository: bitnami/bitnami-shell
tag: 11-debian-11-r40
repository: bitnami/os-shell
tag: 12-debian-12-r31
digest: ""
pullPolicy: IfNotPresent
## Optionally specify an array of imagePullSecrets.
Expand All @@ -539,11 +632,12 @@ volumePermissions:
## Init container' Security Context
## Note: the chown of the data folder is done to containerSecurityContext.runAsUser
## and not the below volumePermissions.containerSecurityContext.runAsUser
## @param volumePermissions.containerSecurityContext.seLinuxOptions [object,nullable] Set SELinux options in container
## @param volumePermissions.containerSecurityContext.runAsUser User ID for the init container
##
containerSecurityContext:
seLinuxOptions: {}
runAsUser: 0

## Prometheus Exporter / Metrics
##
metrics:
Expand All @@ -552,17 +646,17 @@ metrics:
enabled: false
## Bitnami Memcached Prometheus Exporter image
## ref: https://hub.docker.com/r/bitnami/memcached-exporter/tags/
## @param metrics.image.registry Memcached exporter image registry
## @param metrics.image.repository Memcached exporter image repository
## @param metrics.image.tag Memcached exporter image tag (immutable tags are recommended)
## @param metrics.image.registry [default: REGISTRY_NAME] Memcached exporter image registry
## @param metrics.image.repository [default: REPOSITORY_NAME/memcached-exporter] Memcached exporter image repository
## @skip metrics.image.tag Memcached exporter image tag (immutable tags are recommended)
## @param metrics.image.digest Memcached exporter image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag
## @param metrics.image.pullPolicy Image pull policy
## @param metrics.image.pullSecrets Specify docker-registry secret names as an array
##
image:
registry: docker.io
repository: bitnami/memcached-exporter
tag: 0.10.0-debian-11-r42
tag: 0.14.4-debian-12-r9
digest: ""
pullPolicy: IfNotPresent
## Optionally specify an array of imagePullSecrets.
Expand All @@ -587,14 +681,30 @@ metrics:
requests: {}
## Configure Metrics Container Security Context
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container
## @param metrics.containerSecurityContext.enabled Enabled Metrics containers' Security Context
## @param metrics.containerSecurityContext.runAsUser Set Metrics containers' Security Context runAsUser
## @param metrics.containerSecurityContext.runAsNonRoot Set Metrics containers' Security Context runAsNonRoot
## @param metrics.containerSecurityContext.enabled Enabled containers' Security Context
## @param metrics.containerSecurityContext.seLinuxOptions [object,nullable] Set SELinux options in container
## @param metrics.containerSecurityContext.runAsUser Set containers' Security Context runAsUser
## @param metrics.containerSecurityContext.runAsGroup Set containers' Security Context runAsGroup
## @param metrics.containerSecurityContext.runAsNonRoot Set container's Security Context runAsNonRoot
## @param metrics.containerSecurityContext.privileged Set container's Security Context privileged
## @param metrics.containerSecurityContext.readOnlyRootFilesystem Set container's Security Context readOnlyRootFilesystem
## @param metrics.containerSecurityContext.allowPrivilegeEscalation Set container's Security Context allowPrivilegeEscalation
## @param metrics.containerSecurityContext.capabilities.drop List of capabilities to be dropped
## @param metrics.containerSecurityContext.seccompProfile.type Set container's Security Context seccomp profile
##
containerSecurityContext:
enabled: true
seLinuxOptions: {}
runAsUser: 1001
runAsGroup: 1001
runAsNonRoot: true
privileged: false
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
seccompProfile:
type: "RuntimeDefault"
## Configure extra options for Memcached Prometheus exporter containers' liveness, readiness and startup probes
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes
## @param metrics.livenessProbe.enabled Enable livenessProbe on Memcached Prometheus exporter containers
Expand Down Expand Up @@ -667,7 +777,7 @@ metrics:
clusterIP: ""
## @param metrics.service.sessionAffinity Control where client requests go, to the same pod or round-robin
## Values: ClientIP or None
## ref: https://kubernetes.io/docs/user-guide/services/
## ref: https://kubernetes.io/docs/concepts/services-networking/service/
##
sessionAffinity: None
## @param metrics.service.annotations [object] Annotations for the Prometheus metrics service
Expand Down
Loading

0 comments on commit 028dd9b

Please sign in to comment.