Initial infrastructure as code deployment
This commit includes the complete Kubernetes infrastructure deployment for NGE6: - Crossplane setup with providers (Kubernetes, Helm, Civo) - Ambassador/Emissary ingress controller with SSL termination - Cert-manager with Let's Encrypt and Gandi webhook for DNS01 challenges - ExternalDNS integration with Gandi for automatic DNS management - Keycloak authentication server with PostgreSQL - Pomerium identity-aware proxy with OIDC integration - Forgejo Git server with persistent storage and authentication - Spire/SPIFFE for secure service communication All services are deployed using Infrastructure as Code principles with Crossplane managing Kubernetes and Helm resources declaratively. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
commit
d770504fa5
151 changed files with 14951 additions and 0 deletions
32
.gitignore
vendored
Normal file
32
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# Terraform
|
||||
.terraform/
|
||||
.terraform.lock.hcl
|
||||
terraform.tfstate*
|
||||
*.tfplan
|
||||
|
||||
# Temporary files
|
||||
*~
|
||||
.#*
|
||||
*.tmp
|
||||
*.backup
|
||||
*.bak
|
||||
|
||||
# Secrets and sensitive files
|
||||
token.txt
|
||||
cookies.txt
|
||||
*.key
|
||||
*.pem
|
||||
|
||||
# IDE and editor files
|
||||
.vscode/
|
||||
.idea/
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
|
||||
# OS files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Local Claude settings
|
||||
.claude/settings.local.json
|
||||
40
acme-challenge-ingress.yaml
Normal file
40
acme-challenge-ingress.yaml
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: acme-challenge-ingress
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: acme-challenge
|
||||
namespace: pomerium
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: ambassador
|
||||
nginx.ingress.kubernetes.io/rewrite-target: /
|
||||
spec:
|
||||
rules:
|
||||
- host: authenticate.nge6.com
|
||||
http:
|
||||
paths:
|
||||
- path: /.well-known/acme-challenge
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: cm-acme-http-solver-2cljl
|
||||
port:
|
||||
number: 8089
|
||||
- host: keycloak.nge6.com
|
||||
http:
|
||||
paths:
|
||||
- path: /.well-known/acme-challenge
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: cm-acme-http-solver-f2t87
|
||||
port:
|
||||
number: 8089
|
||||
44
auth/composite.yaml
Normal file
44
auth/composite.yaml
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
apiVersion: apiextensions.crossplane.io/v1
|
||||
kind: CompositeResourceDefinition
|
||||
metadata:
|
||||
name: keycloakidentities.auth.yourdomain.com
|
||||
spec:
|
||||
group: auth.yourdomain.com
|
||||
names:
|
||||
kind: KeycloakIdentity
|
||||
plural: keycloakidentities
|
||||
claimNames:
|
||||
kind: KeycloakIdentityClaim
|
||||
plural: keycloakidentityclaims
|
||||
versions:
|
||||
- name: v1alpha1
|
||||
served: true
|
||||
referenceable: true
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
type: object
|
||||
properties:
|
||||
spec:
|
||||
type: object
|
||||
properties:
|
||||
realmName:
|
||||
type: string
|
||||
description: "Name of the Keycloak realm"
|
||||
adminUsername:
|
||||
type: string
|
||||
description: "Username for the admin user"
|
||||
adminEmail:
|
||||
type: string
|
||||
description: "Email for the admin user"
|
||||
adminPassword:
|
||||
type: string
|
||||
description: "Password for the admin user"
|
||||
pomeriumRedirectUri:
|
||||
type: string
|
||||
description: "OAuth callback URL for Pomerium"
|
||||
default: "https://authenticate.yourdomain.com/oauth2/callback"
|
||||
required:
|
||||
- realmName
|
||||
- adminUsername
|
||||
- adminEmail
|
||||
- adminPassword
|
||||
7
auth/keycloak-provider-install.yaml
Normal file
7
auth/keycloak-provider-install.yaml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# keycloak-provider-install.yaml
|
||||
apiVersion: pkg.crossplane.io/v1
|
||||
kind: Provider
|
||||
metadata:
|
||||
name: provider-keycloak
|
||||
spec:
|
||||
package: crossplane-contrib/provider-keycloak:v0.2.0
|
||||
37
auth/keycloak-provider.yaml
Normal file
37
auth/keycloak-provider.yaml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: keycloak-provider-creds
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: keycloak-provider-creds
|
||||
namespace: crossplane-system
|
||||
type: Opaque
|
||||
stringData:
|
||||
credentials: |
|
||||
{
|
||||
"url": "http://keycloak-http.auth-system.svc.cluster.local",
|
||||
"client_id": "admin-cli",
|
||||
"username": "admin",
|
||||
"password": "thefi9paechooh"
|
||||
}
|
||||
---
|
||||
# Configure Keycloak provider
|
||||
apiVersion: keycloak.crossplane.io/v1beta1
|
||||
kind: ProviderConfig
|
||||
metadata:
|
||||
name: keycloak-provider
|
||||
spec:
|
||||
credentials:
|
||||
source: Secret
|
||||
secretRef:
|
||||
namespace: crossplane-system
|
||||
name: keycloak-provider-creds
|
||||
key: credentials
|
||||
191
auth/keycloak-resources.yaml
Normal file
191
auth/keycloak-resources.yaml
Normal file
|
|
@ -0,0 +1,191 @@
|
|||
# keycloak-resources.yaml
|
||||
# Create Kubernetes realm
|
||||
apiVersion: realm.keycloak.crossplane.io/v1alpha1
|
||||
kind: Realm
|
||||
metadata:
|
||||
name: kubernetes-realm
|
||||
spec:
|
||||
forProvider:
|
||||
realm: kubernetes-realm
|
||||
enabled: true
|
||||
displayName: "Kubernetes Realm"
|
||||
registrationAllowed: false
|
||||
resetPasswordAllowed: true
|
||||
rememberMe: true
|
||||
loginWithEmailAllowed: true
|
||||
providerConfigRef:
|
||||
name: keycloak-provider
|
||||
---
|
||||
# Create Pomerium client
|
||||
apiVersion: openidclient.keycloak.crossplane.io/v1alpha1
|
||||
kind: Client
|
||||
metadata:
|
||||
name: pomerium-client
|
||||
spec:
|
||||
forProvider:
|
||||
realmId: kubernetes-realm
|
||||
clientId: pomerium
|
||||
name: "Pomerium Identity-Aware Proxy"
|
||||
description: "Client for Pomerium IAP"
|
||||
enabled: true
|
||||
accessType: CONFIDENTIAL
|
||||
clientAuthenticatorType: client-secret
|
||||
validRedirectUris:
|
||||
- "https://authenticate.nge6.com/oauth2/callback"
|
||||
standardFlowEnabled: true
|
||||
directAccessGrantsEnabled: false
|
||||
serviceAccountsEnabled: false
|
||||
webOrigins:
|
||||
- "+"
|
||||
providerConfigRef:
|
||||
name: keycloak-provider
|
||||
---
|
||||
# Create user groups
|
||||
apiVersion: group.keycloak.crossplane.io/v1alpha1
|
||||
kind: Group
|
||||
metadata:
|
||||
name: k8s-admins-group
|
||||
spec:
|
||||
forProvider:
|
||||
realmId: kubernetes-realm
|
||||
name: k8s-admins
|
||||
providerConfigRef:
|
||||
name: keycloak-provider
|
||||
---
|
||||
apiVersion: group.keycloak.crossplane.io/v1alpha1
|
||||
kind: Group
|
||||
metadata:
|
||||
name: developers-group
|
||||
spec:
|
||||
forProvider:
|
||||
realmId: kubernetes-realm
|
||||
name: developers
|
||||
providerConfigRef:
|
||||
name: keycloak-provider
|
||||
---
|
||||
apiVersion: group.keycloak.crossplane.io/v1alpha1
|
||||
kind: Group
|
||||
metadata:
|
||||
name: users-group
|
||||
spec:
|
||||
forProvider:
|
||||
realmId: kubernetes-realm
|
||||
name: users
|
||||
providerConfigRef:
|
||||
name: keycloak-provider
|
||||
---
|
||||
# Create roles
|
||||
apiVersion: role.keycloak.crossplane.io/v1alpha1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: k8s-admin-role
|
||||
spec:
|
||||
forProvider:
|
||||
realmId: kubernetes-realm
|
||||
name: k8s-admin
|
||||
description: "Kubernetes cluster administrator"
|
||||
providerConfigRef:
|
||||
name: keycloak-provider
|
||||
---
|
||||
apiVersion: role.keycloak.crossplane.io/v1alpha1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: developer-role
|
||||
spec:
|
||||
forProvider:
|
||||
realmId: kubernetes-realm
|
||||
name: developer
|
||||
description: "Developer access to specific namespaces"
|
||||
providerConfigRef:
|
||||
name: keycloak-provider
|
||||
---
|
||||
apiVersion: role.keycloak.crossplane.io/v1alpha1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: user-role
|
||||
spec:
|
||||
forProvider:
|
||||
realmId: kubernetes-realm
|
||||
name: user
|
||||
description: "Basic user access"
|
||||
providerConfigRef:
|
||||
name: keycloak-provider
|
||||
---
|
||||
# Create admin user
|
||||
apiVersion: user.keycloak.crossplane.io/v1alpha1
|
||||
kind: User
|
||||
metadata:
|
||||
name: admin-user
|
||||
spec:
|
||||
forProvider:
|
||||
realmId: kubernetes-realm
|
||||
username: admin
|
||||
enabled: true
|
||||
emailVerified: true
|
||||
firstName: Admin
|
||||
lastName: User
|
||||
email: admin@nge6.com
|
||||
providerConfigRef:
|
||||
name: keycloak-provider
|
||||
---
|
||||
# Group role assignments - assign roles to groups
|
||||
apiVersion: group.keycloak.crossplane.io/v1alpha1
|
||||
kind: Roles
|
||||
metadata:
|
||||
name: k8s-admins-roles
|
||||
spec:
|
||||
forProvider:
|
||||
realmId: kubernetes-realm
|
||||
groupId: k8s-admins
|
||||
roleIds: ["k8s-admin"]
|
||||
providerConfigRef:
|
||||
name: keycloak-provider
|
||||
---
|
||||
apiVersion: group.keycloak.crossplane.io/v1alpha1
|
||||
kind: Roles
|
||||
metadata:
|
||||
name: developers-roles
|
||||
spec:
|
||||
forProvider:
|
||||
realmId: kubernetes-realm
|
||||
groupId: developers
|
||||
roleIds: ["developer"]
|
||||
providerConfigRef:
|
||||
name: keycloak-provider
|
||||
---
|
||||
apiVersion: group.keycloak.crossplane.io/v1alpha1
|
||||
kind: Roles
|
||||
metadata:
|
||||
name: users-roles
|
||||
spec:
|
||||
forProvider:
|
||||
realmId: kubernetes-realm
|
||||
groupId: users
|
||||
roleIds: ["user"]
|
||||
providerConfigRef:
|
||||
name: keycloak-provider
|
||||
---
|
||||
# User group memberships - add admin user to groups
|
||||
apiVersion: group.keycloak.crossplane.io/v1alpha1
|
||||
kind: Memberships
|
||||
metadata:
|
||||
name: k8s-admins-members
|
||||
spec:
|
||||
forProvider:
|
||||
realmId: kubernetes-realm
|
||||
groupId: k8s-admins
|
||||
members: ["admin"]
|
||||
providerConfigRef:
|
||||
name: keycloak-provider
|
||||
---
|
||||
apiVersion: group.keycloak.crossplane.io/v1alpha1
|
||||
kind: Memberships
|
||||
metadata:
|
||||
name: users-members
|
||||
spec:
|
||||
forProvider:
|
||||
realmId: kubernetes-realm
|
||||
groupId: users
|
||||
members: ["admin"]
|
||||
providerConfigRef:
|
||||
name: keycloak-provider
|
||||
173
auth/keycloak.yaml
Normal file
173
auth/keycloak.yaml
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
# auth-system namespace
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: auth-system-namespace
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: auth-system
|
||||
---
|
||||
# Keycloak service account
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: keycloak-service-account
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: keycloak
|
||||
namespace: auth-system
|
||||
---
|
||||
# Keycloak role
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: keycloak-role
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: keycloak
|
||||
namespace: auth-system
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["secrets", "configmaps", "pods"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
---
|
||||
# Keycloak role binding
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: keycloak-role-binding
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: keycloak
|
||||
namespace: auth-system
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: keycloak
|
||||
namespace: auth-system
|
||||
roleRef:
|
||||
kind: Role
|
||||
name: keycloak
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
---
|
||||
# Keycloak admin credentials
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: keycloak-admin-secret
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: keycloak-admin-creds
|
||||
namespace: auth-system
|
||||
type: Opaque
|
||||
stringData:
|
||||
password: "thefi9paechooh"
|
||||
---
|
||||
# Keycloak Helm release
|
||||
apiVersion: helm.crossplane.io/v1beta1
|
||||
kind: Release
|
||||
metadata:
|
||||
name: keycloak
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: helm-provider
|
||||
forProvider:
|
||||
chart:
|
||||
name: keycloak
|
||||
repository: https://codecentric.github.io/helm-charts
|
||||
version: 18.10.0
|
||||
namespace: auth-system
|
||||
values:
|
||||
image:
|
||||
repository: quay.io/keycloak/keycloak
|
||||
tag: 24.0.4
|
||||
serviceAccount:
|
||||
create: false
|
||||
name: keycloak
|
||||
args:
|
||||
- start
|
||||
- --db=postgres
|
||||
- --hostname-strict=false
|
||||
- --hostname-strict-https=false
|
||||
- --proxy=edge
|
||||
- --http-enabled=true
|
||||
livenessProbe: |
|
||||
httpGet:
|
||||
path: /realms/master
|
||||
port: http
|
||||
initialDelaySeconds: 120
|
||||
timeoutSeconds: 5
|
||||
periodSeconds: 30
|
||||
failureThreshold: 10
|
||||
readinessProbe: |
|
||||
httpGet:
|
||||
path: /realms/master
|
||||
port: http
|
||||
initialDelaySeconds: 90
|
||||
timeoutSeconds: 3
|
||||
periodSeconds: 10
|
||||
failureThreshold: 10
|
||||
startupProbe: |
|
||||
httpGet:
|
||||
path: /realms/master
|
||||
port: http
|
||||
initialDelaySeconds: 60
|
||||
timeoutSeconds: 3
|
||||
periodSeconds: 5
|
||||
failureThreshold: 30
|
||||
extraEnv: |
|
||||
- name: KEYCLOAK_ADMIN
|
||||
value: admin
|
||||
- name: KEYCLOAK_ADMIN_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: keycloak-admin-creds
|
||||
key: password
|
||||
- name: KC_DB
|
||||
value: postgres
|
||||
- name: KC_DB_URL
|
||||
value: jdbc:postgresql://keycloak-postgresql:5432/keycloak
|
||||
- name: KC_DB_USERNAME
|
||||
value: keycloak
|
||||
- name: KC_DB_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: keycloak-postgresql
|
||||
key: postgresql-password
|
||||
ingress:
|
||||
enabled: false
|
||||
240
auth/resources.yaml
Normal file
240
auth/resources.yaml
Normal file
|
|
@ -0,0 +1,240 @@
|
|||
apiVersion: apiextensions.crossplane.io/v1
|
||||
kind: Composition
|
||||
metadata:
|
||||
name: keycloakidentity.auth.yourdomain.com
|
||||
spec:
|
||||
writeConnectionSecretsToNamespace: crossplane-system
|
||||
compositeTypeRef:
|
||||
apiVersion: auth.yourdomain.com/v1alpha1
|
||||
kind: KeycloakIdentity
|
||||
resources:
|
||||
# 1. First create the realm
|
||||
- name: realm
|
||||
base:
|
||||
apiVersion: realm.keycloak.crossplane.io/v1alpha1
|
||||
kind: Realm
|
||||
metadata:
|
||||
annotations:
|
||||
crossplane.io/external-name: "{{ index .metadata.annotations \"keycloak/realm-name\" }}"
|
||||
spec:
|
||||
forProvider:
|
||||
realm: ""
|
||||
enabled: true
|
||||
displayName: ""
|
||||
registrationAllowed: false
|
||||
resetPasswordAllowed: true
|
||||
rememberMe: true
|
||||
loginWithEmailAllowed: true
|
||||
providerConfigRef:
|
||||
name: keycloak-provider
|
||||
writeConnectionSecretToRef:
|
||||
namespace: crossplane-system
|
||||
name: realm-connection-{{ index .metadata.annotations "keycloak/realm-name" }}
|
||||
patches:
|
||||
- type: FromCompositeFieldPath
|
||||
fromFieldPath: spec.realmName
|
||||
toFieldPath: metadata.annotations[keycloak/realm-name]
|
||||
- type: FromCompositeFieldPath
|
||||
fromFieldPath: spec.realmName
|
||||
toFieldPath: spec.forProvider.realm
|
||||
- type: FromCompositeFieldPath
|
||||
fromFieldPath: spec.realmName
|
||||
toFieldPath: spec.forProvider.displayName
|
||||
- type: FromCompositeFieldPath
|
||||
fromFieldPath: spec.realmName
|
||||
toFieldPath: spec.writeConnectionSecretToRef.name
|
||||
transforms:
|
||||
- type: string
|
||||
string:
|
||||
fmt: realm-connection-%s
|
||||
|
||||
# 2. Create the k8s-admins group
|
||||
- name: admins-group
|
||||
base:
|
||||
apiVersion: group.keycloak.crossplane.io/v1alpha1
|
||||
kind: Group
|
||||
spec:
|
||||
forProvider:
|
||||
name: k8s-admins
|
||||
providerConfigRef:
|
||||
name: keycloak-provider
|
||||
writeConnectionSecretToRef:
|
||||
namespace: crossplane-system
|
||||
name: admins-group-secret
|
||||
patches:
|
||||
- type: FromCompositeFieldPath
|
||||
fromFieldPath: spec.realmName
|
||||
toFieldPath: spec.forProvider.realmId
|
||||
connectionDetails:
|
||||
- fromConnectionSecretKey: id
|
||||
name: adminsGroupId
|
||||
|
||||
# 3. Create the users group
|
||||
- name: users-group
|
||||
base:
|
||||
apiVersion: group.keycloak.crossplane.io/v1alpha1
|
||||
kind: Group
|
||||
spec:
|
||||
forProvider:
|
||||
name: users
|
||||
providerConfigRef:
|
||||
name: keycloak-provider
|
||||
writeConnectionSecretToRef:
|
||||
namespace: crossplane-system
|
||||
name: users-group-secret
|
||||
patches:
|
||||
- type: FromCompositeFieldPath
|
||||
fromFieldPath: spec.realmName
|
||||
toFieldPath: spec.forProvider.realmId
|
||||
connectionDetails:
|
||||
- fromConnectionSecretKey: id
|
||||
name: usersGroupId
|
||||
|
||||
# 4. Create the developers group
|
||||
- name: developers-group
|
||||
base:
|
||||
apiVersion: group.keycloak.crossplane.io/v1alpha1
|
||||
kind: Group
|
||||
spec:
|
||||
forProvider:
|
||||
name: developers
|
||||
providerConfigRef:
|
||||
name: keycloak-provider
|
||||
writeConnectionSecretToRef:
|
||||
namespace: crossplane-system
|
||||
name: developers-group-secret
|
||||
patches:
|
||||
- type: FromCompositeFieldPath
|
||||
fromFieldPath: spec.realmName
|
||||
toFieldPath: spec.forProvider.realmId
|
||||
connectionDetails:
|
||||
- fromConnectionSecretKey: id
|
||||
name: developersGroupId
|
||||
|
||||
# 5. Create the admin user with password
|
||||
- name: admin-user
|
||||
base:
|
||||
apiVersion: user.keycloak.crossplane.io/v1alpha1
|
||||
kind: User
|
||||
spec:
|
||||
forProvider:
|
||||
emailVerified: true
|
||||
enabled: true
|
||||
firstName: Admin
|
||||
lastName: User
|
||||
initialPassword:
|
||||
- temporary: true
|
||||
valueSecretRef:
|
||||
namespace: crossplane-system
|
||||
name: admin-password-secret
|
||||
key: password
|
||||
providerConfigRef:
|
||||
name: keycloak-provider
|
||||
writeConnectionSecretToRef:
|
||||
namespace: crossplane-system
|
||||
name: admin-user-secret
|
||||
patches:
|
||||
- type: FromCompositeFieldPath
|
||||
fromFieldPath: spec.realmName
|
||||
toFieldPath: spec.forProvider.realmId
|
||||
- type: FromCompositeFieldPath
|
||||
fromFieldPath: spec.adminUsername
|
||||
toFieldPath: spec.forProvider.username
|
||||
- type: FromCompositeFieldPath
|
||||
fromFieldPath: spec.adminEmail
|
||||
toFieldPath: spec.forProvider.email
|
||||
connectionDetails:
|
||||
- fromConnectionSecretKey: id
|
||||
name: adminUserId
|
||||
|
||||
# 6. Create admin-user to k8s-admins group membership
|
||||
- name: admin-to-admins-membership
|
||||
base:
|
||||
apiVersion: user.keycloak.crossplane.io/v1alpha1
|
||||
kind: Groups
|
||||
spec:
|
||||
forProvider:
|
||||
exhaustive: false
|
||||
providerConfigRef:
|
||||
name: keycloak-provider
|
||||
patches:
|
||||
- type: FromCompositeFieldPath
|
||||
fromFieldPath: spec.realmName
|
||||
toFieldPath: spec.forProvider.realmId
|
||||
- type: PatchSet
|
||||
patchSetName: adminUserId-patching
|
||||
- type: PatchSet
|
||||
patchSetName: adminsGroupId-patching
|
||||
|
||||
# 7. Create admin-user to users group membership
|
||||
- name: admin-to-users-membership
|
||||
base:
|
||||
apiVersion: user.keycloak.crossplane.io/v1alpha1
|
||||
kind: Groups
|
||||
spec:
|
||||
forProvider:
|
||||
exhaustive: false
|
||||
providerConfigRef:
|
||||
name: keycloak-provider
|
||||
patches:
|
||||
- type: FromCompositeFieldPath
|
||||
fromFieldPath: spec.realmName
|
||||
toFieldPath: spec.forProvider.realmId
|
||||
- type: PatchSet
|
||||
patchSetName: adminUserId-patching
|
||||
- type: PatchSet
|
||||
patchSetName: usersGroupId-patching
|
||||
|
||||
# 8. Create Pomerium client
|
||||
- name: pomerium-client
|
||||
base:
|
||||
apiVersion: openidclient.keycloak.crossplane.io/v1alpha1
|
||||
kind: Client
|
||||
spec:
|
||||
forProvider:
|
||||
clientId: pomerium
|
||||
name: "Pomerium Identity-Aware Proxy"
|
||||
description: "Client for Pomerium IAP"
|
||||
enabled: true
|
||||
clientAuthenticatorType: client-secret
|
||||
accessType: "CONFIDENTIAL"
|
||||
standardFlowEnabled: true
|
||||
directAccessGrantsEnabled: false
|
||||
serviceAccountsEnabled: false
|
||||
validRedirectUris: []
|
||||
webOrigins:
|
||||
- "+"
|
||||
providerConfigRef:
|
||||
name: keycloak-provider
|
||||
writeConnectionSecretToRef:
|
||||
namespace: crossplane-system
|
||||
name: pomerium-client-secret
|
||||
patches:
|
||||
- type: FromCompositeFieldPath
|
||||
fromFieldPath: spec.realmName
|
||||
toFieldPath: spec.forProvider.realmId
|
||||
- type: FromCompositeFieldPath
|
||||
fromFieldPath: spec.pomeriumRedirectUri
|
||||
toFieldPath: spec.forProvider.validRedirectUris[0]
|
||||
connectionDetails:
|
||||
- fromConnectionSecretKey: clientSecret
|
||||
name: pomeriumClientSecret
|
||||
|
||||
patchSets:
|
||||
- name: adminUserId-patching
|
||||
patches:
|
||||
- type: FromCompositeFieldPath
|
||||
fromFieldPath: connectionDetails.adminUserId
|
||||
toFieldPath: spec.forProvider.userId
|
||||
|
||||
- name: adminsGroupId-patching
|
||||
patches:
|
||||
- type: FromCompositeFieldPath
|
||||
fromFieldPath: connectionDetails.adminsGroupId
|
||||
toFieldPath: spec.forProvider.groupIds[0]
|
||||
|
||||
- name: usersGroupId-patching
|
||||
patches:
|
||||
- type: FromCompositeFieldPath
|
||||
fromFieldPath: connectionDetails.usersGroupId
|
||||
toFieldPath: spec.forProvider.groupIds[0]
|
||||
18
auth/secret.yaml
Normal file
18
auth/secret.yaml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: admin-password-secret
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: admin-password-secret
|
||||
namespace: crossplane-system
|
||||
type: Opaque
|
||||
stringData:
|
||||
password: "YOUR_ADMIN_PASSWORD"
|
||||
22
cert-manager/cert-manager-gandi-rbac.yaml
Normal file
22
cert-manager/cert-manager-gandi-rbac.yaml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: cert-manager-gandi-webhook-rbac
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: cert-manager:gandi-webhook
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: gandi-webhook-cert-manager-webhook-gandi:domain-solver
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: cert-manager
|
||||
namespace: cert-manager
|
||||
18
cert-manager/gandi-credentials-secret.yaml
Normal file
18
cert-manager/gandi-credentials-secret.yaml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: gandi-credentials-secret
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: gandi-credentials
|
||||
namespace: cert-manager
|
||||
type: Opaque
|
||||
stringData:
|
||||
api-token: "28aedbb9b4c8d634558af5d9284a794a3a423abb"
|
||||
41
cert-manager/gandi-webhook-rbac.yaml
Normal file
41
cert-manager/gandi-webhook-rbac.yaml
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: gandi-webhook-rbac
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: gandi-webhook-domain-solver
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["secrets"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
---
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: gandi-webhook-rbac-binding
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: gandi-webhook-domain-solver
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: gandi-webhook-domain-solver
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: gandi-webhook-cert-manager-webhook-gandi
|
||||
namespace: cert-manager
|
||||
31
cert-manager/gandi-webhook.yaml
Normal file
31
cert-manager/gandi-webhook.yaml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: gandi-webhook-namespace
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: cert-manager-webhook-gandi
|
||||
---
|
||||
apiVersion: helm.crossplane.io/v1beta1
|
||||
kind: Release
|
||||
metadata:
|
||||
name: gandi-webhook
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: helm-provider
|
||||
forProvider:
|
||||
chart:
|
||||
name: cert-manager-webhook-gandi
|
||||
repository: https://sintef.github.io/cert-manager-webhook-gandi
|
||||
version: v0.5.2
|
||||
namespace: cert-manager
|
||||
values:
|
||||
groupName: acme.cert-manager.io
|
||||
29
cert-manager/letsencrypt-dns-issuer.yaml
Normal file
29
cert-manager/letsencrypt-dns-issuer.yaml
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: letsencrypt-dns-issuer
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: ClusterIssuer
|
||||
metadata:
|
||||
name: letsencrypt-dns
|
||||
spec:
|
||||
acme:
|
||||
email: admin@nge6.com
|
||||
server: https://acme-v02.api.letsencrypt.org/directory
|
||||
privateKeySecretRef:
|
||||
name: letsencrypt-dns
|
||||
solvers:
|
||||
- dns01:
|
||||
webhook:
|
||||
groupName: acme.cert-manager.io
|
||||
solverName: gandi
|
||||
config:
|
||||
patSecretRef:
|
||||
name: gandi-credentials
|
||||
key: api-token
|
||||
29
cert-manager/letsencrypt-issuer.yaml
Normal file
29
cert-manager/letsencrypt-issuer.yaml
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: letsencrypt-prod-issuer
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: ClusterIssuer
|
||||
metadata:
|
||||
name: letsencrypt-prod
|
||||
spec:
|
||||
acme:
|
||||
# You must replace this email address with your own.
|
||||
# Let's Encrypt will use this to contact you about expiring
|
||||
# certificates, and issues related to your account.
|
||||
email: admin@nge6.com
|
||||
server: https://acme-v02.api.letsencrypt.org/directory
|
||||
privateKeySecretRef:
|
||||
# Secret resource that will be used to store the account's private key.
|
||||
name: letsencrypt-prod
|
||||
# Add a single challenge solver, HTTP01 using ingress
|
||||
solvers:
|
||||
- http01:
|
||||
ingress:
|
||||
class: ambassador
|
||||
18
dns/gandi-api-key.yaml
Normal file
18
dns/gandi-api-key.yaml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: gandi-api-key
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: gandi-api-key
|
||||
namespace: external-dns
|
||||
type: Opaque
|
||||
stringData:
|
||||
api-key: "5ea1e058de81926ad37af59374756eb69f7e24af"
|
||||
31
emissary/emissary-crds.yaml
Normal file
31
emissary/emissary-crds.yaml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: emissary-crds
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: emissary-crds-installer
|
||||
namespace: emissary
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
sidecar.istio.io/inject: "false"
|
||||
spec:
|
||||
serviceAccountName: emissary-crds-installer
|
||||
containers:
|
||||
- name: kubectl
|
||||
image: bitnami/kubectl:latest
|
||||
command:
|
||||
- kubectl
|
||||
- apply
|
||||
- -f
|
||||
- https://app.getambassador.io/yaml/emissary/3.8.0/emissary-crds.yaml
|
||||
restartPolicy: OnFailure
|
||||
38
emissary/emissary-sa.yaml
Normal file
38
emissary/emissary-sa.yaml
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: emissary-sa
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: emissary-crds-installer
|
||||
namespace: emissary
|
||||
---
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: emissary-crb
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: emissary-crds-installer
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: emissary-crds-installer
|
||||
namespace: emissary
|
||||
roleRef:
|
||||
kind: ClusterRole
|
||||
name: cluster-admin
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
18
emissary/emissary.yaml
Normal file
18
emissary/emissary.yaml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
apiVersion: helm.crossplane.io/v1beta1
|
||||
kind: Release
|
||||
metadata:
|
||||
name: emissary-ingress
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: helm-provider
|
||||
forProvider:
|
||||
chart:
|
||||
name: emissary-ingress
|
||||
repository: https://app.getambassador.io
|
||||
version: 8.0.0
|
||||
namespace: emissary
|
||||
values:
|
||||
service:
|
||||
type: LoadBalancer
|
||||
replicaCount: 2
|
||||
144
external-dns.yaml
Normal file
144
external-dns.yaml
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
# External DNS namespace
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: external-dns-namespace
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: external-dns
|
||||
---
|
||||
# External DNS service account
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: external-dns-sa
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: external-dns
|
||||
namespace: external-dns
|
||||
---
|
||||
# External DNS cluster role
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: external-dns-clusterrole
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: external-dns
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["services", "endpoints", "pods"]
|
||||
verbs: ["get", "watch", "list"]
|
||||
- apiGroups: ["extensions", "networking.k8s.io"]
|
||||
resources: ["ingresses"]
|
||||
verbs: ["get", "watch", "list"]
|
||||
- apiGroups: [""]
|
||||
resources: ["nodes"]
|
||||
verbs: ["list", "watch"]
|
||||
---
|
||||
# External DNS cluster role binding
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: external-dns-clusterrolebinding
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: external-dns
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: external-dns
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: external-dns
|
||||
namespace: external-dns
|
||||
---
|
||||
# External DNS deployment
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: external-dns-deployment
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: external-dns
|
||||
namespace: external-dns
|
||||
spec:
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
app: external-dns
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: external-dns
|
||||
spec:
|
||||
serviceAccountName: external-dns
|
||||
containers:
|
||||
- name: external-dns
|
||||
image: registry.k8s.io/external-dns/external-dns:v0.15.0
|
||||
args:
|
||||
- --source=service
|
||||
- --source=ingress
|
||||
- --domain-filter=nge6.com
|
||||
- --provider=gandi
|
||||
- --registry=txt
|
||||
- --txt-owner-id=external-dns
|
||||
- --txt-prefix=external-dns-
|
||||
- --log-level=info
|
||||
- --log-format=text
|
||||
env:
|
||||
- name: GANDI_PAT
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: gandi-api-key
|
||||
key: api-key
|
||||
resources:
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
requests:
|
||||
cpu: 50m
|
||||
memory: 64Mi
|
||||
securityContext:
|
||||
runAsNonRoot: true
|
||||
runAsUser: 65534
|
||||
readOnlyRootFilesystem: true
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities:
|
||||
drop: ["ALL"]
|
||||
310
forgejo-k8s.yaml
Normal file
310
forgejo-k8s.yaml
Normal file
|
|
@ -0,0 +1,310 @@
|
|||
# Forgejo namespace
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: forgejo-namespace
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: forgejo
|
||||
---
|
||||
# Forgejo ConfigMap
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: forgejo-config
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: forgejo-config
|
||||
namespace: forgejo
|
||||
data:
|
||||
app.ini: |
|
||||
APP_NAME = Forgejo: Beyond coding. We forge.
|
||||
RUN_MODE = prod
|
||||
|
||||
[server]
|
||||
DOMAIN = git.nge6.com
|
||||
SSH_DOMAIN = git.nge6.com
|
||||
HTTP_PORT = 3000
|
||||
ROOT_URL = https://git.nge6.com/
|
||||
DISABLE_SSH = true
|
||||
SSH_PORT = 2222
|
||||
SSH_LISTEN_PORT = 2222
|
||||
START_SSH_SERVER = false
|
||||
LFS_START_SERVER = true
|
||||
OFFLINE_MODE = false
|
||||
|
||||
[database]
|
||||
DB_TYPE = sqlite3
|
||||
PATH = /data/gitea/gitea.db
|
||||
|
||||
[repository]
|
||||
ROOT = /data/git/repositories
|
||||
|
||||
[security]
|
||||
INSTALL_LOCK = true
|
||||
SECRET_KEY = forgejo-secret-key-change-this-in-production-please
|
||||
INTERNAL_TOKEN = forgejo-internal-token-change-this-in-production-too
|
||||
|
||||
[service]
|
||||
DISABLE_REGISTRATION = false
|
||||
REQUIRE_SIGNIN_VIEW = false
|
||||
ENABLE_NOTIFY_MAIL = false
|
||||
|
||||
[picture]
|
||||
DISABLE_GRAVATAR = false
|
||||
ENABLE_FEDERATED_AVATAR = true
|
||||
|
||||
[openid]
|
||||
ENABLE_OPENID_SIGNIN = false
|
||||
ENABLE_OPENID_SIGNUP = false
|
||||
|
||||
[log]
|
||||
MODE = console
|
||||
LEVEL = Info
|
||||
ROOT_PATH = /data/gitea/log
|
||||
---
|
||||
# Forgejo PVC for data persistence
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: forgejo-data-pvc
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: forgejo-data
|
||||
namespace: forgejo
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClassName: civo-volume
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
---
|
||||
# Forgejo Deployment
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: forgejo-deployment
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: forgejo
|
||||
namespace: forgejo
|
||||
labels:
|
||||
app: forgejo
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: forgejo
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: forgejo
|
||||
spec:
|
||||
initContainers:
|
||||
- name: setup-config
|
||||
image: busybox:1.36
|
||||
command: ['sh', '-c']
|
||||
args:
|
||||
- |
|
||||
mkdir -p /data/gitea/conf /data/gitea/log /data/git/repositories /data/git/.ssh
|
||||
cp /tmp/app.ini /data/gitea/conf/app.ini
|
||||
touch /data/git/.ssh/authorized_keys
|
||||
chown -R 1000:1000 /data
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /data
|
||||
- name: config
|
||||
mountPath: /tmp
|
||||
containers:
|
||||
- name: forgejo
|
||||
image: codeberg.org/forgejo/forgejo:9.0.2
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
name: http
|
||||
- containerPort: 2222
|
||||
name: ssh
|
||||
env:
|
||||
- name: USER_UID
|
||||
value: "1000"
|
||||
- name: USER_GID
|
||||
value: "1000"
|
||||
resources:
|
||||
limits:
|
||||
cpu: 1000m
|
||||
memory: 2Gi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 512Mi
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /data
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 3000
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 3000
|
||||
initialDelaySeconds: 60
|
||||
periodSeconds: 30
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: forgejo-data
|
||||
- name: config
|
||||
configMap:
|
||||
name: forgejo-config
|
||||
---
|
||||
# Forgejo HTTP Service
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: forgejo-http-service
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: forgejo-http
|
||||
namespace: forgejo
|
||||
labels:
|
||||
app: forgejo
|
||||
spec:
|
||||
selector:
|
||||
app: forgejo
|
||||
ports:
|
||||
- name: http
|
||||
port: 3000
|
||||
targetPort: 3000
|
||||
type: ClusterIP
|
||||
---
|
||||
# Forgejo SSH Service
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: forgejo-ssh-service
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: forgejo-ssh
|
||||
namespace: forgejo
|
||||
labels:
|
||||
app: forgejo
|
||||
spec:
|
||||
selector:
|
||||
app: forgejo
|
||||
ports:
|
||||
- name: ssh
|
||||
port: 2222
|
||||
targetPort: 2222
|
||||
type: LoadBalancer
|
||||
---
|
||||
# SSL Certificate for Forgejo
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: forgejo-certificate
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: forgejo-tls
|
||||
namespace: emissary
|
||||
spec:
|
||||
secretName: forgejo-tls
|
||||
issuerRef:
|
||||
name: letsencrypt-prod
|
||||
kind: ClusterIssuer
|
||||
dnsNames:
|
||||
- git.nge6.com
|
||||
---
|
||||
# Ambassador Host for Forgejo
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: forgejo-host
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: getambassador.io/v3alpha1
|
||||
kind: Host
|
||||
metadata:
|
||||
name: forgejo-host
|
||||
namespace: emissary
|
||||
spec:
|
||||
hostname: git.nge6.com
|
||||
tlsSecret:
|
||||
name: forgejo-tls
|
||||
---
|
||||
# Ambassador Mapping for Forgejo
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: forgejo-mapping
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: getambassador.io/v3alpha1
|
||||
kind: Mapping
|
||||
metadata:
|
||||
name: forgejo-mapping
|
||||
namespace: emissary
|
||||
spec:
|
||||
hostname: git.nge6.com
|
||||
prefix: /
|
||||
service: https://pomerium-proxy.pomerium:443
|
||||
timeout_ms: 30000
|
||||
connect_timeout_ms: 10000
|
||||
20
gitea/gitea-secrets.yaml
Normal file
20
gitea/gitea-secrets.yaml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: gitea-secrets
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: gitea-secrets
|
||||
namespace: gitea
|
||||
type: Opaque
|
||||
stringData:
|
||||
admin_password: "ahgheeyah9eej9"
|
||||
secret_key: "`8S7T6sUIF)\SOvY8YFZObn=mZOAYnh!"
|
||||
postgres_password: "dHMvJ+CX+EZ4dWccAby^`ENd8;M~d1Yt"
|
||||
45
helm-provider-rbac.yaml
Normal file
45
helm-provider-rbac.yaml
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
# helm-provider-rbac.yaml
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: helm-provider-clusterrole
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: crossplane-provider-helm-admin
|
||||
rules:
|
||||
- apiGroups:
|
||||
- "*"
|
||||
resources:
|
||||
- "*"
|
||||
verbs:
|
||||
- "*"
|
||||
---
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: helm-provider-binding
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: crossplane-provider-helm-admin-binding
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: provider-helm-9fcd9ac09d15
|
||||
namespace: crossplane-system
|
||||
roleRef:
|
||||
kind: ClusterRole
|
||||
name: crossplane-provider-helm-admin
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
0
helm-provider.yaml
Normal file
0
helm-provider.yaml
Normal file
31
istio/istio-base.yaml
Normal file
31
istio/istio-base.yaml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# First create the namespace using Kubernetes provider
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: istio-system-namespace
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: istio-system
|
||||
---
|
||||
# Then deploy Istio using Helm provider without createNamespace
|
||||
apiVersion: helm.crossplane.io/v1beta1
|
||||
kind: Release
|
||||
metadata:
|
||||
name: istio-base
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: helm-provider
|
||||
forProvider:
|
||||
chart:
|
||||
name: base
|
||||
repository: https://istio-release.storage.googleapis.com/charts
|
||||
version: 1.18.2
|
||||
namespace: istio-system
|
||||
23
istio/istiod.yaml
Normal file
23
istio/istiod.yaml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
apiVersion: helm.crossplane.io/v1beta1
|
||||
kind: Release
|
||||
metadata:
|
||||
name: istiod
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: helm-provider
|
||||
forProvider:
|
||||
chart:
|
||||
name: istiod
|
||||
repository: https://istio-release.storage.googleapis.com/charts
|
||||
version: 1.18.2
|
||||
namespace: istio-system
|
||||
values:
|
||||
pilot:
|
||||
resources:
|
||||
requests:
|
||||
cpu: 200m
|
||||
memory: 512Mi
|
||||
meshConfig:
|
||||
accessLogFile: /dev/stdout
|
||||
enableTracing: true
|
||||
205
keycloak-config.yaml
Normal file
205
keycloak-config.yaml
Normal file
|
|
@ -0,0 +1,205 @@
|
|||
# Keycloak realm and client configuration for Pomerium
|
||||
# First, copy pomerium secrets to auth-system namespace
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: copy-pomerium-secrets
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: copy-pomerium-secrets
|
||||
namespace: auth-system
|
||||
spec:
|
||||
ttlSecondsAfterFinished: 300
|
||||
template:
|
||||
spec:
|
||||
serviceAccountName: secret-copier
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: secret-copier
|
||||
image: bitnami/kubectl:latest
|
||||
command: ["/bin/bash"]
|
||||
args:
|
||||
- -c
|
||||
- |
|
||||
set -e
|
||||
echo "Copying pomerium secrets to auth-system namespace..."
|
||||
|
||||
# Get the secret from pomerium namespace
|
||||
kubectl get secret pomerium-secrets -n pomerium -o yaml | \
|
||||
sed 's/namespace: pomerium/namespace: auth-system/' | \
|
||||
sed '/resourceVersion/d' | \
|
||||
sed '/uid:/d' | \
|
||||
kubectl apply -f -
|
||||
|
||||
echo "Secret copied successfully"
|
||||
---
|
||||
# ServiceAccount for secret copying
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: secret-copier-sa
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: secret-copier
|
||||
namespace: auth-system
|
||||
---
|
||||
# Role for secret copying
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: secret-copier-role
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: secret-copier
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["secrets"]
|
||||
verbs: ["get", "list", "create", "update", "patch"]
|
||||
---
|
||||
# RoleBinding for secret copying
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: secret-copier-binding
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: secret-copier
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: secret-copier
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: secret-copier
|
||||
namespace: auth-system
|
||||
---
|
||||
# Create kubernetes-realm
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: keycloak-kubernetes-realm
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: setup-keycloak-realm
|
||||
namespace: auth-system
|
||||
spec:
|
||||
ttlSecondsAfterFinished: 600
|
||||
template:
|
||||
spec:
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: keycloak-setup
|
||||
image: curlimages/curl:latest
|
||||
command: ["/bin/sh"]
|
||||
args:
|
||||
- -c
|
||||
- |
|
||||
set -e
|
||||
echo "Setting up Keycloak realm and client..."
|
||||
|
||||
# Wait for Keycloak to be ready
|
||||
until curl -f http://keycloak-http:80/realms/master; do
|
||||
echo "Waiting for Keycloak..."
|
||||
sleep 10
|
||||
done
|
||||
|
||||
# Get admin token
|
||||
TOKEN=$(curl -s -X POST http://keycloak-http:80/realms/master/protocol/openid-connect/token \
|
||||
-H 'Content-Type: application/x-www-form-urlencoded' \
|
||||
-d "username=admin&password=${KEYCLOAK_ADMIN_PASSWORD}&grant_type=password&client_id=admin-cli" | \
|
||||
grep -o '"access_token":"[^"]*' | cut -d'"' -f4)
|
||||
|
||||
if [ -z "$TOKEN" ]; then
|
||||
echo "Failed to get admin token"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Got admin token, creating realm..."
|
||||
|
||||
# Create kubernetes-realm
|
||||
curl -s -X POST http://keycloak-http:80/admin/realms \
|
||||
-H "Authorization: Bearer $TOKEN" \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{
|
||||
"realm": "kubernetes-realm",
|
||||
"enabled": true,
|
||||
"displayName": "Kubernetes Realm",
|
||||
"accessTokenLifespan": 1800,
|
||||
"sslRequired": "none"
|
||||
}' || echo "Realm might already exist"
|
||||
|
||||
echo "Creating Pomerium OIDC client..."
|
||||
|
||||
# Create pomerium client
|
||||
curl -s -X POST http://keycloak-http:80/admin/realms/kubernetes-realm/clients \
|
||||
-H "Authorization: Bearer $TOKEN" \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{
|
||||
"clientId": "pomerium",
|
||||
"enabled": true,
|
||||
"clientAuthenticatorType": "client-secret",
|
||||
"secret": "'${POMERIUM_CLIENT_SECRET}'",
|
||||
"redirectUris": [
|
||||
"https://authenticate.nge6.com/oauth2/callback"
|
||||
],
|
||||
"webOrigins": [
|
||||
"https://authenticate.nge6.com",
|
||||
"https://keycloak.nge6.com"
|
||||
],
|
||||
"protocol": "openid-connect",
|
||||
"publicClient": false,
|
||||
"bearerOnly": false,
|
||||
"consentRequired": false,
|
||||
"standardFlowEnabled": true,
|
||||
"implicitFlowEnabled": false,
|
||||
"directAccessGrantsEnabled": false,
|
||||
"serviceAccountsEnabled": false
|
||||
}'
|
||||
|
||||
echo "Keycloak setup completed successfully"
|
||||
env:
|
||||
- name: KEYCLOAK_ADMIN_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: keycloak-admin-creds
|
||||
key: password
|
||||
- name: POMERIUM_CLIENT_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: pomerium-secrets
|
||||
key: idp_client_secret
|
||||
19
keycloak/keycloak-admin-secret.yaml
Normal file
19
keycloak/keycloak-admin-secret.yaml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# secrets.yaml
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: keycloak-admin-secret
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: keycloak-admin-creds
|
||||
namespace: auth-system
|
||||
type: Opaque
|
||||
stringData:
|
||||
password: "thefi9paechooh"
|
||||
36
kubernetes-provider-role.yaml
Normal file
36
kubernetes-provider-role.yaml
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: crossplane-provider-kubernetes-admin
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- namespaces
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- create
|
||||
- delete
|
||||
- patch
|
||||
- update
|
||||
- apiGroups:
|
||||
- "*"
|
||||
resources:
|
||||
- "*"
|
||||
verbs:
|
||||
- "*"
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: crossplane-provider-kubernetes-admin-binding
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: provider-kubernetes-71953a1e5c15
|
||||
namespace: crossplane-system
|
||||
roleRef:
|
||||
kind: ClusterRole
|
||||
name: crossplane-provider-kubernetes-admin
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
120
namespaces.yaml
Normal file
120
namespaces.yaml
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
# namespaces.yaml
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: istio-system-namespace
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: istio-system
|
||||
---
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: spire-namespace
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: spire
|
||||
---
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: emissary-namespace
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: emissary
|
||||
---
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: auth-system-namespace
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: auth-system
|
||||
---
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: pomerium-namespace
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: pomerium
|
||||
---
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: gitea-namespace
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: gitea
|
||||
---
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: flux-namespace
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: flux-system
|
||||
---
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: external-dns-namespace
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: external-dns
|
||||
43
pomerium-ambassador-mapping.yaml
Normal file
43
pomerium-ambassador-mapping.yaml
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: pomerium-authenticate-mapping
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: getambassador.io/v3alpha1
|
||||
kind: Mapping
|
||||
metadata:
|
||||
name: authenticate-mapping
|
||||
namespace: emissary
|
||||
spec:
|
||||
hostname: authenticate.nge6.com
|
||||
prefix: /
|
||||
service: https://pomerium-authenticate.pomerium:443
|
||||
timeout_ms: 30000
|
||||
connect_timeout_ms: 10000
|
||||
---
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: pomerium-keycloak-mapping
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: getambassador.io/v3alpha1
|
||||
kind: Mapping
|
||||
metadata:
|
||||
name: keycloak-mapping
|
||||
namespace: emissary
|
||||
spec:
|
||||
hostname: keycloak.nge6.com
|
||||
prefix: /
|
||||
service: https://pomerium-proxy.pomerium:443
|
||||
timeout_ms: 30000
|
||||
connect_timeout_ms: 10000
|
||||
23
pomerium-certificate.yaml
Normal file
23
pomerium-certificate.yaml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: pomerium-certificate
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: pomerium-tls
|
||||
namespace: pomerium
|
||||
spec:
|
||||
secretName: pomerium-tls-cert
|
||||
issuerRef:
|
||||
name: letsencrypt-prod
|
||||
kind: ClusterIssuer
|
||||
dnsNames:
|
||||
- authenticate.nge6.com
|
||||
- keycloak.nge6.com
|
||||
45
pomerium-correct-listeners.yaml
Normal file
45
pomerium-correct-listeners.yaml
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: pomerium-listener-http
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: getambassador.io/v3alpha1
|
||||
kind: Listener
|
||||
metadata:
|
||||
name: pomerium-listener-http
|
||||
namespace: emissary
|
||||
spec:
|
||||
port: 8080
|
||||
protocol: HTTP
|
||||
securityModel: XFP
|
||||
hostBinding:
|
||||
namespace:
|
||||
from: ALL
|
||||
---
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: pomerium-listener-https
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: getambassador.io/v3alpha1
|
||||
kind: Listener
|
||||
metadata:
|
||||
name: pomerium-listener-https
|
||||
namespace: emissary
|
||||
spec:
|
||||
port: 8443
|
||||
protocol: HTTPS
|
||||
securityModel: XFP
|
||||
hostBinding:
|
||||
namespace:
|
||||
from: ALL
|
||||
39
pomerium-working-host.yaml
Normal file
39
pomerium-working-host.yaml
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: pomerium-host-auth
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: getambassador.io/v3alpha1
|
||||
kind: Host
|
||||
metadata:
|
||||
name: authenticate-host
|
||||
namespace: emissary
|
||||
spec:
|
||||
hostname: authenticate.nge6.com
|
||||
tlsSecret:
|
||||
name: pomerium-dns-tls
|
||||
---
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: pomerium-host-keycloak
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: getambassador.io/v3alpha1
|
||||
kind: Host
|
||||
metadata:
|
||||
name: keycloak-host
|
||||
namespace: emissary
|
||||
spec:
|
||||
hostname: keycloak.nge6.com
|
||||
tlsSecret:
|
||||
name: pomerium-dns-tls
|
||||
80
pomerium.yaml
Normal file
80
pomerium.yaml
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
# Pomerium namespace
|
||||
apiVersion: kubernetes.crossplane.io/v1alpha2
|
||||
kind: Object
|
||||
metadata:
|
||||
name: pomerium-namespace
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: kubernetes-provider
|
||||
forProvider:
|
||||
manifest:
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: pomerium
|
||||
---
|
||||
# Pomerium Helm release
|
||||
apiVersion: helm.crossplane.io/v1beta1
|
||||
kind: Release
|
||||
metadata:
|
||||
name: pomerium
|
||||
namespace: crossplane-system
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: helm-provider
|
||||
forProvider:
|
||||
chart:
|
||||
name: pomerium
|
||||
repository: https://helm.pomerium.io
|
||||
version: 34.0.1
|
||||
namespace: pomerium
|
||||
values:
|
||||
config:
|
||||
# Pomerium configuration
|
||||
rootDomain: nge6.com
|
||||
|
||||
# Shared secret for service communication
|
||||
sharedSecret: "YWJjZGVmZ2hpams="
|
||||
|
||||
# Cookie secret for session management
|
||||
cookieSecret: "bXlzZWNyZXRjb29raWVzZWNyZXQ="
|
||||
|
||||
# Routes for protected applications
|
||||
routes:
|
||||
# Allow public access to all Keycloak for testing
|
||||
- from: https://keycloak.nge6.com
|
||||
to: http://keycloak-http.auth-system.svc.cluster.local
|
||||
preserve_host_header: true
|
||||
allow_public_unauthenticated_access: true
|
||||
# Forgejo Git service - temporarily allow unauthenticated for setup
|
||||
- from: https://git.nge6.com
|
||||
to: http://forgejo-http.forgejo.svc.cluster.local:3000
|
||||
preserve_host_header: true
|
||||
allow_public_unauthenticated_access: true
|
||||
# Forgejo Git service - temporarily allow unauthenticated for setup (HTTP)
|
||||
- from: http://git.nge6.com
|
||||
to: http://forgejo-http.forgejo.svc.cluster.local:3000
|
||||
preserve_host_header: true
|
||||
allow_public_unauthenticated_access: true
|
||||
|
||||
# Authentication service configuration
|
||||
authenticate:
|
||||
proxied: true
|
||||
idp:
|
||||
provider: oidc
|
||||
url: https://keycloak.nge6.com/realms/kubernetes-realm
|
||||
clientID: pomerium
|
||||
clientSecret: 3JFMh3DZDOYlNiSQ64abL0z0bw1WJt3x
|
||||
# Manual OIDC endpoint configuration to bypass discovery
|
||||
scopes: ["openid", "profile", "email"]
|
||||
|
||||
# Disable automatic ingress generation
|
||||
ingress:
|
||||
enabled: false
|
||||
|
||||
# Service configuration for proxy
|
||||
proxy:
|
||||
service:
|
||||
type: ClusterIP
|
||||
|
||||
21
pomerium/.helmignore
Normal file
21
pomerium/.helmignore
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# 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
|
||||
6
pomerium/Chart.lock
Normal file
6
pomerium/Chart.lock
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
dependencies:
|
||||
- name: redis
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
version: 17.0.9
|
||||
digest: sha256:8d788544c14c964bf8b9bc142d90acfdae5381ca22bf24018d9b5ce97ce6fe4f
|
||||
generated: "2022-08-09T10:34:03.405348987Z"
|
||||
31
pomerium/Chart.yaml
Normal file
31
pomerium/Chart.yaml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
apiVersion: v2
|
||||
appVersion: v0.22.0
|
||||
dependencies:
|
||||
- condition: redis.enabled
|
||||
name: redis
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
version: 17.0.9
|
||||
description: Pomerium is an identity-aware access proxy.
|
||||
home: http://www.pomerium.com/
|
||||
icon: https://www.pomerium.com/img/icon.svg
|
||||
keywords:
|
||||
- proxy
|
||||
- access-proxy
|
||||
- reverse-proxy
|
||||
- sso
|
||||
- openid connect
|
||||
- oauth2
|
||||
- authorization
|
||||
- authentication
|
||||
- google
|
||||
- okta
|
||||
- azure
|
||||
- auth0
|
||||
maintainers:
|
||||
- email: bdd@pomerium.io
|
||||
name: desimone
|
||||
- name: travisgroth
|
||||
name: pomerium
|
||||
sources:
|
||||
- https://github.com/pomerium/pomerium
|
||||
version: 34.0.1
|
||||
7
pomerium/OWNERS
Normal file
7
pomerium/OWNERS
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
approvers:
|
||||
- desimone
|
||||
- travisgroth
|
||||
reviewers:
|
||||
- desimone
|
||||
- victornoel
|
||||
- travisgroth
|
||||
927
pomerium/README.md
Normal file
927
pomerium/README.md
Normal file
|
|
@ -0,0 +1,927 @@
|
|||
# Pomerium
|
||||
|
||||
[Pomerium](https://pomerium.io) is an [open-source](https://github.com/pomerium/pomerium) tool for managing secure access to internal applications and resources.
|
||||
|
||||
- [Pomerium](#pomerium)
|
||||
- [DEPRECATION](#deprecation)
|
||||
- [TL;DR;](#tldr)
|
||||
- [Install the chart](#install-the-chart)
|
||||
- [Uninstalling the Chart](#uninstalling-the-chart)
|
||||
- [Pomerium Operator (DEPRECATED)](#pomerium-operator-deprecated)
|
||||
- [Pomerium operator has been replaced by Pomerium Ingress Controller. See `ingressController.config.operatorMode` for similar functionality.](#pomerium-operator-has-been-replaced-by-pomerium-ingress-controller-see-ingresscontrollerconfigoperatormode-for-similar-functionality)
|
||||
- [Pomerium Ingress Controller](#pomerium-ingress-controller)
|
||||
- [TLS Certificates](#tls-certificates)
|
||||
- [Ingress Controller Annotations](#ingress-controller-annotations)
|
||||
- [Auto Generation](#auto-generation)
|
||||
- [Self Provisioned](#self-provisioned)
|
||||
- [Signing Key](#signing-key)
|
||||
- [Auto Generation](#auto-generation-1)
|
||||
- [Self Provisioned](#self-provisioned-1)
|
||||
- [Kubernetes API Proxy](#kubernetes-api-proxy)
|
||||
- [Redis Subchart](#redis-subchart)
|
||||
- [Configuration](#configuration)
|
||||
- [Changelog](#changelog)
|
||||
- [33.0.0](#3300)
|
||||
- [32.0.0](#3200)
|
||||
- [31.2.0](#3120)
|
||||
- [31.0.0](#3100)
|
||||
- [30.0.0](#3000)
|
||||
- [29.0.0](#2900)
|
||||
- [28.0.0](#2800)
|
||||
- [27.0.0](#2700)
|
||||
- [26.0.0](#2600)
|
||||
- [25.0.1](#2501)
|
||||
- [25.0.0](#2500)
|
||||
- [24.0.0](#2400)
|
||||
- [23.2.0](#2320)
|
||||
- [23.1.0](#2310)
|
||||
- [23.0.0](#2300)
|
||||
- [22.1.0](#2210)
|
||||
- [22.0.0](#2200)
|
||||
- [21.0.1](#2101)
|
||||
- [21.0.0](#2100)
|
||||
- [20.0.0](#2000)
|
||||
- [19.1.0](#1910)
|
||||
- [19.0.0](#1900)
|
||||
- [18.0.0](#1800)
|
||||
- [17.0.0](#1700)
|
||||
- [16.0.0](#1600)
|
||||
- [15.0.0](#1500)
|
||||
- [14.0.0](#1400)
|
||||
- [13.0.0](#1300)
|
||||
- [11.0.0](#1100)
|
||||
- [10.2.0](#1020)
|
||||
- [10.0.0](#1000)
|
||||
- [8.5.5](#855)
|
||||
- [8.5.1](#851)
|
||||
- [8.5.0](#850)
|
||||
- [8.4.0](#840)
|
||||
- [8.0.0](#800)
|
||||
- [7.0.0](#700)
|
||||
- [6.0.0](#600)
|
||||
- [5.0.0](#500)
|
||||
- [4.0.0](#400)
|
||||
- [3.0.0](#300)
|
||||
- [2.0.0](#200)
|
||||
- [Upgrading](#upgrading)
|
||||
- [31.0.0](#3100-1)
|
||||
- [30.0.0](#3000-1)
|
||||
- [29.0.0](#2900-1)
|
||||
- [28.0.0](#2800-1)
|
||||
- [27.0.0](#2700-1)
|
||||
- [25.0.0](#2500-1)
|
||||
- [23.0.0](#2300-1)
|
||||
- [22.0.0](#2200-1)
|
||||
- [21.0.0](#2100-1)
|
||||
- [20.0.0](#2000-1)
|
||||
- [18.0.0](#1800-1)
|
||||
- [17.0.0](#1700-1)
|
||||
- [14.0.0](#1400-1)
|
||||
- [13.0.0](#1300-1)
|
||||
- [12.3.0](#1230)
|
||||
- [11.0.0](#1100-1)
|
||||
- [10.0.0](#1000-1)
|
||||
- [8.0.0](#800-1)
|
||||
- [7.0.0](#700-1)
|
||||
- [5.0.0](#500-1)
|
||||
- [4.0.0](#400-1)
|
||||
- [3.0.0](#300-1)
|
||||
- [2.0.0](#200-1)
|
||||
- [Metrics Discovery Configuration](#metrics-discovery-configuration)
|
||||
- [Prometheus Operator](#prometheus-operator)
|
||||
- [Prometheus kubernetes_sd_configs](#prometheus-kubernetes_sd_configs)
|
||||
|
||||
## DEPRECATION
|
||||
|
||||
Helm installation is no longer recommended for new deployments, please use [Manifests based deployment instead](https://www.pomerium.com/docs/k8s/quickstart).
|
||||
|
||||
## TL;DR;
|
||||
|
||||
```console
|
||||
helm install my-release pomerium/pomerium
|
||||
```
|
||||
|
||||
> Note: Pomerium depends on being configured with a third party identity providers to function properly. If you run pomerium without specifying default values, you will need to change those configuration variables following setup.
|
||||
|
||||
## Install the chart
|
||||
|
||||
An example of a minimal, but complete installation of pomerium with identity provider settings, random secrets, certificates, and external URLs is as follows:
|
||||
|
||||
```sh
|
||||
helm install my-release pomerium/pomerium\
|
||||
--set config.rootDomain="corp.beyondperimeter.com" \
|
||||
--set config.sharedSecret=$(head -c32 /dev/urandom | base64) \
|
||||
--set config.cookieSecret=$(head -c32 /dev/urandom | base64) \
|
||||
--set authenticate.idp.provider="google" \
|
||||
--set authenticate.idp.clientID="REPLACE_ME" \
|
||||
--set authenticate.idp.clientSecret="REPLACE_ME"
|
||||
```
|
||||
|
||||
## Uninstalling the Chart
|
||||
|
||||
To uninstall/delete the `my-release` deployment:
|
||||
|
||||
```console
|
||||
helm delete --purge my-release
|
||||
```
|
||||
|
||||
The command removes nearly all the Kubernetes components associated with the chart and deletes the release.
|
||||
|
||||
## Pomerium Operator (DEPRECATED)
|
||||
|
||||
### Pomerium operator has been replaced by [Pomerium Ingress Controller](https://github.com/pomerium/ingress-controller). See `ingressController.config.operatorMode` for similar functionality.
|
||||
|
||||
To provide dynamic pomerium configuration, an [operator](https://github.com/pomerium/pomerium-operator) is being introduced to this chart.
|
||||
|
||||
To enable pomerium-operator, set `operator.enabled` to `true`. Your existing values should continue to work as-is. Enabling it will allow you to take advantage of `Service` and `Ingress` annotations to dynamically configure pomerium policies.
|
||||
|
||||
See https://github.com/pomerium/pomerium-operator#using for information on how to use these annotations.
|
||||
|
||||
## Pomerium Ingress Controller
|
||||
|
||||
Use Pomerium as a first class secure-by-default Ingress Controller. Dynamicaly provision routes from `Ingress` resources and set policy based on `annotations`.
|
||||
|
||||
The Pomerium Ingress Controller functions similarly to the legacy Operator, but **does not** use forward auth or a third party ingress controller to function. For more details see the [Project Page](https://github.com/pomerium/ingress-controller) or [docs](https://www.pomerium.com/docs#TODO).
|
||||
|
||||
## TLS Certificates
|
||||
|
||||
### Ingress Controller Annotations
|
||||
|
||||
Pomerium uses TLS for all components. You may need to configure your ingress controller to communicate with pomerium over TLS.
|
||||
|
||||
### Auto Generation
|
||||
|
||||
In default configuration, this chart will automatically generate TLS certificates in a helm `pre-install` hook for the Pomerium services to communicate with.
|
||||
|
||||
Upon delete, you will need to manually delete the generated secrets. Example:
|
||||
|
||||
```console
|
||||
kubectl delete secret pomerium-authenticate-tls
|
||||
kubectl delete secret pomerium-authorize-tls
|
||||
kubectl delete secret pomerium-ca-tls
|
||||
kubectl delete secret pomerium-cache-tls
|
||||
kubectl delete secret pomerium-proxy-tls
|
||||
```
|
||||
|
||||
You may force recreation of your TLS certificates by setting `config.forceGenerateTLS` to `true`. Delete any existing TLS secrets first to prevent errors, and make sure you set back to `false` for your next helm upgrade command or your deployment will fail due to existing Secrets.
|
||||
|
||||
### Self Provisioned
|
||||
|
||||
If you wish to provide your own TLS certificates in secrets, you should:
|
||||
|
||||
1. turn `config.generateTLS` to `false`
|
||||
2. specify `authenticate.existingTLSSecret`, `authorize.existingTLSSecret`, and `proxy.existingTLSSecret`, pointing at the appropriate TLS certificate for each service.
|
||||
|
||||
All services can share the secret if appropriate.
|
||||
|
||||
## Signing Key
|
||||
|
||||
### Auto Generation
|
||||
|
||||
In default configuration, this chart will automatically generate a signing key in a helm `pre-install` hook for the Pomerium proxy to sign jwt sent in responses.
|
||||
|
||||
Upon delete, you will need to manually delete the generated secret. Example:
|
||||
|
||||
```console
|
||||
kubectl delete secret pomerium-signing-key
|
||||
```
|
||||
|
||||
You may force recreation of your signing key by setting `config.forceGenerateSigningKey` to `true`. Delete already existing signing key secret first to prevent errors, and make sure you set back to `false` for your next helm upgrade command or your deployment will fail due to existing Secret.
|
||||
|
||||
### Self Provisioned
|
||||
|
||||
If you wish to provide your own signing key in secret, you should:
|
||||
|
||||
1. turn `config.generateSigningKey` to `false`
|
||||
2. specify `config.existingSigningKeySecret` with secret's name
|
||||
|
||||
## Kubernetes API Proxy
|
||||
|
||||
Starting in `v0.10`, Pomerium supports delegated authentication for the Kubernetes API Server. In this model, Kubernetes delegates authentication to Pomerium, allowing Kubernetes RBAC policies to be applied to users authenticated by Pomerium.
|
||||
|
||||
This feature does not require running inside the cluster, but this chart supports setting this up with minimal
|
||||
configuration.
|
||||
|
||||
After setting `apiProxy.enabled`:
|
||||
|
||||
1. Add a policy entry (see `apiProxy` values for defaults):
|
||||
|
||||
```yaml
|
||||
- from: https://kubernetes.localhost.pomerium.io
|
||||
to: https://kubernetes.default.svc
|
||||
tls_skip_verify: true
|
||||
allowed_domains:
|
||||
- user@gmail.com
|
||||
```
|
||||
|
||||
2. Add role bindings:
|
||||
|
||||
```yaml
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: pomerium-admins
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: cluster-admin
|
||||
subjects:
|
||||
- apiGroup: rbac.authorization.k8s.io
|
||||
kind: User
|
||||
name: user@gmail.com
|
||||
```
|
||||
|
||||
See [docs.pomerium.io/docs/topics/data-storage.html#kubectl-auth](https://docs.pomerium.io/docs/topics/kubernetes-auth.html) for more detail and client setup.
|
||||
|
||||
## Redis Subchart
|
||||
|
||||
To support Pomerium's [storage requirements](https://www.pomerium.com/docs/topics/data-storage.html), a redis subchart can be included as part of your deployment. To enable it, simply set `redis.enabled` to `true`. The default configuration is intended to be secure but minimal. See `redis.*` options in the [configuration](#configuration) section for more options.
|
||||
|
||||
This subchart uses [Bitnami's Helm Chart](https://github.com/bitnami/charts/tree/master/bitnami/redis), adding a handful of pomerium-specific options to ease integration. All values starting with `redis.*` will be passed on to the redis subchart, allowing very flexible configuration. Unless specified as part of the Pomerium values file, the defaults from the subchart are used.
|
||||
|
||||
As with Pomerium's own [TLS certificate support](#tls-certificates), this chart allows you to automatically bootstrap a CA and certificates used for communication with/between redis instances. In production deployments, we recommend using an external certificate source such as [cert-manager](https://github.com/jetstack/cert-manager).
|
||||
|
||||
You may force recreation of these TLS certificates by setting `redis.forceGenerateTLS` to `true`. Delete the existing redis TLS secrets first to prevent errors, and make sure you set back to `false` for your next helm upgrade command or your deployment will fail due to existing Secrets.
|
||||
|
||||
If you are running in Istio or other secure service meshes, you may wish to set `redis.tls.enabled` to `false` to offload mtls to your mesh.
|
||||
|
||||
See [upgrade guide](#1230) to add to existing releases.
|
||||
|
||||
## Configuration
|
||||
|
||||
A full listing of Pomerium's configuration variables can be found on the [config reference page](https://www.pomerium.io/docs/reference/reference.html).
|
||||
|
||||
| Parameter | Description | Default |
|
||||
| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
|
||||
| `nameOverride` | Name of the chart. | `pomerium` |
|
||||
| `fullnameOverride` | Full name of the chart. | `pomerium` |
|
||||
| `config.rootDomain` | Root Domain specifies the sub-domain handled by pomerium. [See more](https://www.pomerium.io/docs/reference/reference.html#proxy-root-domains). | `corp.pomerium.io` |
|
||||
| `config.administrators` | Comma seperated list of email addresses of administrative users [See more](https://www.pomerium.io/configuration/#administrators). | Optional |
|
||||
| `config.existingSecret` | Name of the existing Kubernetes Secret. | |
|
||||
| `config.existingSharedSecret` | Name of the existing Kubernetes Secret for sensitive shared values such as `SHARED_SECRET`. This secret will be sourced via envFrom | |
|
||||
| `config.existingCASecret` | Name of the existing CA Secret. | |
|
||||
| `config.generateSigningKey` | Generate a signing key to sign jwt in proxy responses. Manual signing key can be set in values. | `true` |
|
||||
| `config.forceGenerateSigningKey` | Force recreation of generated signing key. You will need to restart your deployments after running | `false` |
|
||||
| `config.existingSigningKeySecret` | Name of existing Signing key Secret for proxy requests. | |
|
||||
| `config.signingKey` | Signing key is the base64 encoded key used to sign outbound requests. | |
|
||||
| `config.generateTLS` | Generate a dummy Certificate Authority and certs for service communication. Manual CA and certs can be set in values. | `true` |
|
||||
| `config.generateTLSAnnotations` | Annotations to be applied to generated TLS certificates. | `{}` |
|
||||
| `config.forceGenerateTLS` | Force recreation of generated TLS certificates. You will need to restart your deployments after running | `false` |
|
||||
| `config.insecure` | DANGER, this disables tls between services. Only do this if you know what you are doing. One reason might be that you want to offload tls to a reverse proxy (i.e. istio, traefik) | `false` |
|
||||
| `config.insecureProxy` | DANGER, this disables tls termination on the proxy service. Only do this if you know what you are doing. One reason might be that you want to offload tls to a reverse proxy (i.e. istio traefik) | `true` when `config.insecure=true` and `config.ingressController=false` |
|
||||
| `config.sharedSecret` | 256 bit key to secure service communication. [See more](https://www.pomerium.io/docs/reference/reference.html#shared-secret). | 32 [random ascii chars](http://masterminds.github.io/sprig/strings.html) |
|
||||
| `config.cookieSecret` | Cookie secret is a 32 byte key used to encrypt user sessions. | 32 [random ascii chars](http://masterminds.github.io/sprig/strings.html) |
|
||||
| `config.routes` | List of routes and their policies. Accepts template values or string templates. [See more](https://www.pomerium.com/reference/#routes). | |
|
||||
| `config.extraOpts` | Options Dictionary appended to the config file. May contain any additional config value that doesn't have its dedicated helm value counterpart. | {} |
|
||||
| `config.extraSecretLabels` | Labels to be applied to the Pomerium config secret. | {} |
|
||||
| `databroker` | Databroker configuration options. Supported in `v0.10+` | |
|
||||
| `databroker.clientTLS.ca` | Base64 encoded CA certificate for verifying the storage backend | |
|
||||
| `databroker.clientTLS.cert` | Base64 encoded TLS client certificate for connecting to the storage backend | |
|
||||
| `databroker.clientTLS.existingSecretName` | Name of existing secret with client certificates for the storage backend. Certificate is expected at `tls.crt` and key is expected at `tls.key` | |
|
||||
| `databroker.clientTLS.existingCASecretKey` | Name of data key to load a CA certificate from when using `databroker.clientTLS.existingSecretName` | |
|
||||
| `databroker.clientTLS.key` | Base64 encoded TLS client key for connecting to the storage backend | |
|
||||
| `databroker.storage.type` | Databroker storage backend. [See more](https://www.pomerium.io/reference/#cache-service) | `memory` |
|
||||
| `databroker.storage.connectionString` | Databroker connection string. [See more](https://www.pomerium.io/reference/#data-broker-storage-connection-string) | |
|
||||
| `databroker.storage.tlsSkipVerify` | Disable TLS verfication of storage backend service | `false` |
|
||||
| `extraEnv` | Set `env` variables on service pods | [] |
|
||||
| `extraEnvFrom` | Sets `envFrom` on service pods. Can be used to source ENV vars from existing secrets or configmaps. [Reference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#envfromsource-v1-core) | [] |
|
||||
| `extraTLSSecrets` | The secret names listed here will be automatically mounted and loaded into the pomerium [certificates](https://www.pomerium.com/reference/#certificates) parameter, using them for HTTPS listeners | [] |
|
||||
| `extraVolumes` | Set volumes on service pods | [] |
|
||||
| `extraVolumeMounts` | Set volumeMounts on service containers | [] |
|
||||
| `apiProxy` | Kubernetes API Server proxy configuration options. Supported in pomerium `v0.10+` | |
|
||||
| `apiProxy.enabled` | Create service account, RBAC and ingress rules to proxy to the kubernetes api server on this cluster | `false` |
|
||||
| `apiProxy.ingress` | When `apiProxy.enabled` is `true`, inject an entry into the pomerium ingress resource | true |
|
||||
| `apiProxy.fullNameOverride` | Set the FQDN to the kubernetes api server in the ingress resource | `kubernetes.{{config.rootDomain}}` |
|
||||
| `apiProxy.name` | non-FQDN of kubernet4es api server in the ingress resource | `kubernetes` |
|
||||
| `authenticate.nameOverride` | Name of the authenticate service. | `authenticate` |
|
||||
| `authenticate.fullnameOverride` | Full name of the authenticate service. | `authenticate` |
|
||||
| `authenticate.idp.provider` | Identity [Provider Name](https://www.pomerium.io/docs/reference/reference.html#identity-provider-name). | `google` |
|
||||
| `authenticate.idp.clientID` | Identity Provider oauth [client ID](https://www.pomerium.io/docs/reference/reference.html#identity-provider-client-id). | Required |
|
||||
| `authenticate.idp.clientSecret` | Identity Provider oauth [client secret](https://www.pomerium.io/docs/reference/reference.html#identity-provider-client-secret). | Required |
|
||||
| `authenticate.idp.url` | Identity [Provider URL](https://www.pomerium.io/docs/reference/reference.html#identity-provider-url). | Optional |
|
||||
| `authenticate.idp.scopes` | Identity [Provider Scopes](https://www.pomerium.io/configuration/#identity-provider-scopes). | Optional |
|
||||
| `authenticate.ingress.tls.secretName` | When using Pomerium Ingress Controller, the name of the TLS secret for the `authenticate` Ingress resource. If left unset, you may receive a non-deterministic certificate for requests to `authenticate.${rootDomain}`. This may become [pinned](https://www.ssl2buy.com/wiki/how-to-clear-hsts-settings-on-chrome-firefox-and-ie-browsers) if you are using HSTS. | `{}` |
|
||||
| `authenticate.ingress.annotations` | When using Pomerium Ingress Controller, set the annotations on the `authenticate` Ingress resource. Example: `cert-manager.io/cluster-issuer: letsencrypt-prod-http` | `{}` |
|
||||
| `authenticate.replicaCount` | Number of Authenticate pods to run | `1` |
|
||||
| `authenticate.autoscaling.enabled` | Enable Horizontal Pod Autoscaler for Authenticate pods | false |
|
||||
| `authenticate.autoscaling.minReplicas` | Minimum number of pods in the Authenticate deployment | `1` |
|
||||
| `authenticate.autoscaling.maxReplicas` | Maximum number of pods in the Authenticate deployment | `5` |
|
||||
| `authenticate.autoscaling.targetCPUUtilizationPercentage` | Target CPU utilization, averaged across pods (as a percent) | `50` |
|
||||
| `authenticate.autoscaling.targetMemoryUtilizationPercentage` | Target Memory utilization, averaged across pods (as a percent) | `50` |
|
||||
| `authenticate.pdb.enabled` | Enable PodDisruptionBudget for Authenticate deployment | false |
|
||||
| `authenticate.pdb.minAvailable` | Number of Authenticate pods that must be available, can be a number or percentage | `1` |
|
||||
| `authenticate.existingTLSSecret` | Name of existing TLS Secret for authenticate service | |
|
||||
| `authenticate.existingExternalTLSSecret` | Name of existing TLS Secret containing authenticate's public/external TLS certificate | |
|
||||
| `authenticate.deployment.annotations` | Annotations for the authenticate deployment. If none given, then use value of `annotations` | `{}` |
|
||||
| `authenticate.deployment.extraEnv` | Set env variables on authenticate pods | `[]` |
|
||||
| `authenticate.deployment.podAnnotations` | Annotations for the authenticate deployment pods | `{}` |
|
||||
| `authenticate.name` | Set a custom authenticate url by setting a subdomain | `authenticate` |
|
||||
| `authenticate.service.annotations` | Annotations for the authenticate service. If none given, then use value of `service.annotations` | `{}` |
|
||||
| `authenticate.service.nodePort` | Specify the nodePort when using service type NodePort | |
|
||||
| `authenticate.service.type` | Specify the service type (ClusterIP, NodePort or LoadBalancer) for the authenticate service | `ClusterIP` |
|
||||
| `authenticate.serviceAccount.annotations` | Annotations for the authenticate service account | `{}` |
|
||||
| `authenticate.serviceAccount.nameOverride` | Override the name of the authenticate pod service account | `pomerium-authenticate` |
|
||||
| `authenticate.tls.cert` | TLS certificate for authenticate service | |
|
||||
| `authenticate.tls.key` | TLS key for authenticate service | |
|
||||
| `authenticate.proxied` | When `ingress.enabled` is false, add a `policy` entry for the authenticate service. This allows the proxy service to route traffic for `authenticate` directly | `true` |
|
||||
| `proxy.nameOverride` | Name of the proxy service. | `proxy` |
|
||||
| `proxy.fullnameOverride` | Full name of the proxy service. | `proxy` |
|
||||
| `proxy.authenticateServiceUrl` | The externally accessible url for the authenticate service. | `https://{{authenticate.name}}.{{config.rootDomain}}` |
|
||||
| `proxy.replicaCount` | Number of Proxy pods to run | `1` |
|
||||
| `proxy.autoscaling.enabled` | Enable Horizontal Pod Autoscaler for Proxy pods | false |
|
||||
| `proxy.autoscaling.minReplicas` | Minimum number of pods in the Proxy deployment | `1` |
|
||||
| `proxy.autoscaling.maxReplicas` | Maximum number of pods in the Proxy deployment | `5` |
|
||||
| `proxy.autoscaling.targetCPUUtilizationPercentage` | Target CPU utilization, averaged across pods (as a percent) | `50` |
|
||||
| `proxy.autoscaling.targetMemoryUtilizationPercentage` | Target Memory utilization, averaged across pods (as a percent) | `50` |
|
||||
| `proxy.pdb.enabled` | Enable PodDisruptionBudget for Proxy deployment | false |
|
||||
| `proxy.pdb.minAvailable` | Number of Proxy pods that must be available, can be a number or percentage | `1` |
|
||||
| `proxy.existingTLSSecret` | Name of existing TLS Secret for proxy service | |
|
||||
| `proxy.deployment.annotations` | Annotations for the proxy deployment. If none given, then use value of `annotations` | `{}` |
|
||||
| `proxy.deployment.extraEnv` | Set env variables on proxy pods | `[]` |
|
||||
| `proxy.deployment.podAnnotations` | Annotations for the proxy deployment pods | `{}` |
|
||||
| `proxy.redirectServer` | Expose redirect server for http->https on port 80 of the proxy service | `false` |
|
||||
| `proxy.service.annotations` | Annotations for the proxy service. If none given, then use value of `service.annotations` | `{}` |
|
||||
| `proxy.service.externalTrafficPolicy` | Sets `service.spec.externalTrafficPolicy` for the pomerium proxy service. Set to `Local` to ensure the proxy is able to see client IPs accurately. [See more](https://kubernetes.io/docs/tutorials/services/source-ip/). | |
|
||||
| `proxy.service.nodePort` | Specify the nodePort when using service type NodePort | |
|
||||
| `proxy.service.type` | Specify the service type (ClusterIP, NodePort or LoadBalancer) for the proxy service | `ClusterIP` |
|
||||
| `proxy.service.externalIPs` | Specify the ExternalIPs that are routed to the proxy service | `ClusterIP` |
|
||||
| `proxy.serviceAccount.annotations` | Annotations for the proxy service account | `{}` |
|
||||
| `proxy.serviceAccount.nameOverride` | Override the name of the proxy pod service account | `pomerium-authenticate` |
|
||||
| `proxy.tls.cert` | TLS certificate for proxy service | |
|
||||
| `proxy.tls.key` | TLS key for proxy service | |
|
||||
| `authorize.nameOverride` | Name of the authorize service. | `authorize` |
|
||||
| `authorize.fullnameOverride` | Full name of the authorize service. | `authorize` |
|
||||
| `authorize.replicaCount` | Number of Authorize pods to run | `1` |
|
||||
| `authorize.autoscaling.enabled` | Enable Horizontal Pod Autoscaler for Authorize pods | false |
|
||||
| `authorize.autoscaling.minReplicas` | Minimum number of pods in the Authorize deployment | `1` |
|
||||
| `authorize.autoscaling.maxReplicas` | Maximum number of pods in the Authorize deployment | `5` |
|
||||
| `authorize.autoscaling.targetCPUUtilizationPercentage` | Target CPU utilization, averaged across pods (as a percent) | `50` |
|
||||
| `authorize.autoscaling.targetMemoryUtilizationPercentage` | Target Memory utilization, averaged across pods (as a percent) | `50` |
|
||||
| `authorize.pdb.enabled` | Enable PodDisruptionBudget for Authorize deployment | false |
|
||||
| `authorize.pdb.minAvailable` | Number of Authorize pods that must be available, can be a number or percentage | `1` |
|
||||
| `authorize.existingTLSSecret` | Name of existing TLS Secret for authorize service | |
|
||||
| `forwardAuth.name` | External name of the forward-auth endpoint | `forwardauth.${rootDomain}` |
|
||||
| `forwardAuth.enabled` | Enable forward-auth endpoint for third party ingress controllers to use for auth checks. Setting this disables automatic enumeration of `from` hostnames in the Pomerium Ingress object to prevent conflicts. Use `ingress.hosts` to mix forward-auth and proxy mode on a single Pomerium instance | `false` |
|
||||
| `forwardAuth.internal` | If enabled no ingress is created for forwardAuth, making forwardAuth ony accessible as internal service. | `false` |
|
||||
| `authorize.deployment.annotations` | Annotations for the authorize deployment. If none given, then use value of `annotations` | `{}` |
|
||||
| `authorize.deployment.extraEnv` | Set env variables on authorize pods | `[]` |
|
||||
| `authorize.deployment.podAnnotations` | Annotations for the authorize deployment pods | `{}` |
|
||||
| `authorize.service.annotations` | Annotations for the authorize service. If none given, then use value of `service.annotations` | `{}` |
|
||||
| `authorize.service.clusterIP` | Specify the `clusterIP` for the authorize service. The default uses headless mode. | `None` |
|
||||
| `authorize.service.type` | Specify the service type (ClusterIP, NodePort or LoadBalancer) for the authorize service | `ClusterIP` |
|
||||
| `authorize.serviceAccount.annotations` | Annotations for the authorize service account | `{}` |
|
||||
| `authorize.serviceAccount.nameOverride` | Override the name of the authorize pod service account | `pomerium-authenticate` |
|
||||
| `authorize.tls.cert` | TLS certificate for authorize service | |
|
||||
| `authorize.tls.key` | TLS key for authorize service | |
|
||||
| `image.repository` | Pomerium image | `pomerium/pomerium` |
|
||||
| `image.tag` | Pomerium image tag | `v0.6.2` |
|
||||
| `image.pullPolicy` | Pomerium image pull policy | `IfNotPresent` |
|
||||
| `service.annotations` | Service annotations | `{}` |
|
||||
| `service.externalPort` | Pomerium's port | `443` if `config.insecure` is `false`. `80` if `config.insecure` is `true` |
|
||||
| `service.grpcTrafficPort.nameOverride` | Override name of grpc port in services. Only use if required for protocol detection by mesh or ingress services | `https`/`grpc` in `secure`/`insecure` mode |
|
||||
| `service.httpTrafficPort.nameOverride` | Override name of http port in services. Only use if required for protocol detection by mesh or ingress services. Set to `http2` for istio when offloading mtls to the mesh. | `https`/`http` in `secure`/`insecure` mode |
|
||||
| `serviceMonitor.enabled` | Create Prometheus Operator ServiceMonitor | `false` |
|
||||
| `serviceMonitor.namespace` | Namespace to create the ServiceMonitor resource in | The namespace of the chart |
|
||||
| `serviceMonitor.labels` | Additional labels to apply to the ServiceMonitor resource | `release: prometheus` |
|
||||
| `tracing.enabled` | Enable distributed tracing | `false` |
|
||||
| `tracing.debug` | Set trace sampling to 100%. Use with caution! | `false` |
|
||||
| `tracing.provider` | Specifies the tracing provider to configure (Valid options: Jaeger) | Required |
|
||||
| `tracing.jaeger.collector_endpoint` | The jaeger collector endpoint | Required |
|
||||
| `tracing.jaeger.agent_endpoint` | The jaeger agent endpoint | Required |
|
||||
| `ingress.enabled` | Enables Ingress for pomerium | `true` |
|
||||
| `ingress.className` | ingressClassName for ingress resource | Optional |
|
||||
| `ingress.annotations` | Ingress annotations. Ensure you set appropriate annotations for TLS backend and large URLs if using Azure. | `{}` |
|
||||
| `ingress.pathType` | Ingress pathType (e.g. ImplementationSpecific, Prefix, .. etc.) might also be required by some Ingress Controllers | `ImplementationSpecific` |
|
||||
| `ingress.hosts` | Ingress accepted hostnames | `[]` |
|
||||
| `ingress.secretName` | Existing TLS certificate secret for Ingress | `[]` |
|
||||
| `ingress.secret.cert` | Base64 encoded TLS certificate for Ingress | |
|
||||
| `ingress.secret.key` | Base64 encoded TLS key for Ingress | |
|
||||
| `ingress.secret.name` | Secret to store Ingress TLS certificates in | `pomerium-tls` |
|
||||
| `ingress.tls.hosts` | Override automatic ingress tls hosts list | `[]` |
|
||||
| `metrics.enabled` | Enable prometheus metrics endpoint | `false` |
|
||||
| `metrics.port` | Prometheus metrics endpoint port | `9090` |
|
||||
| `databroker.deployment.extraEnv` | Set env variables on cache pods | `[]` |
|
||||
| `databroker.deployment.podAnnotations` | Annotations for the databroker deployment pods | `{}` |
|
||||
| `cache.nameOverride` | Name of the cache service. | `cache` |
|
||||
| `cache.fullnameOverride` | Full name of the cache service. | `cache` |
|
||||
| `databroker.replicaCount` | Number of cache pods to run | `1` |
|
||||
| `databroker.pdb.enabled` | Enable PodDisruptionBudget for Cache deployment | false |
|
||||
| `databroker.pdb.minAvailable` | Number of pods that must be available, can be a number or percentage | `1` |
|
||||
| `databroker.service.annotations` | Annotations for the cache service. If none given, then use value of `service.annotations` | `{}` |
|
||||
| `databroker.service.clusterIP` | Specify the `clusterIP` for the cache service. The default uses headless mode. | `None` |
|
||||
| `databroker.service.type` | Specify the service type (ClusterIP, NodePort or LoadBalancer) for the cache service | `ClusterIP` |
|
||||
| `databroker.serviceAccount.annotations` | Annotations for the cache service account | `{}` |
|
||||
| `databroker.serviceAccount.nameOverride` | Override the name of the cache pod service account | `pomerium-authenticate` |
|
||||
| `databroker.tls.cert` | TLS certificate for cache service | |
|
||||
| `databroker.tls.key` | TLS key for cache service | |
|
||||
| `databroker.existingTLSSecret` | Name of existing TLS Secret for authorize service | |
|
||||
| `operator.enabled` | Enable experimental pomerium operator support | false |
|
||||
| `operator.nameOverride` | Name of the operator | `operator` |
|
||||
| `operator.fullnameOverride` | Full name of the operator | `operator` |
|
||||
| `operator.replicaCount` | Number of operator pods to run | `1` |
|
||||
| `operator.image.repository` | Pomerium Operator image | `pomerium/pomerium-operator` |
|
||||
| `operator.image.tag` | Pomerium Operator image tag | `v0.0.1-rc1` |
|
||||
| `operator.config.ingressClass` | `kubernetes.io/ingress.class` for the operator to monitor | `pomerium` |
|
||||
| `operator.config.serviceClass` | `kubernetes.io/service.class` for the operator to monitor | `pomerium` |
|
||||
| `operator.config.debug` | Enable Pomerium Operator debug logging | `false` |
|
||||
| `operator.deployment.annotations` | Annotations for the operator deployment. | `{}` |
|
||||
| `operator.serviceAccount.annotations` | Annotations for the operator pod service account. If none given, then use value of `annotations` | `{}` |
|
||||
| `operator.serviceAccount.nameOverride` | Override the name of the operator pod service account | `pomerium-operator` |
|
||||
| `redis.replica.replicaCount` | Number of redis replicas to run. [More](https://github.com/bitnami/charts/tree/master/bitnami/redis#parameters) | `1` |
|
||||
| `redis.enabled` | Enable a redis master-slave subchart deployment based on https://github.com/bitnami/charts/tree/master/bitnami/redis | `false` |
|
||||
| `redis.auth.createSecret` | Create the secret to store redis password and connect string. Set to `false` if you wish to use a secret not managed by this helm chart | `true` |
|
||||
| `redis.auth.existingSecret` | Secret used to store authentication password for redis. This is shared between Pomerium and redis. [More](https://github.com/bitnami/charts/tree/master/bitnami/redis#parameters) | `pomerium-redis-password` |
|
||||
| `redis.auth.existingSecretPasswordKey` | Name of key containing password in `redis.existingSecret`. [More](https://github.com/bitnami/charts/tree/master/bitnami/redis#parameters) | `password` |
|
||||
| `redis.forceGenerateTLS` | Force re-generation of TLS certificates used to communicate with redis | `false` |
|
||||
| `redis.generateTLS` | Automatically generate a new CA and certificate pair to communicate with redis | `true` |
|
||||
| `redis.tls.certCAFilename` | Name of secret key containing CA certificate for verify TLS certificates. [More](https://github.com/bitnami/charts/tree/master/bitnami/redis#parameters) | `ca.crt` |
|
||||
| `redis.tls.certFilename` | Name of secret key containing certificate for TLS connections. [More](https://github.com/bitnami/charts/tree/master/bitnami/redis#parameters) | `tls.crt` |
|
||||
| `redis.tls.certificateSecret` | Name of secret containing TLS CA, certificate and private key. [More](https://github.com/bitnami/charts/tree/master/bitnami/redis#parameters) | `pomerium-redis-tls` |
|
||||
| `redis.tls.certKeyFilename` | Name of secret key containing private key for TLS connections. [More](https://github.com/bitnami/charts/tree/master/bitnami/redis#parameters) | `tls.key` |
|
||||
| `redis.tls.enabled` | Require TLS communication with redis. [More](https://github.com/bitnami/charts/tree/master/bitnami/redis#parameters) | `true` |
|
||||
| `ingressController.enabled` | Enable Pomerium Ingress Controller support | false |
|
||||
| `ingressController.nameOverride` | Name of the ingressController | `ingressController` |
|
||||
| `ingressController.fullnameOverride` | Full name of the ingressController | `ingressController` |
|
||||
| `ingressController.replicaCount` | Number of ingressController pods to run | `1` |
|
||||
| `ingressController.image.repository` | Pomerium ingressController image | `pomerium/ingress-controller` |
|
||||
| `ingressController.image.tag` | Pomerium ingressController image tag | `v0.15.0` |
|
||||
| `ingressController.ingressClassResource.enabled` | Create a IngressClass resource for the Ingress Controller | `true` |
|
||||
| `ingressController.ingressClassResource.default` | Set the IngressClass resource as default | `false` |
|
||||
| `ingressController.ingressClassResource.name` | Name of the IngressClass resource | `pomerium` |
|
||||
| `ingressController.ingressClassResource.controllerName` | IngressClass controller name | `pomerium.io/ingress-controller` |
|
||||
| `ingressController.ingressClassResource.parameters` | Additional parameters for the IngressClass | `{}` |
|
||||
| `ingressController.ingressClassResource.defaultCertSecret` | Specify a default TLS certificate for Ingress resources that do not specify their own. Format: [namespace]/[name] | |
|
||||
| `ingressController.config.ingressClass` | `kubernetes.io/ingress.class` for the ingressController to monitor | `pomerium.io/ingress-controller` |
|
||||
| `ingressController.config.namespaces` | List of namespaces to monitor for `Ingress` resources. Defaults to all. | `[]` |
|
||||
| `ingressController.config.operatorMode` | Run Ingress Controller as a replacement for the Pomerium Operator. This implies using Forward-Auth and a third party Proxy. | |
|
||||
| `ingressController.config.updateStatus` | Update `Ingress` resource with status from the Proxy service | `true` |
|
||||
| `ingressController.deployment.annotations` | Annotations for the ingressController deployment. | `{}` |
|
||||
| `ingressController.deployment.podAnnotations` | Annotations for the ingressController deployment pods. | `{}` |
|
||||
| `ingressController.serviceAccount.annotations` | Annotations for the ingressController pod service account. If none given, then use value of `annotations` | `{}` |
|
||||
| `ingressController.serviceAccount.nameOverride` | Override the name of the ingressController pod service account | `pomerium-ingressController` |
|
||||
|
||||
## Changelog
|
||||
|
||||
### 34.0.0
|
||||
|
||||
- Upgrade to Pomerium Core v0.22.2, that addresses a critical security vulnerability [GHSA-pvrc-wvj2-f59p](https://github.com/pomerium/pomerium/security/advisories/GHSA-pvrc-wvj2-f59p)
|
||||
|
||||
### 33.0.0
|
||||
|
||||
- `idp.serviceAccount` is removed. Please see the [Upgrade Guide](https://www.pomerium.com/docs/overview/upgrading#since-0200)
|
||||
- Update to v0.20.0 of Pomerium
|
||||
|
||||
### 32.0.0
|
||||
|
||||
- Update to v0.18 of Pomerium
|
||||
- option `--disable-cert-check` is no longer required, as certificates are not enforced
|
||||
|
||||
### 31.2.0
|
||||
|
||||
- Allow Proxy Service to use ExteralIPs
|
||||
|
||||
### 31.0.0
|
||||
|
||||
- Update to v0.17 of Pomerium
|
||||
- Require `authenticate.ingress.tls.secretName` if `config.generateTLS` is not enabled
|
||||
|
||||
### 30.0.0
|
||||
|
||||
- Revert breaking config changes in 29.0.0
|
||||
- Add `redis.auth.createSecret` flag
|
||||
|
||||
### 29.0.0
|
||||
|
||||
- Allow specifying an existing secret for redis authentication
|
||||
- Update redis subchart from v14 to v16
|
||||
|
||||
### 28.0.0
|
||||
|
||||
- A previous breaking change from 25.0.0 was fully completed.
|
||||
- The deprecated `cache` service has been completely removed.
|
||||
|
||||
### 27.0.0
|
||||
|
||||
- Add better support for terminating TLS at the edge of a service mesh via `config.insecureProxy` and additional logic when `config.insecure` is set.
|
||||
- Add `[service].deployment.podAnnotations`.
|
||||
- See https://github.com/pomerium/pomerium-helm/pull/238 for additional details.
|
||||
|
||||
### 26.0.0
|
||||
|
||||
- Updated Pomerium to v0.16.0
|
||||
|
||||
### 25.0.1
|
||||
|
||||
- Updated Pomerium images to v0.15.6 to mitigate [CVE-2021-41230](https://github.com/pomerium/pomerium/security/advisories/GHSA-j6wp-3859-vxfg).
|
||||
|
||||
### 25.0.0
|
||||
|
||||
- `config.policy` has been renamed to `config.routes` to match preferred upstream syntax.
|
||||
- Pomerium Operator has been replaced with [Pomerium Ingress Controller](https://github.com/pomerium/ingress-controller).
|
||||
- Secrets which can be generated for users are now persisted automatically. This includes `config.sharedSecret`, `config.cookieSecret`, and redis passwords.
|
||||
- Sensitive secrets that users typically provide from external sources can more easily be sourced via `config.existingSharedSecret`.
|
||||
|
||||
### 24.0.0
|
||||
|
||||
- Update default Pomerium to v0.15. See [v0.15 Upgrade Notes](https://www.pomerium.com/docs/upgrading.html#since-0-14-0).
|
||||
|
||||
### 23.2.0
|
||||
|
||||
- Added support for newer Ingress API versions e.g. `networking.k8s.io/v1` as well as the `pathType` property required by such versions.
|
||||
|
||||
### 23.1.0
|
||||
|
||||
- Removed unnecessary `"` (quotation mark) from the `address` and `grpc_address` config fields in the static config template.
|
||||
|
||||
### 23.0.0
|
||||
|
||||
- Rename `forwardAuth.nameOverride` for consistency
|
||||
- Split operator service account annotations from deployment annotations
|
||||
- Relocate `ingress.authenticate.name` for consistency
|
||||
- Removed unused option `authenticate.RedirectURL`
|
||||
|
||||
### 22.1.0
|
||||
|
||||
- Added `extraSecretLabels` option to configure additional labels to put on the Pomerium config secret.
|
||||
|
||||
### 22.0.0
|
||||
|
||||
- Explictly update redis dependency to v14.x.x. See [upgrade notes](#2200-1) for details.
|
||||
|
||||
### 21.0.1
|
||||
|
||||
- Fixed typo in `authenticate.serviceAccount.annotations` config
|
||||
|
||||
### 21.0.0
|
||||
|
||||
- Removed `subPath` from TLS `volumeMount`. This allows changes to the underlying secret to be seen without recreating the pod. If you are using `config.existingSecret` and directly managing your own configuration secret, see [upgrade notes](#2100-1) for details.
|
||||
|
||||
### 20.0.0
|
||||
|
||||
- Renamed all `cache` resources to `databroker`. This keeps the terminology in the chart aligned with core Pomerium documentation. See [upgrade notes](#2000-1) for details.
|
||||
Specific changes:
|
||||
- Rename `cache` deployment, pdb, pod, and service account to `databroker`
|
||||
- Add new `databroker` service pointing to the `databroker` pods. The existing `cache` service will be removed in a future version.
|
||||
- Move `cache` related values under `databroker` section in `values.yaml`
|
||||
- Remove deprecated `service.type` and related values
|
||||
|
||||
### 19.1.0
|
||||
|
||||
- Configure a route for the authenticate service if ingress is disabled. This allows users to route all pomerium related traffic through the Pomerium proxy service in Loadbalancer or NodePort configuration.
|
||||
|
||||
### 19.0.0
|
||||
|
||||
- Update to Pomerium `v0.14`. See [v0.14 Upgrade Notes](https://www.pomerium.com/docs/upgrading.html#since-0-13-0).
|
||||
|
||||
### 18.0.0
|
||||
|
||||
- Removing Helm v2 support. See [v18.0.0 Upgrade Notes](#1800-1) to migrate.
|
||||
|
||||
### 17.0.0
|
||||
|
||||
- Values for Service related settings have been deprecated. See [v17.0.0 Upgrade Nodes](#1700-1) to migrate.
|
||||
- You may now specify `service.type` for each Pomerium service.
|
||||
- `extraTLSSecrets` may now be used to list secrets to mount and use as listener TLS certificates
|
||||
|
||||
### 16.0.0
|
||||
|
||||
- Update to Pomerium `v0.13`. See [v0.13 Upgrade Notes](https://www.pomerium.com/docs/upgrading.html#since-0-12-0).
|
||||
|
||||
### 15.0.0
|
||||
|
||||
- Update to Pomerium `v0.12`. See [v0.12 Upgrade Notes](https://www.pomerium.com/docs/upgrading.html#since-0-11-0).
|
||||
|
||||
### 14.0.0
|
||||
|
||||
- Update to Pomerium `v0.11`. See [v0.11 Upgrade Notes](https://www.pomerium.com/docs/upgrading.html#since-0-10-0).
|
||||
|
||||
### 13.0.0
|
||||
|
||||
- `config.existingSigningKeySecret` updated to have correct camelCase. Additionally uses of `authorize.existingsigningKeySecret` and `authorize.signingKey` have been updated to the correct `config.` block. See [v13.0.0 Upgrade Nodes](#1300-1) to migrate.
|
||||
|
||||
### 11.0.0
|
||||
|
||||
- Signing key has been refactored to correspond with Pomerium changes. See [v11.0.0 Upgrade Nodes](#1100-1) to migrate.
|
||||
|
||||
### 10.2.0
|
||||
|
||||
- Update port names in insecure mode to address Istio protocol detection.
|
||||
|
||||
### 10.0.0
|
||||
|
||||
- Refactor shared configuration logic to be driven by named templates. See [v10.0.0 Upgrade Nodes](#1000-1) to migrate.
|
||||
|
||||
### 8.5.5
|
||||
|
||||
- Fix: Set not only the service but also the namespace when `forwardAuth.internal == true`
|
||||
|
||||
### 8.5.1
|
||||
|
||||
- Add documentation for `extraOpts` flag, remove `policyFile` flag as it isn't implemented.
|
||||
|
||||
### 8.5.0
|
||||
|
||||
- Add `forwardAuth.internal` flag to not expose forwardAuth over ingress. Useful for cases where the ingress should not set trustedIPs.
|
||||
|
||||
### 8.4.0
|
||||
|
||||
- Add `config.insecure` flag in order to support running Pomerium in non-tls mode to play well with reverse proxy's like Istio's envoy
|
||||
|
||||
### 8.0.0
|
||||
|
||||
- Pomerium `ConfigMap` and `Secret` were combined into a single `Secret`. See [v8.0.0 Upgrade Nodes](#800-1) to migrate
|
||||
|
||||
### 7.0.0
|
||||
|
||||
- Add automatic signing key generation. See [v7.0.0 Upgrade Nodes](#700-1) to migrate
|
||||
|
||||
### 6.0.0
|
||||
|
||||
- Integrate pomerium operator
|
||||
- Remove legacy TLS config support. See [v3.0.0 Upgrade Notes](#300-1) to migrate
|
||||
|
||||
### 5.0.0
|
||||
|
||||
- Upgrade to Pomerium v0.6.0
|
||||
- Add cache service
|
||||
|
||||
### 4.0.0
|
||||
|
||||
- Upgrade to Pomerium v0.4.0
|
||||
- Handle breaking changes from Pomerium
|
||||
|
||||
### 3.0.0
|
||||
|
||||
- Refactor TLS certificates to use Kubernetes TLS secrets
|
||||
- Generate TLS certificates in a hook to prevent certificate churn
|
||||
|
||||
### 2.0.0
|
||||
|
||||
- Expose replica count for individual services
|
||||
- Switch Authorize service to ClusterIP for client side load balancing
|
||||
- You must run pomerium v0.3.0+ to support this feature correctly
|
||||
|
||||
## Upgrading
|
||||
|
||||
### 31.0.0
|
||||
|
||||
- See [v0.17 upgrade guide](https://www.pomerium.com/docs/upgrading.html#since-0-16-0)
|
||||
- If you have set `config.generateTLS=false` and are using the Ingress Controller, be sure you have provied a proper external certificate via `authenticate.ingress.tls.secretName`
|
||||
|
||||
### 30.0.0
|
||||
|
||||
- Rename `redis.auth.secret` to `redis.auth.existingSecret` in your values file
|
||||
|
||||
### 29.0.0
|
||||
|
||||
- Rename `redis.auth.existingSecret` to `redis.auth.secret` in your values file
|
||||
- Follow the [upstream guide](https://github.com/bitnami/charts/tree/master/bitnami/redis#to-1600) for redis
|
||||
|
||||
### 28.0.0
|
||||
|
||||
- Users should ensure they no longer depend on the `pomerium-cache` service name for telemetry or other operations. Migrate any configuration referencing the `pomerium-cache` service to consume the `pomerium-databroker` service. `pomerium-cache` has been deprecated since (#2000-1)
|
||||
- Ensure the upgrade steps for (#2500-1) were fully completed. This chart version includes breaking changes that were unintentionally omitted from 25.0.0.
|
||||
|
||||
Specifically:
|
||||
|
||||
Users of `config.existingSecret` should move `cookie_secret` and `shared_secret` to be explicitly set in your helm values OR put into a secondary secret as `COOKIE_SECRET` and `SHARED_SECRET` and referenced by `config.existingSharedSecret`. As a third option, you may remove the values from your current secret and let new ones be generated and persisted for you.
|
||||
|
||||
### 27.0.0
|
||||
|
||||
- Users of `config.insecure=true` in a service mesh:
|
||||
- If you set `ingressController.enabled=true`, the proxy will run in secure mode (terminating TLS) with the rest of the services insecure. Set `config.insecureProxy=true` to restore previous behavior.
|
||||
|
||||
### 25.0.0
|
||||
|
||||
- Rename `config.policy` to `config.routes` in your values file
|
||||
- Users of Pomerium Operator
|
||||
- set `ingressController.enabled=true`
|
||||
- set `ingressController.ingressClass` to your old `operator.ingressClass` value (eg `nginx`)
|
||||
- set `ingressController.config.operatorMode=true`
|
||||
- remove references to `operator.*` from your values
|
||||
- **NOTE:** `Service` resources (`operator.config.serviceClass`) are no longer supported at this time
|
||||
- Users of `extraEnvFrom` to pull in values such as `SHARED_SECRET`, `COOKIE_SECRET`, and `IDP_CLIENT_SECRET` may now use `config.existingSharedSecret`
|
||||
- Users of `config.existingSecret` should move `cookie_secret` and `shared_secret` to be explicitly set in your helm values OR put into a secondary secret as `COOKIE_SECRET` and `SHARED_SECRET` and referenced by `config.existingSharedSecret`. As a third option, you may remove the values from your current secret and let new ones be generated and persisted for you.
|
||||
|
||||
### 23.0.0
|
||||
|
||||
- Rename `ingress.authenticate.name` to `authenticate.name`
|
||||
- If using annotations on your Operator service account, rename or copy `operator.deployment.annotations` to `operator.serviceAccount.annotations`
|
||||
- Rename `forwardAuth.nameOverride` to `forwardAuth.name`
|
||||
|
||||
### 22.0.0
|
||||
|
||||
- Users of the redis subchart with password secret value overrides:
|
||||
- rename `redis.existingSecretPasswordKey` to `redis.auth.existingSecret`
|
||||
- rename `redis.existingSecret` to `redis.auth.existingSecretPasswordKey`
|
||||
|
||||
### 21.0.0
|
||||
|
||||
- Users of `config.existingSecret`:
|
||||
- Change `certificate_file` to `/pomerium/tls/tls.crt`
|
||||
- Change `certificate_key_file` to `/pomerium/tls/tls.key`
|
||||
- Change `certificate_authority_file` to `/pomerium/ca/ca.crt`
|
||||
|
||||
### 20.0.0
|
||||
|
||||
1. Update TLS settings
|
||||
- If you are relying on `config.generateTLS=true` to automatically generate certificates, set `config.forceGenerateTLS=true` when upgrading. This will update your certificates with the new service name. You may set this back to false after the upgrade.
|
||||
- If you are externally generating TLS certificates, _add_ the SAN `pomerium-databroker.[namespace].svc.cluster.local` to your cache certificate _before_ upgrading. The exact service name may vary if you've used service name overrides.
|
||||
- You may delete the `pomerium-cache-tls` secret after upgrade.
|
||||
2. Update values
|
||||
- Rename any values prefixed with `cache.*` to `databroker.*`. Example: `cache.replicas` becomes `databroker.replicas`.
|
||||
- [yq](https://github.com/mikefarah/yq) can be used to automate this on an existing values file:
|
||||
```shell
|
||||
yq eval '. * {"databroker": .cache} | del(.cache)' pomerium-values.yaml
|
||||
```
|
||||
3. Name overrides
|
||||
- To assist with the upgrade, the `cache` service will remain until a future version. If you are using `cache.nameOverride` or `cache.fullnameOverride` to customize the service name, those settings will still be respected for the `cache` service.
|
||||
|
||||
### 18.0.0
|
||||
|
||||
- This version deprecates Helm v2 support. To upgrade from Helm v2 to Helm v3 follow [this guide](https://helm.sh/blog/migrate-from-helm-v2-to-helm-v3/)
|
||||
|
||||
### 17.0.0
|
||||
|
||||
- If you are disabling headless service mode for `authorize` or `cache` via `service.headless.*`:
|
||||
- specify `authorize.service.clusterIP=""` to disable headless mode for authorize
|
||||
- specify `cache.service.clusterIP=""` to disable headless mode for cache
|
||||
- If you are specifying `service.type`, specify `[service name].service.type` for each service you wish to customize. They are now
|
||||
set independently.
|
||||
|
||||
### 14.0.0
|
||||
|
||||
- No chart changes are required. See Pomerium [v0.11 Upgrade Notes](https://www.pomerium.com/docs/upgrading.html#since-0-10-0).
|
||||
|
||||
### 13.0.0
|
||||
|
||||
- `existingsigningKeySecret` has been corrected to `existingSigningKeySecret` and properly standardized to the `config` block in all use cases.
|
||||
- If you were specifying `config.existingsigningKeySecret`, update the value to the correct casing.
|
||||
- If you were using `authorize.existingsigningKeySecret` and `authorize.signingKey` to create a signing key with the value from `config.signingKey` there should not be an impact, but the deprecated values can be removed.
|
||||
|
||||
### 12.3.0
|
||||
|
||||
- If using the new `redis` support and you wish to use the automatic tls generation, set `redis.forceGenerateTLS` to ensure the new secrets are generated. After the upgrade is complete, you should set `redis.forceGenerateTLS` to `false` (the default) again.
|
||||
|
||||
### 11.0.0
|
||||
|
||||
- SigningKey is now under the `config` block.
|
||||
|
||||
- If you are specifying `proxy.signingKeySecret` or `proxy.existingSigningKeySecret`, please change the values to be `config.signingKeySecret` or `config.existingSigningKeySecret`
|
||||
- If were relying on automatic signing key generation do one of the following:
|
||||
|
||||
1. set `config.forceGenerateSigningKey` to `true` for the upgrade
|
||||
2. replace [RELEASE NAME] with your release name and run:
|
||||
|
||||
```console
|
||||
kubectl get secret [RELEASE NAME]-proxy-signing-key -o json | jq '. | .metadata.name = (.metadata.name | sub("(?<x>\\w+)-proxy-signing-key";"\(.x)-signing-key") )' | kubectl apply -f -
|
||||
```
|
||||
|
||||
### 10.0.0
|
||||
|
||||
- All shared configuration has been moved from ENV vars to a configuration file. Users of `config.existingSecret` must specify **all** parameters in their secret or leverage `extraEnv` to pass in overrides.
|
||||
|
||||
Some of the impacted chart values and their equivilent settings are listed below:
|
||||
|
||||
| Chart Value | Config Parameter |
|
||||
| ------------------------------ | ----------------------------------- |
|
||||
| `authenticate.idp.provider` | `idp_provider` |
|
||||
| `authenticate.idp.url` | `idp_provider_url` |
|
||||
| `authenticate.cacheServiceUrl` | `cache_service_url` |
|
||||
| `authenticate.idp.scopes` | `idp_scopes` |
|
||||
| `config.insecure` | `insecure_server` + `grpc_insecure` |
|
||||
| `proxy.authenticateServiceUrl` | `authenticate_service_url` |
|
||||
| `proxy.authorizeInternalUrl` | `authorize_service_url` |
|
||||
|
||||
Other settings required in your `config.existingSecret` or `extraEnv`:
|
||||
|
||||
- `CACHE_SERVICE_URL=[your cache service url]`
|
||||
- `AUTHENTICATE_SERVICE_URL=[your authenticate service url]`
|
||||
- `CERTIFICATE_FILE="/pomerium/cert.pem"`
|
||||
- `CERTIFICATE_KEY_FILE="/pomerium/privkey.pem"`
|
||||
- `CERTIFICATE_AUTHORITY_FILE="/pomerium/ca.pem"`
|
||||
|
||||
If you are not using `config.existingSecret` you should not need to make any changes.
|
||||
|
||||
### 8.0.0
|
||||
|
||||
- `config.existingConfig` `ConfigMap` has been merged with `config.existingSecret` `Secret`. All keys from `config.existingConfig` were moved to the `config.existingSecret`
|
||||
- `config.existingSecret` structure has been changed:
|
||||
|
||||
- all top level keys were moved under the `config.yaml` section
|
||||
- naming of the top level keys was changed from `cookie-secret` to `cookie_secret` according to [the `config.yaml` format](https://www.pomerium.io/configuration/#shared-settings) (basically `'-'` was changed to the `'_'`)
|
||||
|
||||
- `config.existingConfig` and `config.existingSecret` cannot be used separately anymore
|
||||
- If `config.existingConfig` and `config.existingSecret` options weren't used no actions are required
|
||||
|
||||
### 7.0.0
|
||||
|
||||
- A signing key is now automatically generated, similar to TLS secrets.
|
||||
- If upgrading an install you should temporarily set `config.forceGenerateSigningKey` to `true` and generate this key during upgrade.
|
||||
|
||||
### 5.0.0
|
||||
|
||||
- A new service, cache, was added to this chart release.
|
||||
- If upgrading an install where pomerium had previously generated your certificates, you should set `config.forceGenerateTLS` to `true` and regenerate your certifcates during upgrade.
|
||||
- If upgrading an install which used custom certificates, be sure to set `config.existingTLSSecret` and add a new TLS certificate for the cache service.
|
||||
- See [Pomerium Changelog](https://www.pomerium.io/docs/upgrading.html#since-0-5-0) for details
|
||||
|
||||
### 4.0.0
|
||||
|
||||
- There are no user facing changes in this chart release
|
||||
- See [Pomerium Changelog](https://www.pomerium.io/docs/upgrading.html#since-0-3-0) for internal details
|
||||
|
||||
### 3.0.0
|
||||
|
||||
- This version moves all certificates to TLS secrets.
|
||||
- If you have existing generated certificates:
|
||||
- Let pomerium regenerate your certificates during upgrade
|
||||
- set `config.forceGenerateTLS` to `true`
|
||||
- upgrade
|
||||
- set `config.forceGenerateTLS` to `false`
|
||||
- **OR:** To retain your certificates
|
||||
- save your existing pomerium secret
|
||||
- set `config.existingLegacyTLSSecret` to `true`
|
||||
- set `config.existingConfig` to point to your configuration secret
|
||||
- upgrade
|
||||
- re-create pomerium secret from saved yaml
|
||||
- If you have externally sourced certificates in your pomerium secret:
|
||||
- [Move and convert your certificates](scripts/upgrade-v3.0.0.sh) to type TLS Secrets and configure `[service].existingTLSSecret` to point to your secrets
|
||||
- **OR:** To continue using your certificates from the existing config, set `config.existingLegacyTLSSecret` to `true`
|
||||
|
||||
---
|
||||
|
||||
### 2.0.0
|
||||
|
||||
- You will need to run `helm upgrade --force` to recreate the authorize service correctly
|
||||
|
||||
## Metrics Discovery Configuration
|
||||
|
||||
This chart provides two ways to surface metrics for discovery. Under normal circumstances, you will only set up one method.
|
||||
|
||||
### Prometheus Operator
|
||||
|
||||
This chart assumes you have already installed the Prometheus Operator CRDs.
|
||||
|
||||
Example chart values:
|
||||
|
||||
```yaml
|
||||
metrics:
|
||||
enabled: true
|
||||
port: 9090 # default
|
||||
serviceMonitor:
|
||||
enabled: true
|
||||
labels:
|
||||
release: prometheus # default
|
||||
```
|
||||
|
||||
Example ServiceMonitor configuration:
|
||||
|
||||
```yaml
|
||||
serviceMonitorSelector:
|
||||
matchLabels:
|
||||
release: prometheus # operator chart default
|
||||
```
|
||||
|
||||
### Prometheus kubernetes_sd_configs
|
||||
|
||||
Example chart values:
|
||||
|
||||
```yaml
|
||||
metrics:
|
||||
enabled: true
|
||||
port: 9090 # default
|
||||
service:
|
||||
annotations:
|
||||
prometheus.io/scrape: 'true'
|
||||
prometheus.io/port: '9090'
|
||||
```
|
||||
|
||||
Example prometheus discovery config:
|
||||
|
||||
```yaml
|
||||
- job_name: 'pomerium'
|
||||
metrics_path: /metrics
|
||||
kubernetes_sd_configs:
|
||||
- role: endpoints
|
||||
relabel_configs:
|
||||
- source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scrape]
|
||||
action: keep
|
||||
regex: true
|
||||
- source_labels: [__meta_kubernetes_service_label_app_kubernetes_io_instance]
|
||||
action: keep
|
||||
regex: pomerium
|
||||
- action: labelmap
|
||||
regex: __meta_kubernetes_service_label_(.+)
|
||||
- source_labels: [__meta_kubernetes_namespace]
|
||||
action: replace
|
||||
target_label: kubernetes_namespace
|
||||
- source_labels: [__meta_kubernetes_service_name]
|
||||
action: replace
|
||||
target_label: kubernetes_name
|
||||
- source_labels: [__address__, __meta_kubernetes_service_annotation_prometheus_io_port]
|
||||
action: replace
|
||||
regex: ([^:]+)(?::\d+)?;(\d+)
|
||||
replacement: $1:$2
|
||||
target_label: __address__
|
||||
```
|
||||
21
pomerium/charts/redis/.helmignore
Normal file
21
pomerium/charts/redis/.helmignore
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# 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
|
||||
6
pomerium/charts/redis/Chart.lock
Normal file
6
pomerium/charts/redis/Chart.lock
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
dependencies:
|
||||
- name: common
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
version: 1.16.1
|
||||
digest: sha256:bcc717c6a14262fac51e6434020ee5dd6148b864fe6cff6266c1d481df4a0c91
|
||||
generated: "2022-07-19T02:56:32.290624716Z"
|
||||
28
pomerium/charts/redis/Chart.yaml
Normal file
28
pomerium/charts/redis/Chart.yaml
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
annotations:
|
||||
category: Database
|
||||
apiVersion: v2
|
||||
appVersion: 7.0.4
|
||||
dependencies:
|
||||
- name: common
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
tags:
|
||||
- bitnami-common
|
||||
version: 1.x.x
|
||||
description: Redis(R) is an open source, advanced key-value store. It is often referred
|
||||
to as a data structure server since keys can contain strings, hashes, lists, sets
|
||||
and sorted sets.
|
||||
home: https://github.com/bitnami/charts/tree/master/bitnami/redis
|
||||
icon: https://bitnami.com/assets/stacks/redis/img/redis-stack-220x234.png
|
||||
keywords:
|
||||
- redis
|
||||
- keyvalue
|
||||
- database
|
||||
maintainers:
|
||||
- name: Bitnami
|
||||
url: https://github.com/bitnami/charts
|
||||
- email: cedric@desaintmartin.fr
|
||||
name: desaintmartin
|
||||
name: redis
|
||||
sources:
|
||||
- https://github.com/bitnami/containers/tree/main/bitnami/redis
|
||||
version: 17.0.9
|
||||
898
pomerium/charts/redis/README.md
Normal file
898
pomerium/charts/redis/README.md
Normal file
|
|
@ -0,0 +1,898 @@
|
|||
<!--- app-name: Redis® -->
|
||||
|
||||
# Bitnami package for Redis(R)
|
||||
|
||||
Redis(R) is an open source, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.
|
||||
|
||||
[Overview of Redis®](http://redis.io)
|
||||
|
||||
Disclaimer: Redis is a registered trademark of Redis Ltd. Any rights therein are reserved to Redis Ltd. Any use by Bitnami is for referential purposes only and does not indicate any sponsorship, endorsement, or affiliation between Redis Ltd.
|
||||
|
||||
## TL;DR
|
||||
|
||||
```bash
|
||||
$ helm repo add bitnami https://charts.bitnami.com/bitnami
|
||||
$ helm install my-release bitnami/redis
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
||||
This chart bootstraps a [Redis®](https://github.com/bitnami/containers/tree/main/bitnami/redis) deployment on a [Kubernetes](https://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
|
||||
|
||||
Bitnami charts can be used with [Kubeapps](https://kubeapps.dev/) for deployment and management of Helm Charts in clusters.
|
||||
|
||||
### Choose between Redis® Helm Chart and Redis® Cluster Helm Chart
|
||||
|
||||
You can choose any of the two Redis® Helm charts for deploying a Redis® cluster.
|
||||
|
||||
1. [Redis® Helm Chart](https://github.com/bitnami/charts/tree/master/bitnami/redis) will deploy a master-replica cluster, with the [option](https://github.com/bitnami/charts/tree/master/bitnami/redis#redis-sentinel-configuration-parameters) of enabling using Redis® Sentinel.
|
||||
2. [Redis® Cluster Helm Chart](https://github.com/bitnami/charts/tree/master/bitnami/redis-cluster) will deploy a Redis® Cluster topology with sharding.
|
||||
|
||||
The main features of each chart are the following:
|
||||
|
||||
| Redis® | Redis® Cluster |
|
||||
|--------------------------------------------------------|------------------------------------------------------------------------|
|
||||
| Supports multiple databases | Supports only one database. Better if you have a big dataset |
|
||||
| Single write point (single master) | Multiple write points (multiple masters) |
|
||||
|  |  |
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Kubernetes 1.19+
|
||||
- Helm 3.2.0+
|
||||
- PV provisioner support in the underlying infrastructure
|
||||
|
||||
## Installing the Chart
|
||||
|
||||
To install the chart with the release name `my-release`:
|
||||
|
||||
```bash
|
||||
$ helm install my-release bitnami/redis
|
||||
```
|
||||
|
||||
The command deploys Redis® on the Kubernetes cluster in the default configuration. The [Parameters](#parameters) section lists the parameters that can be configured during installation.
|
||||
|
||||
> **Tip**: List all releases using `helm list`
|
||||
|
||||
## Uninstalling the Chart
|
||||
|
||||
To uninstall/delete the `my-release` deployment:
|
||||
|
||||
```bash
|
||||
$ helm delete my-release
|
||||
```
|
||||
|
||||
The command removes all the Kubernetes components associated with the chart and deletes the release.
|
||||
|
||||
## Parameters
|
||||
|
||||
### Global parameters
|
||||
|
||||
| Name | Description | Value |
|
||||
| ------------------------- | ------------------------------------------------------ | ----- |
|
||||
| `global.imageRegistry` | Global Docker image registry | `""` |
|
||||
| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` |
|
||||
| `global.storageClass` | Global StorageClass for Persistent Volume(s) | `""` |
|
||||
| `global.redis.password` | Global Redis® password (overrides `auth.password`) | `""` |
|
||||
|
||||
|
||||
### Common parameters
|
||||
|
||||
| Name | Description | Value |
|
||||
| ------------------------ | --------------------------------------------------------------------------------------- | --------------- |
|
||||
| `kubeVersion` | Override Kubernetes version | `""` |
|
||||
| `nameOverride` | String to partially override common.names.fullname | `""` |
|
||||
| `fullnameOverride` | String to fully override common.names.fullname | `""` |
|
||||
| `commonLabels` | Labels to add to all deployed objects | `{}` |
|
||||
| `commonAnnotations` | Annotations to add to all deployed objects | `{}` |
|
||||
| `secretAnnotations` | Annotations to add to secret | `{}` |
|
||||
| `clusterDomain` | Kubernetes cluster domain name | `cluster.local` |
|
||||
| `extraDeploy` | Array of extra objects to deploy with the release | `[]` |
|
||||
| `diagnosticMode.enabled` | Enable diagnostic mode (all probes will be disabled and the command will be overridden) | `false` |
|
||||
| `diagnosticMode.command` | Command to override all containers in the deployment | `["sleep"]` |
|
||||
| `diagnosticMode.args` | Args to override all containers in the deployment | `["infinity"]` |
|
||||
|
||||
|
||||
### Redis® Image parameters
|
||||
|
||||
| Name | Description | Value |
|
||||
| ------------------- | ----------------------------------------------------- | --------------------- |
|
||||
| `image.registry` | Redis® image registry | `docker.io` |
|
||||
| `image.repository` | Redis® image repository | `bitnami/redis` |
|
||||
| `image.tag` | Redis® image tag (immutable tags are recommended) | `7.0.4-debian-11-r11` |
|
||||
| `image.pullPolicy` | Redis® image pull policy | `IfNotPresent` |
|
||||
| `image.pullSecrets` | Redis® image pull secrets | `[]` |
|
||||
| `image.debug` | Enable image debug mode | `false` |
|
||||
|
||||
|
||||
### Redis® common configuration parameters
|
||||
|
||||
| Name | Description | Value |
|
||||
| -------------------------------- | ------------------------------------------------------------------------------------- | ------------- |
|
||||
| `architecture` | Redis® architecture. Allowed values: `standalone` or `replication` | `replication` |
|
||||
| `auth.enabled` | Enable password authentication | `true` |
|
||||
| `auth.sentinel` | Enable password authentication on sentinels too | `true` |
|
||||
| `auth.password` | Redis® password | `""` |
|
||||
| `auth.existingSecret` | The name of an existing secret with Redis® credentials | `""` |
|
||||
| `auth.existingSecretPasswordKey` | Password key to be retrieved from existing secret | `""` |
|
||||
| `auth.usePasswordFiles` | Mount credentials as files instead of using an environment variable | `false` |
|
||||
| `commonConfiguration` | Common configuration to be added into the ConfigMap | `""` |
|
||||
| `existingConfigmap` | The name of an existing ConfigMap with your custom configuration for Redis® nodes | `""` |
|
||||
|
||||
|
||||
### Redis® master configuration parameters
|
||||
|
||||
| Name | Description | Value |
|
||||
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ------------------------ |
|
||||
| `master.count` | Number of Redis® master instances to deploy (experimental, requires additional configuration) | `1` |
|
||||
| `master.configuration` | Configuration for Redis® master nodes | `""` |
|
||||
| `master.disableCommands` | Array with Redis® commands to disable on master nodes | `["FLUSHDB","FLUSHALL"]` |
|
||||
| `master.command` | Override default container command (useful when using custom images) | `[]` |
|
||||
| `master.args` | Override default container args (useful when using custom images) | `[]` |
|
||||
| `master.preExecCmds` | Additional commands to run prior to starting Redis® master | `[]` |
|
||||
| `master.extraFlags` | Array with additional command line flags for Redis® master | `[]` |
|
||||
| `master.extraEnvVars` | Array with extra environment variables to add to Redis® master nodes | `[]` |
|
||||
| `master.extraEnvVarsCM` | Name of existing ConfigMap containing extra env vars for Redis® master nodes | `""` |
|
||||
| `master.extraEnvVarsSecret` | Name of existing Secret containing extra env vars for Redis® master nodes | `""` |
|
||||
| `master.containerPorts.redis` | Container port to open on Redis® master nodes | `6379` |
|
||||
| `master.startupProbe.enabled` | Enable startupProbe on Redis® master nodes | `false` |
|
||||
| `master.startupProbe.initialDelaySeconds` | Initial delay seconds for startupProbe | `20` |
|
||||
| `master.startupProbe.periodSeconds` | Period seconds for startupProbe | `5` |
|
||||
| `master.startupProbe.timeoutSeconds` | Timeout seconds for startupProbe | `5` |
|
||||
| `master.startupProbe.failureThreshold` | Failure threshold for startupProbe | `5` |
|
||||
| `master.startupProbe.successThreshold` | Success threshold for startupProbe | `1` |
|
||||
| `master.livenessProbe.enabled` | Enable livenessProbe on Redis® master nodes | `true` |
|
||||
| `master.livenessProbe.initialDelaySeconds` | Initial delay seconds for livenessProbe | `20` |
|
||||
| `master.livenessProbe.periodSeconds` | Period seconds for livenessProbe | `5` |
|
||||
| `master.livenessProbe.timeoutSeconds` | Timeout seconds for livenessProbe | `5` |
|
||||
| `master.livenessProbe.failureThreshold` | Failure threshold for livenessProbe | `5` |
|
||||
| `master.livenessProbe.successThreshold` | Success threshold for livenessProbe | `1` |
|
||||
| `master.readinessProbe.enabled` | Enable readinessProbe on Redis® master nodes | `true` |
|
||||
| `master.readinessProbe.initialDelaySeconds` | Initial delay seconds for readinessProbe | `20` |
|
||||
| `master.readinessProbe.periodSeconds` | Period seconds for readinessProbe | `5` |
|
||||
| `master.readinessProbe.timeoutSeconds` | Timeout seconds for readinessProbe | `1` |
|
||||
| `master.readinessProbe.failureThreshold` | Failure threshold for readinessProbe | `5` |
|
||||
| `master.readinessProbe.successThreshold` | Success threshold for readinessProbe | `1` |
|
||||
| `master.customStartupProbe` | Custom startupProbe that overrides the default one | `{}` |
|
||||
| `master.customLivenessProbe` | Custom livenessProbe that overrides the default one | `{}` |
|
||||
| `master.customReadinessProbe` | Custom readinessProbe that overrides the default one | `{}` |
|
||||
| `master.resources.limits` | The resources limits for the Redis® master containers | `{}` |
|
||||
| `master.resources.requests` | The requested resources for the Redis® master containers | `{}` |
|
||||
| `master.podSecurityContext.enabled` | Enabled Redis® master pods' Security Context | `true` |
|
||||
| `master.podSecurityContext.fsGroup` | Set Redis® master pod's Security Context fsGroup | `1001` |
|
||||
| `master.containerSecurityContext.enabled` | Enabled Redis® master containers' Security Context | `true` |
|
||||
| `master.containerSecurityContext.runAsUser` | Set Redis® master containers' Security Context runAsUser | `1001` |
|
||||
| `master.kind` | Use either Deployment or StatefulSet (default) | `StatefulSet` |
|
||||
| `master.schedulerName` | Alternate scheduler for Redis® master pods | `""` |
|
||||
| `master.updateStrategy.type` | Redis® master statefulset strategy type | `RollingUpdate` |
|
||||
| `master.priorityClassName` | Redis® master pods' priorityClassName | `""` |
|
||||
| `master.hostAliases` | Redis® master pods host aliases | `[]` |
|
||||
| `master.podLabels` | Extra labels for Redis® master pods | `{}` |
|
||||
| `master.podAnnotations` | Annotations for Redis® master pods | `{}` |
|
||||
| `master.shareProcessNamespace` | Share a single process namespace between all of the containers in Redis® master pods | `false` |
|
||||
| `master.podAffinityPreset` | Pod affinity preset. Ignored if `master.affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||
| `master.podAntiAffinityPreset` | Pod anti-affinity preset. Ignored if `master.affinity` is set. Allowed values: `soft` or `hard` | `soft` |
|
||||
| `master.nodeAffinityPreset.type` | Node affinity preset type. Ignored if `master.affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||
| `master.nodeAffinityPreset.key` | Node label key to match. Ignored if `master.affinity` is set | `""` |
|
||||
| `master.nodeAffinityPreset.values` | Node label values to match. Ignored if `master.affinity` is set | `[]` |
|
||||
| `master.affinity` | Affinity for Redis® master pods assignment | `{}` |
|
||||
| `master.nodeSelector` | Node labels for Redis® master pods assignment | `{}` |
|
||||
| `master.tolerations` | Tolerations for Redis® master pods assignment | `[]` |
|
||||
| `master.topologySpreadConstraints` | Spread Constraints for Redis® master pod assignment | `[]` |
|
||||
| `master.dnsPolicy` | DNS Policy for Redis® master pod | `""` |
|
||||
| `master.dnsConfig` | DNS Configuration for Redis® master pod | `{}` |
|
||||
| `master.lifecycleHooks` | for the Redis® master container(s) to automate configuration before or after startup | `{}` |
|
||||
| `master.extraVolumes` | Optionally specify extra list of additional volumes for the Redis® master pod(s) | `[]` |
|
||||
| `master.extraVolumeMounts` | Optionally specify extra list of additional volumeMounts for the Redis® master container(s) | `[]` |
|
||||
| `master.sidecars` | Add additional sidecar containers to the Redis® master pod(s) | `[]` |
|
||||
| `master.initContainers` | Add additional init containers to the Redis® master pod(s) | `[]` |
|
||||
| `master.persistence.enabled` | Enable persistence on Redis® master nodes using Persistent Volume Claims | `true` |
|
||||
| `master.persistence.medium` | Provide a medium for `emptyDir` volumes. | `""` |
|
||||
| `master.persistence.sizeLimit` | Set this to enable a size limit for `emptyDir` volumes. | `""` |
|
||||
| `master.persistence.path` | The path the volume will be mounted at on Redis® master containers | `/data` |
|
||||
| `master.persistence.subPath` | The subdirectory of the volume to mount on Redis® master containers | `""` |
|
||||
| `master.persistence.storageClass` | Persistent Volume storage class | `""` |
|
||||
| `master.persistence.accessModes` | Persistent Volume access modes | `["ReadWriteOnce"]` |
|
||||
| `master.persistence.size` | Persistent Volume size | `8Gi` |
|
||||
| `master.persistence.annotations` | Additional custom annotations for the PVC | `{}` |
|
||||
| `master.persistence.selector` | Additional labels to match for the PVC | `{}` |
|
||||
| `master.persistence.dataSource` | Custom PVC data source | `{}` |
|
||||
| `master.persistence.existingClaim` | Use a existing PVC which must be created manually before bound | `""` |
|
||||
| `master.service.type` | Redis® master service type | `ClusterIP` |
|
||||
| `master.service.ports.redis` | Redis® master service port | `6379` |
|
||||
| `master.service.nodePorts.redis` | Node port for Redis® master | `""` |
|
||||
| `master.service.externalTrafficPolicy` | Redis® master service external traffic policy | `Cluster` |
|
||||
| `master.service.extraPorts` | Extra ports to expose (normally used with the `sidecar` value) | `[]` |
|
||||
| `master.service.internalTrafficPolicy` | Redis® master service internal traffic policy (requires Kubernetes v1.22 or greater to be usable) | `Cluster` |
|
||||
| `master.service.clusterIP` | Redis® master service Cluster IP | `""` |
|
||||
| `master.service.loadBalancerIP` | Redis® master service Load Balancer IP | `""` |
|
||||
| `master.service.loadBalancerSourceRanges` | Redis® master service Load Balancer sources | `[]` |
|
||||
| `master.service.annotations` | Additional custom annotations for Redis® master service | `{}` |
|
||||
| `master.service.sessionAffinity` | Session Affinity for Kubernetes service, can be "None" or "ClientIP" | `None` |
|
||||
| `master.service.sessionAffinityConfig` | Additional settings for the sessionAffinity | `{}` |
|
||||
| `master.terminationGracePeriodSeconds` | Integer setting the termination grace period for the redis-master pods | `30` |
|
||||
|
||||
|
||||
### Redis® replicas configuration parameters
|
||||
|
||||
| Name | Description | Value |
|
||||
| -------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------ |
|
||||
| `replica.replicaCount` | Number of Redis® replicas to deploy | `3` |
|
||||
| `replica.configuration` | Configuration for Redis® replicas nodes | `""` |
|
||||
| `replica.disableCommands` | Array with Redis® commands to disable on replicas nodes | `["FLUSHDB","FLUSHALL"]` |
|
||||
| `replica.command` | Override default container command (useful when using custom images) | `[]` |
|
||||
| `replica.args` | Override default container args (useful when using custom images) | `[]` |
|
||||
| `replica.preExecCmds` | Additional commands to run prior to starting Redis® replicas | `[]` |
|
||||
| `replica.extraFlags` | Array with additional command line flags for Redis® replicas | `[]` |
|
||||
| `replica.extraEnvVars` | Array with extra environment variables to add to Redis® replicas nodes | `[]` |
|
||||
| `replica.extraEnvVarsCM` | Name of existing ConfigMap containing extra env vars for Redis® replicas nodes | `""` |
|
||||
| `replica.extraEnvVarsSecret` | Name of existing Secret containing extra env vars for Redis® replicas nodes | `""` |
|
||||
| `replica.externalMaster.enabled` | Use external master for bootstrapping | `false` |
|
||||
| `replica.externalMaster.host` | External master host to bootstrap from | `""` |
|
||||
| `replica.externalMaster.port` | Port for Redis service external master host | `6379` |
|
||||
| `replica.containerPorts.redis` | Container port to open on Redis® replicas nodes | `6379` |
|
||||
| `replica.startupProbe.enabled` | Enable startupProbe on Redis® replicas nodes | `true` |
|
||||
| `replica.startupProbe.initialDelaySeconds` | Initial delay seconds for startupProbe | `10` |
|
||||
| `replica.startupProbe.periodSeconds` | Period seconds for startupProbe | `10` |
|
||||
| `replica.startupProbe.timeoutSeconds` | Timeout seconds for startupProbe | `5` |
|
||||
| `replica.startupProbe.failureThreshold` | Failure threshold for startupProbe | `22` |
|
||||
| `replica.startupProbe.successThreshold` | Success threshold for startupProbe | `1` |
|
||||
| `replica.livenessProbe.enabled` | Enable livenessProbe on Redis® replicas nodes | `true` |
|
||||
| `replica.livenessProbe.initialDelaySeconds` | Initial delay seconds for livenessProbe | `20` |
|
||||
| `replica.livenessProbe.periodSeconds` | Period seconds for livenessProbe | `5` |
|
||||
| `replica.livenessProbe.timeoutSeconds` | Timeout seconds for livenessProbe | `5` |
|
||||
| `replica.livenessProbe.failureThreshold` | Failure threshold for livenessProbe | `5` |
|
||||
| `replica.livenessProbe.successThreshold` | Success threshold for livenessProbe | `1` |
|
||||
| `replica.readinessProbe.enabled` | Enable readinessProbe on Redis® replicas nodes | `true` |
|
||||
| `replica.readinessProbe.initialDelaySeconds` | Initial delay seconds for readinessProbe | `20` |
|
||||
| `replica.readinessProbe.periodSeconds` | Period seconds for readinessProbe | `5` |
|
||||
| `replica.readinessProbe.timeoutSeconds` | Timeout seconds for readinessProbe | `1` |
|
||||
| `replica.readinessProbe.failureThreshold` | Failure threshold for readinessProbe | `5` |
|
||||
| `replica.readinessProbe.successThreshold` | Success threshold for readinessProbe | `1` |
|
||||
| `replica.customStartupProbe` | Custom startupProbe that overrides the default one | `{}` |
|
||||
| `replica.customLivenessProbe` | Custom livenessProbe that overrides the default one | `{}` |
|
||||
| `replica.customReadinessProbe` | Custom readinessProbe that overrides the default one | `{}` |
|
||||
| `replica.resources.limits` | The resources limits for the Redis® replicas containers | `{}` |
|
||||
| `replica.resources.requests` | The requested resources for the Redis® replicas containers | `{}` |
|
||||
| `replica.podSecurityContext.enabled` | Enabled Redis® replicas pods' Security Context | `true` |
|
||||
| `replica.podSecurityContext.fsGroup` | Set Redis® replicas pod's Security Context fsGroup | `1001` |
|
||||
| `replica.containerSecurityContext.enabled` | Enabled Redis® replicas containers' Security Context | `true` |
|
||||
| `replica.containerSecurityContext.runAsUser` | Set Redis® replicas containers' Security Context runAsUser | `1001` |
|
||||
| `replica.schedulerName` | Alternate scheduler for Redis® replicas pods | `""` |
|
||||
| `replica.updateStrategy.type` | Redis® replicas statefulset strategy type | `RollingUpdate` |
|
||||
| `replica.priorityClassName` | Redis® replicas pods' priorityClassName | `""` |
|
||||
| `replica.podManagementPolicy` | podManagementPolicy to manage scaling operation of %%MAIN_CONTAINER_NAME%% pods | `""` |
|
||||
| `replica.hostAliases` | Redis® replicas pods host aliases | `[]` |
|
||||
| `replica.podLabels` | Extra labels for Redis® replicas pods | `{}` |
|
||||
| `replica.podAnnotations` | Annotations for Redis® replicas pods | `{}` |
|
||||
| `replica.shareProcessNamespace` | Share a single process namespace between all of the containers in Redis® replicas pods | `false` |
|
||||
| `replica.podAffinityPreset` | Pod affinity preset. Ignored if `replica.affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||
| `replica.podAntiAffinityPreset` | Pod anti-affinity preset. Ignored if `replica.affinity` is set. Allowed values: `soft` or `hard` | `soft` |
|
||||
| `replica.nodeAffinityPreset.type` | Node affinity preset type. Ignored if `replica.affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||
| `replica.nodeAffinityPreset.key` | Node label key to match. Ignored if `replica.affinity` is set | `""` |
|
||||
| `replica.nodeAffinityPreset.values` | Node label values to match. Ignored if `replica.affinity` is set | `[]` |
|
||||
| `replica.affinity` | Affinity for Redis® replicas pods assignment | `{}` |
|
||||
| `replica.nodeSelector` | Node labels for Redis® replicas pods assignment | `{}` |
|
||||
| `replica.tolerations` | Tolerations for Redis® replicas pods assignment | `[]` |
|
||||
| `replica.topologySpreadConstraints` | Spread Constraints for Redis® replicas pod assignment | `[]` |
|
||||
| `replica.dnsPolicy` | DNS Policy for Redis® replica pods | `""` |
|
||||
| `replica.dnsConfig` | DNS Configuration for Redis® replica pods | `{}` |
|
||||
| `replica.lifecycleHooks` | for the Redis® replica container(s) to automate configuration before or after startup | `{}` |
|
||||
| `replica.extraVolumes` | Optionally specify extra list of additional volumes for the Redis® replicas pod(s) | `[]` |
|
||||
| `replica.extraVolumeMounts` | Optionally specify extra list of additional volumeMounts for the Redis® replicas container(s) | `[]` |
|
||||
| `replica.sidecars` | Add additional sidecar containers to the Redis® replicas pod(s) | `[]` |
|
||||
| `replica.initContainers` | Add additional init containers to the Redis® replicas pod(s) | `[]` |
|
||||
| `replica.persistence.enabled` | Enable persistence on Redis® replicas nodes using Persistent Volume Claims | `true` |
|
||||
| `replica.persistence.medium` | Provide a medium for `emptyDir` volumes. | `""` |
|
||||
| `replica.persistence.sizeLimit` | Set this to enable a size limit for `emptyDir` volumes. | `""` |
|
||||
| `replica.persistence.path` | The path the volume will be mounted at on Redis® replicas containers | `/data` |
|
||||
| `replica.persistence.subPath` | The subdirectory of the volume to mount on Redis® replicas containers | `""` |
|
||||
| `replica.persistence.storageClass` | Persistent Volume storage class | `""` |
|
||||
| `replica.persistence.accessModes` | Persistent Volume access modes | `["ReadWriteOnce"]` |
|
||||
| `replica.persistence.size` | Persistent Volume size | `8Gi` |
|
||||
| `replica.persistence.annotations` | Additional custom annotations for the PVC | `{}` |
|
||||
| `replica.persistence.selector` | Additional labels to match for the PVC | `{}` |
|
||||
| `replica.persistence.dataSource` | Custom PVC data source | `{}` |
|
||||
| `replica.persistence.existingClaim` | Use a existing PVC which must be created manually before bound | `""` |
|
||||
| `replica.service.type` | Redis® replicas service type | `ClusterIP` |
|
||||
| `replica.service.ports.redis` | Redis® replicas service port | `6379` |
|
||||
| `replica.service.nodePorts.redis` | Node port for Redis® replicas | `""` |
|
||||
| `replica.service.externalTrafficPolicy` | Redis® replicas service external traffic policy | `Cluster` |
|
||||
| `replica.service.internalTrafficPolicy` | Redis® replicas service internal traffic policy (requires Kubernetes v1.22 or greater to be usable) | `Cluster` |
|
||||
| `replica.service.extraPorts` | Extra ports to expose (normally used with the `sidecar` value) | `[]` |
|
||||
| `replica.service.clusterIP` | Redis® replicas service Cluster IP | `""` |
|
||||
| `replica.service.loadBalancerIP` | Redis® replicas service Load Balancer IP | `""` |
|
||||
| `replica.service.loadBalancerSourceRanges` | Redis® replicas service Load Balancer sources | `[]` |
|
||||
| `replica.service.annotations` | Additional custom annotations for Redis® replicas service | `{}` |
|
||||
| `replica.service.sessionAffinity` | Session Affinity for Kubernetes service, can be "None" or "ClientIP" | `None` |
|
||||
| `replica.service.sessionAffinityConfig` | Additional settings for the sessionAffinity | `{}` |
|
||||
| `replica.terminationGracePeriodSeconds` | Integer setting the termination grace period for the redis-replicas pods | `30` |
|
||||
| `replica.autoscaling.enabled` | Enable replica autoscaling settings | `false` |
|
||||
| `replica.autoscaling.minReplicas` | Minimum replicas for the pod autoscaling | `1` |
|
||||
| `replica.autoscaling.maxReplicas` | Maximum replicas for the pod autoscaling | `11` |
|
||||
| `replica.autoscaling.targetCPU` | Percentage of CPU to consider when autoscaling | `""` |
|
||||
| `replica.autoscaling.targetMemory` | Percentage of Memory to consider when autoscaling | `""` |
|
||||
|
||||
|
||||
### Redis® Sentinel configuration parameters
|
||||
|
||||
| Name | Description | Value |
|
||||
| --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
|
||||
| `sentinel.enabled` | Use Redis® Sentinel on Redis® pods. | `false` |
|
||||
| `sentinel.image.registry` | Redis® Sentinel image registry | `docker.io` |
|
||||
| `sentinel.image.repository` | Redis® Sentinel image repository | `bitnami/redis-sentinel` |
|
||||
| `sentinel.image.tag` | Redis® Sentinel image tag (immutable tags are recommended) | `7.0.4-debian-11-r8` |
|
||||
| `sentinel.image.pullPolicy` | Redis® Sentinel image pull policy | `IfNotPresent` |
|
||||
| `sentinel.image.pullSecrets` | Redis® Sentinel image pull secrets | `[]` |
|
||||
| `sentinel.image.debug` | Enable image debug mode | `false` |
|
||||
| `sentinel.masterSet` | Master set name | `mymaster` |
|
||||
| `sentinel.quorum` | Sentinel Quorum | `2` |
|
||||
| `sentinel.getMasterTimeout` | Amount of time to allow before get_sentinel_master_info() times out. | `220` |
|
||||
| `sentinel.automateClusterRecovery` | Automate cluster recovery in cases where the last replica is not considered a good replica and Sentinel won't automatically failover to it. | `false` |
|
||||
| `sentinel.downAfterMilliseconds` | Timeout for detecting a Redis® node is down | `60000` |
|
||||
| `sentinel.failoverTimeout` | Timeout for performing a election failover | `18000` |
|
||||
| `sentinel.parallelSyncs` | Number of replicas that can be reconfigured in parallel to use the new master after a failover | `1` |
|
||||
| `sentinel.configuration` | Configuration for Redis® Sentinel nodes | `""` |
|
||||
| `sentinel.command` | Override default container command (useful when using custom images) | `[]` |
|
||||
| `sentinel.args` | Override default container args (useful when using custom images) | `[]` |
|
||||
| `sentinel.preExecCmds` | Additional commands to run prior to starting Redis® Sentinel | `[]` |
|
||||
| `sentinel.extraEnvVars` | Array with extra environment variables to add to Redis® Sentinel nodes | `[]` |
|
||||
| `sentinel.extraEnvVarsCM` | Name of existing ConfigMap containing extra env vars for Redis® Sentinel nodes | `""` |
|
||||
| `sentinel.extraEnvVarsSecret` | Name of existing Secret containing extra env vars for Redis® Sentinel nodes | `""` |
|
||||
| `sentinel.externalMaster.enabled` | Use external master for bootstrapping | `false` |
|
||||
| `sentinel.externalMaster.host` | External master host to bootstrap from | `""` |
|
||||
| `sentinel.externalMaster.port` | Port for Redis service external master host | `6379` |
|
||||
| `sentinel.containerPorts.sentinel` | Container port to open on Redis® Sentinel nodes | `26379` |
|
||||
| `sentinel.startupProbe.enabled` | Enable startupProbe on Redis® Sentinel nodes | `true` |
|
||||
| `sentinel.startupProbe.initialDelaySeconds` | Initial delay seconds for startupProbe | `10` |
|
||||
| `sentinel.startupProbe.periodSeconds` | Period seconds for startupProbe | `10` |
|
||||
| `sentinel.startupProbe.timeoutSeconds` | Timeout seconds for startupProbe | `5` |
|
||||
| `sentinel.startupProbe.failureThreshold` | Failure threshold for startupProbe | `22` |
|
||||
| `sentinel.startupProbe.successThreshold` | Success threshold for startupProbe | `1` |
|
||||
| `sentinel.livenessProbe.enabled` | Enable livenessProbe on Redis® Sentinel nodes | `true` |
|
||||
| `sentinel.livenessProbe.initialDelaySeconds` | Initial delay seconds for livenessProbe | `20` |
|
||||
| `sentinel.livenessProbe.periodSeconds` | Period seconds for livenessProbe | `5` |
|
||||
| `sentinel.livenessProbe.timeoutSeconds` | Timeout seconds for livenessProbe | `5` |
|
||||
| `sentinel.livenessProbe.failureThreshold` | Failure threshold for livenessProbe | `5` |
|
||||
| `sentinel.livenessProbe.successThreshold` | Success threshold for livenessProbe | `1` |
|
||||
| `sentinel.readinessProbe.enabled` | Enable readinessProbe on Redis® Sentinel nodes | `true` |
|
||||
| `sentinel.readinessProbe.initialDelaySeconds` | Initial delay seconds for readinessProbe | `20` |
|
||||
| `sentinel.readinessProbe.periodSeconds` | Period seconds for readinessProbe | `5` |
|
||||
| `sentinel.readinessProbe.timeoutSeconds` | Timeout seconds for readinessProbe | `1` |
|
||||
| `sentinel.readinessProbe.failureThreshold` | Failure threshold for readinessProbe | `5` |
|
||||
| `sentinel.readinessProbe.successThreshold` | Success threshold for readinessProbe | `1` |
|
||||
| `sentinel.customStartupProbe` | Custom startupProbe that overrides the default one | `{}` |
|
||||
| `sentinel.customLivenessProbe` | Custom livenessProbe that overrides the default one | `{}` |
|
||||
| `sentinel.customReadinessProbe` | Custom readinessProbe that overrides the default one | `{}` |
|
||||
| `sentinel.persistence.enabled` | Enable persistence on Redis® sentinel nodes using Persistent Volume Claims (Experimental) | `false` |
|
||||
| `sentinel.persistence.storageClass` | Persistent Volume storage class | `""` |
|
||||
| `sentinel.persistence.accessModes` | Persistent Volume access modes | `["ReadWriteOnce"]` |
|
||||
| `sentinel.persistence.size` | Persistent Volume size | `100Mi` |
|
||||
| `sentinel.persistence.annotations` | Additional custom annotations for the PVC | `{}` |
|
||||
| `sentinel.persistence.selector` | Additional labels to match for the PVC | `{}` |
|
||||
| `sentinel.persistence.dataSource` | Custom PVC data source | `{}` |
|
||||
| `sentinel.persistence.medium` | Provide a medium for `emptyDir` volumes. | `""` |
|
||||
| `sentinel.resources.limits` | The resources limits for the Redis® Sentinel containers | `{}` |
|
||||
| `sentinel.resources.requests` | The requested resources for the Redis® Sentinel containers | `{}` |
|
||||
| `sentinel.containerSecurityContext.enabled` | Enabled Redis® Sentinel containers' Security Context | `true` |
|
||||
| `sentinel.containerSecurityContext.runAsUser` | Set Redis® Sentinel containers' Security Context runAsUser | `1001` |
|
||||
| `sentinel.lifecycleHooks` | for the Redis® sentinel container(s) to automate configuration before or after startup | `{}` |
|
||||
| `sentinel.extraVolumes` | Optionally specify extra list of additional volumes for the Redis® Sentinel | `[]` |
|
||||
| `sentinel.extraVolumeMounts` | Optionally specify extra list of additional volumeMounts for the Redis® Sentinel container(s) | `[]` |
|
||||
| `sentinel.service.type` | Redis® Sentinel service type | `ClusterIP` |
|
||||
| `sentinel.service.ports.redis` | Redis® service port for Redis® | `6379` |
|
||||
| `sentinel.service.ports.sentinel` | Redis® service port for Redis® Sentinel | `26379` |
|
||||
| `sentinel.service.nodePorts.redis` | Node port for Redis® | `""` |
|
||||
| `sentinel.service.nodePorts.sentinel` | Node port for Sentinel | `""` |
|
||||
| `sentinel.service.externalTrafficPolicy` | Redis® Sentinel service external traffic policy | `Cluster` |
|
||||
| `sentinel.service.extraPorts` | Extra ports to expose (normally used with the `sidecar` value) | `[]` |
|
||||
| `sentinel.service.clusterIP` | Redis® Sentinel service Cluster IP | `""` |
|
||||
| `sentinel.service.loadBalancerIP` | Redis® Sentinel service Load Balancer IP | `""` |
|
||||
| `sentinel.service.loadBalancerSourceRanges` | Redis® Sentinel service Load Balancer sources | `[]` |
|
||||
| `sentinel.service.annotations` | Additional custom annotations for Redis® Sentinel service | `{}` |
|
||||
| `sentinel.service.sessionAffinity` | Session Affinity for Kubernetes service, can be "None" or "ClientIP" | `None` |
|
||||
| `sentinel.service.sessionAffinityConfig` | Additional settings for the sessionAffinity | `{}` |
|
||||
| `sentinel.terminationGracePeriodSeconds` | Integer setting the termination grace period for the redis-node pods | `30` |
|
||||
|
||||
|
||||
### Other Parameters
|
||||
|
||||
| Name | Description | Value |
|
||||
| --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
|
||||
| `networkPolicy.enabled` | Enable creation of NetworkPolicy resources | `false` |
|
||||
| `networkPolicy.allowExternal` | Don't require client label for connections | `true` |
|
||||
| `networkPolicy.extraIngress` | Add extra ingress rules to the NetworkPolicy | `[]` |
|
||||
| `networkPolicy.extraEgress` | Add extra egress rules to the NetworkPolicy | `[]` |
|
||||
| `networkPolicy.ingressNSMatchLabels` | Labels to match to allow traffic from other namespaces | `{}` |
|
||||
| `networkPolicy.ingressNSPodMatchLabels` | Pod labels to match to allow traffic from other namespaces | `{}` |
|
||||
| `podSecurityPolicy.create` | Whether to create a PodSecurityPolicy. WARNING: PodSecurityPolicy is deprecated in Kubernetes v1.21 or later, unavailable in v1.25 or later | `false` |
|
||||
| `podSecurityPolicy.enabled` | Enable PodSecurityPolicy's RBAC rules | `false` |
|
||||
| `rbac.create` | Specifies whether RBAC resources should be created | `false` |
|
||||
| `rbac.rules` | Custom RBAC rules to set | `[]` |
|
||||
| `serviceAccount.create` | Specifies whether a ServiceAccount should be created | `true` |
|
||||
| `serviceAccount.name` | The name of the ServiceAccount to use. | `""` |
|
||||
| `serviceAccount.automountServiceAccountToken` | Whether to auto mount the service account token | `true` |
|
||||
| `serviceAccount.annotations` | Additional custom annotations for the ServiceAccount | `{}` |
|
||||
| `pdb.create` | Specifies whether a PodDisruptionBudget should be created | `false` |
|
||||
| `pdb.minAvailable` | Min number of pods that must still be available after the eviction | `1` |
|
||||
| `pdb.maxUnavailable` | Max number of pods that can be unavailable after the eviction | `""` |
|
||||
| `tls.enabled` | Enable TLS traffic | `false` |
|
||||
| `tls.authClients` | Require clients to authenticate | `true` |
|
||||
| `tls.autoGenerated` | Enable autogenerated certificates | `false` |
|
||||
| `tls.existingSecret` | The name of the existing secret that contains the TLS certificates | `""` |
|
||||
| `tls.certificatesSecret` | DEPRECATED. Use existingSecret instead. | `""` |
|
||||
| `tls.certFilename` | Certificate filename | `""` |
|
||||
| `tls.certKeyFilename` | Certificate Key filename | `""` |
|
||||
| `tls.certCAFilename` | CA Certificate filename | `""` |
|
||||
| `tls.dhParamsFilename` | File containing DH params (in order to support DH based ciphers) | `""` |
|
||||
|
||||
|
||||
### Metrics Parameters
|
||||
|
||||
| Name | Description | Value |
|
||||
| -------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------ |
|
||||
| `metrics.enabled` | Start a sidecar prometheus exporter to expose Redis® metrics | `false` |
|
||||
| `metrics.image.registry` | Redis® Exporter image registry | `docker.io` |
|
||||
| `metrics.image.repository` | Redis® Exporter image repository | `bitnami/redis-exporter` |
|
||||
| `metrics.image.tag` | Redis® Redis® Exporter image tag (immutable tags are recommended) | `1.43.0-debian-11-r18` |
|
||||
| `metrics.image.pullPolicy` | Redis® Exporter image pull policy | `IfNotPresent` |
|
||||
| `metrics.image.pullSecrets` | Redis® Exporter image pull secrets | `[]` |
|
||||
| `metrics.command` | Override default metrics container init command (useful when using custom images) | `[]` |
|
||||
| `metrics.redisTargetHost` | A way to specify an alternative Redis® hostname | `localhost` |
|
||||
| `metrics.extraArgs` | Extra arguments for Redis® exporter, for example: | `{}` |
|
||||
| `metrics.extraEnvVars` | Array with extra environment variables to add to Redis® exporter | `[]` |
|
||||
| `metrics.containerSecurityContext.enabled` | Enabled Redis® exporter containers' Security Context | `true` |
|
||||
| `metrics.containerSecurityContext.runAsUser` | Set Redis® exporter containers' Security Context runAsUser | `1001` |
|
||||
| `metrics.extraVolumes` | Optionally specify extra list of additional volumes for the Redis® metrics sidecar | `[]` |
|
||||
| `metrics.extraVolumeMounts` | Optionally specify extra list of additional volumeMounts for the Redis® metrics sidecar | `[]` |
|
||||
| `metrics.resources.limits` | The resources limits for the Redis® exporter container | `{}` |
|
||||
| `metrics.resources.requests` | The requested resources for the Redis® exporter container | `{}` |
|
||||
| `metrics.podLabels` | Extra labels for Redis® exporter pods | `{}` |
|
||||
| `metrics.podAnnotations` | Annotations for Redis® exporter pods | `{}` |
|
||||
| `metrics.service.type` | Redis® exporter service type | `ClusterIP` |
|
||||
| `metrics.service.port` | Redis® exporter service port | `9121` |
|
||||
| `metrics.service.externalTrafficPolicy` | Redis® exporter service external traffic policy | `Cluster` |
|
||||
| `metrics.service.extraPorts` | Extra ports to expose (normally used with the `sidecar` value) | `[]` |
|
||||
| `metrics.service.loadBalancerIP` | Redis® exporter service Load Balancer IP | `""` |
|
||||
| `metrics.service.loadBalancerSourceRanges` | Redis® exporter service Load Balancer sources | `[]` |
|
||||
| `metrics.service.annotations` | Additional custom annotations for Redis® exporter service | `{}` |
|
||||
| `metrics.serviceMonitor.enabled` | Create ServiceMonitor resource(s) for scraping metrics using PrometheusOperator | `false` |
|
||||
| `metrics.serviceMonitor.namespace` | The namespace in which the ServiceMonitor will be created | `""` |
|
||||
| `metrics.serviceMonitor.interval` | The interval at which metrics should be scraped | `30s` |
|
||||
| `metrics.serviceMonitor.scrapeTimeout` | The timeout after which the scrape is ended | `""` |
|
||||
| `metrics.serviceMonitor.relabellings` | Metrics RelabelConfigs to apply to samples before scraping. | `[]` |
|
||||
| `metrics.serviceMonitor.metricRelabelings` | Metrics RelabelConfigs to apply to samples before ingestion. | `[]` |
|
||||
| `metrics.serviceMonitor.honorLabels` | Specify honorLabels parameter to add the scrape endpoint | `false` |
|
||||
| `metrics.serviceMonitor.additionalLabels` | Additional labels that can be used so ServiceMonitor resource(s) can be discovered by Prometheus | `{}` |
|
||||
| `metrics.prometheusRule.enabled` | Create a custom prometheusRule Resource for scraping metrics using PrometheusOperator | `false` |
|
||||
| `metrics.prometheusRule.namespace` | The namespace in which the prometheusRule will be created | `""` |
|
||||
| `metrics.prometheusRule.additionalLabels` | Additional labels for the prometheusRule | `{}` |
|
||||
| `metrics.prometheusRule.rules` | Custom Prometheus rules | `[]` |
|
||||
|
||||
|
||||
### Init Container Parameters
|
||||
|
||||
| Name | Description | Value |
|
||||
| ------------------------------------------------------ | ----------------------------------------------------------------------------------------------- | ----------------------- |
|
||||
| `volumePermissions.enabled` | Enable init container that changes the owner/group of the PV mount point to `runAsUser:fsGroup` | `false` |
|
||||
| `volumePermissions.image.registry` | Bitnami Shell image registry | `docker.io` |
|
||||
| `volumePermissions.image.repository` | Bitnami Shell image repository | `bitnami/bitnami-shell` |
|
||||
| `volumePermissions.image.tag` | Bitnami Shell image tag (immutable tags are recommended) | `11-debian-11-r23` |
|
||||
| `volumePermissions.image.pullPolicy` | Bitnami Shell image pull policy | `IfNotPresent` |
|
||||
| `volumePermissions.image.pullSecrets` | Bitnami Shell image pull secrets | `[]` |
|
||||
| `volumePermissions.resources.limits` | The resources limits for the init container | `{}` |
|
||||
| `volumePermissions.resources.requests` | The requested resources for the init container | `{}` |
|
||||
| `volumePermissions.containerSecurityContext.runAsUser` | Set init container's Security Context runAsUser | `0` |
|
||||
| `sysctl.enabled` | Enable init container to modify Kernel settings | `false` |
|
||||
| `sysctl.image.registry` | Bitnami Shell image registry | `docker.io` |
|
||||
| `sysctl.image.repository` | Bitnami Shell image repository | `bitnami/bitnami-shell` |
|
||||
| `sysctl.image.tag` | Bitnami Shell image tag (immutable tags are recommended) | `11-debian-11-r23` |
|
||||
| `sysctl.image.pullPolicy` | Bitnami Shell image pull policy | `IfNotPresent` |
|
||||
| `sysctl.image.pullSecrets` | Bitnami Shell image pull secrets | `[]` |
|
||||
| `sysctl.command` | Override default init-sysctl container command (useful when using custom images) | `[]` |
|
||||
| `sysctl.mountHostSys` | Mount the host `/sys` folder to `/host-sys` | `false` |
|
||||
| `sysctl.resources.limits` | The resources limits for the init container | `{}` |
|
||||
| `sysctl.resources.requests` | The requested resources for the init container | `{}` |
|
||||
|
||||
|
||||
### useExternalDNS Parameters
|
||||
|
||||
| Name | Description | Value |
|
||||
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- |
|
||||
| `useExternalDNS.enabled` | Enable various syntax that would enable external-dns to work. Note this requires a working installation of `external-dns` to be usable. | `false` |
|
||||
| `useExternalDNS.additionalAnnotations` | Extra annotations to be utilized when `external-dns` is enabled. | `{}` |
|
||||
| `useExternalDNS.annotationKey` | The annotation key utilized when `external-dns` is enabled. | `external-dns.alpha.kubernetes.io/` |
|
||||
| `useExternalDNS.suffix` | The DNS suffix utilized when `external-dns` is enabled. Note that we prepend the suffix with the full name of the release. | `""` |
|
||||
|
||||
|
||||
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
|
||||
|
||||
```bash
|
||||
$ helm install my-release \
|
||||
--set auth.password=secretpassword \
|
||||
bitnami/redis
|
||||
```
|
||||
|
||||
The above command sets the Redis® server password to `secretpassword`.
|
||||
|
||||
> NOTE: Once this chart is deployed, it is not possible to change the application's access credentials, such as usernames or passwords, using Helm. To change these application credentials after deployment, delete any persistent volumes (PVs) used by the chart and re-deploy it, or use the application's built-in administrative tools if available.
|
||||
|
||||
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,
|
||||
|
||||
```bash
|
||||
$ helm install my-release -f values.yaml bitnami/redis
|
||||
```
|
||||
|
||||
> **Tip**: You can use the default [values.yaml](values.yaml)
|
||||
|
||||
## Configuration and installation details
|
||||
|
||||
### [Rolling VS Immutable tags](https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/)
|
||||
|
||||
It is strongly recommended to use immutable tags in a production environment. This ensures your deployment does not change automatically if the same tag is updated with a different image.
|
||||
|
||||
Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist.
|
||||
|
||||
### Use a different Redis® version
|
||||
|
||||
To modify the application version used in this chart, specify a different version of the image using the `image.tag` parameter and/or a different repository using the `image.repository` parameter. Refer to the [chart documentation for more information on these parameters and how to use them with images from a private registry](https://docs.bitnami.com/kubernetes/infrastructure/redis/configuration/change-image-version/).
|
||||
|
||||
### Bootstrapping with an External Cluster
|
||||
|
||||
This chart is equipped with the ability to bring online a set of Pods that connect to an existing Redis deployment that lies outside of Kubernetes. This effectively creates a hybrid Redis Deployment where both Pods in Kubernetes and Instances such as Virtual Machines can partake in a single Redis Deployment. This is helpful in situations where one may be migrating Redis from Virtual Machines into Kubernetes, for example. To take advantage of this, use the following as an example configuration:
|
||||
|
||||
```yaml
|
||||
replica:
|
||||
externalMaster:
|
||||
enabled: true
|
||||
host: external-redis-0.internal
|
||||
sentinel:
|
||||
externalMaster:
|
||||
enabled: true
|
||||
host: external-redis-0.internal
|
||||
```
|
||||
|
||||
:warning: This is currently limited to clusters in which Sentinel and Redis run on the same node! :warning:
|
||||
|
||||
Please also note that the external sentinel must be listening on port `26379`, and this is currently not configurable.
|
||||
|
||||
Once the Kubernetes Redis Deployment is online and confirmed to be working with the existing cluster, the configuration can then be removed and the cluster will remain connected.
|
||||
|
||||
### External DNS
|
||||
|
||||
This chart is equipped to allow leveraging the ExternalDNS project. Doing so will enable ExternalDNS to publish the FQDN for each instance, in the format of `<pod-name>.<release-name>.<dns-suffix>`.
|
||||
Example, when using the following configuration:
|
||||
|
||||
```yaml
|
||||
useExternalDNS:
|
||||
enabled: true
|
||||
suffix: prod.example.org
|
||||
additionalAnnotations:
|
||||
ttl: 10
|
||||
```
|
||||
|
||||
On a cluster where the name of the Helm release is `a`, the hostname of a Pod is generated as: `a-redis-node-0.a-redis.prod.example.org`. The IP of that FQDN will match that of the associated Pod. This modifies the following parameters of the Redis/Sentinel configuration using this new FQDN:
|
||||
|
||||
* `replica-announce-ip`
|
||||
* `known-sentinel`
|
||||
* `known-replica`
|
||||
* `announce-ip`
|
||||
|
||||
:warning: This requires a working installation of `external-dns` to be fully functional. :warning:
|
||||
|
||||
See the [official ExternalDNS documentation](https://github.com/kubernetes-sigs/external-dns) for additional configuration options.
|
||||
|
||||
### Cluster topologies
|
||||
|
||||
#### Default: Master-Replicas
|
||||
|
||||
When installing the chart with `architecture=replication`, it will deploy a Redis® master StatefulSet and a Redis® replicas StatefulSet. The replicas will be read-replicas of the master. Two services will be exposed:
|
||||
|
||||
- Redis® Master service: Points to the master, where read-write operations can be performed
|
||||
- Redis® Replicas service: Points to the replicas, where only read operations are allowed by default.
|
||||
|
||||
In case the master crashes, the replicas will wait until the master node is respawned again by the Kubernetes Controller Manager.
|
||||
|
||||
#### Standalone
|
||||
|
||||
When installing the chart with `architecture=standalone`, it will deploy a standalone Redis® StatefulSet. A single service will be exposed:
|
||||
|
||||
- Redis® Master service: Points to the master, where read-write operations can be performed
|
||||
|
||||
#### Master-Replicas with Sentinel
|
||||
|
||||
When installing the chart with `architecture=replication` and `sentinel.enabled=true`, it will deploy a Redis® master StatefulSet (only one master allowed) and a Redis® replicas StatefulSet. In this case, the pods will contain an extra container with Redis® Sentinel. This container will form a cluster of Redis® Sentinel nodes, which will promote a new master in case the actual one fails. In addition to this, only one service is exposed:
|
||||
|
||||
- Redis® service: Exposes port 6379 for Redis® read-only operations and port 26379 for accessing Redis® Sentinel.
|
||||
|
||||
For read-only operations, access the service using port 6379. For write operations, it's necessary to access the Redis® Sentinel cluster and query the current master using the command below (using redis-cli or similar):
|
||||
|
||||
```
|
||||
SENTINEL get-master-addr-by-name <name of your MasterSet. e.g: mymaster>
|
||||
```
|
||||
|
||||
This command will return the address of the current master, which can be accessed from inside the cluster.
|
||||
|
||||
In case the current master crashes, the Sentinel containers will elect a new master node.
|
||||
|
||||
`master.count` greater than `1` is not designed for use when `sentinel.enabled=true`.
|
||||
|
||||
### Multiple masters (experimental)
|
||||
|
||||
When `master.count` is greater than `1`, special care must be taken to create a consistent setup.
|
||||
|
||||
An example of use case is the creation of a redundant set of standalone masters or master-replicas per Kubernetes node where you must ensure:
|
||||
- No more than `1` master can be deployed per Kubernetes node
|
||||
- Replicas and writers can only see the single master of their own Kubernetes node
|
||||
|
||||
One way of achieving this is by setting `master.service.internalTrafficPolicy=Local` in combination with a `master.affinity.podAntiAffinity` spec to never schedule more than one master per Kubernetes node.
|
||||
|
||||
It's recommended to only change `master.count` if you know what you are doing.
|
||||
`master.count` greater than `1` is not designed for use when `sentinel.enabled=true`.
|
||||
|
||||
### Using a password file
|
||||
|
||||
To use a password file for Redis® you need to create a secret containing the password and then deploy the chart using that secret.
|
||||
|
||||
Refer to the chart documentation for more information on [using a password file for Redis®](https://docs.bitnami.com/kubernetes/infrastructure/redis/administration/use-password-file/).
|
||||
|
||||
### Securing traffic using TLS
|
||||
|
||||
TLS support can be enabled in the chart by specifying the `tls.` parameters while creating a release. The following parameters should be configured to properly enable the TLS support in the chart:
|
||||
|
||||
- `tls.enabled`: Enable TLS support. Defaults to `false`
|
||||
- `tls.existingSecret`: Name of the secret that contains the certificates. No defaults.
|
||||
- `tls.certFilename`: Certificate filename. No defaults.
|
||||
- `tls.certKeyFilename`: Certificate key filename. No defaults.
|
||||
- `tls.certCAFilename`: CA Certificate filename. No defaults.
|
||||
|
||||
Refer to the chart documentation for more information on [creating the secret and a TLS deployment example](https://docs.bitnami.com/kubernetes/infrastructure/redis/administration/enable-tls/).
|
||||
|
||||
### Metrics
|
||||
|
||||
The chart optionally can start a metrics exporter for [prometheus](https://prometheus.io). The metrics endpoint (port 9121) is exposed in the service. Metrics can be scraped from within the cluster using something similar as the described in the [example Prometheus scrape configuration](https://github.com/prometheus/prometheus/blob/master/documentation/examples/prometheus-kubernetes.yml). If metrics are to be scraped from outside the cluster, the Kubernetes API proxy can be utilized to access the endpoint.
|
||||
|
||||
If you have enabled TLS by specifying `tls.enabled=true` you also need to specify TLS option to the metrics exporter. You can do that via `metrics.extraArgs`. You can find the metrics exporter CLI flags for TLS [here](https://github.com/oliver006/redis_exporter#command-line-flags). For example:
|
||||
|
||||
You can either specify `metrics.extraArgs.skip-tls-verification=true` to skip TLS verification or providing the following values under `metrics.extraArgs` for TLS client authentication:
|
||||
|
||||
```console
|
||||
tls-client-key-file
|
||||
tls-client-cert-file
|
||||
tls-ca-cert-file
|
||||
```
|
||||
|
||||
### Host Kernel Settings
|
||||
|
||||
Redis® may require some changes in the kernel of the host machine to work as expected, in particular increasing the `somaxconn` value and disabling transparent huge pages.
|
||||
|
||||
Refer to the chart documentation for more information on [configuring host kernel settings with an example](https://docs.bitnami.com/kubernetes/infrastructure/redis/administration/configure-kernel-settings/).
|
||||
|
||||
## Persistence
|
||||
|
||||
By default, the chart mounts a [Persistent Volume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) at the `/data` path. The volume is created using dynamic volume provisioning. If a Persistent Volume Claim already exists, specify it during installation.
|
||||
|
||||
### Existing PersistentVolumeClaim
|
||||
|
||||
1. Create the PersistentVolume
|
||||
2. Create the PersistentVolumeClaim
|
||||
3. Install the chart
|
||||
|
||||
```bash
|
||||
$ helm install my-release --set master.persistence.existingClaim=PVC_NAME bitnami/redis
|
||||
```
|
||||
|
||||
## Backup and restore
|
||||
|
||||
Refer to the chart documentation for more information on [backing up and restoring Redis® deployments](https://docs.bitnami.com/kubernetes/infrastructure/redis/administration/backup-restore/).
|
||||
|
||||
## NetworkPolicy
|
||||
|
||||
To enable network policy for Redis®, install [a networking plugin that implements the Kubernetes NetworkPolicy spec](https://kubernetes.io/docs/tasks/administer-cluster/declare-network-policy#before-you-begin), and set `networkPolicy.enabled` to `true`.
|
||||
|
||||
Refer to the chart documenation for more information on [enabling the network policy in Redis® deployments](https://docs.bitnami.com/kubernetes/infrastructure/redis/administration/enable-network-policy/).
|
||||
|
||||
### Setting Pod's affinity
|
||||
|
||||
This chart allows you to set your custom affinity using the `XXX.affinity` parameter(s). Find more information about Pod's affinity in the [Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity).
|
||||
|
||||
As an alternative, you can use of the preset configurations for pod affinity, pod anti-affinity, and node affinity available at the [bitnami/common](https://github.com/bitnami/charts/tree/master/bitnami/common#affinities) chart. To do so, set the `XXX.podAffinityPreset`, `XXX.podAntiAffinityPreset`, or `XXX.nodeAffinityPreset` parameters.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
Find more information about how to deal with common errors related to Bitnami's Helm charts in [this troubleshooting guide](https://docs.bitnami.com/general/how-to/troubleshoot-helm-chart-issues).
|
||||
|
||||
## Upgrading
|
||||
|
||||
A major chart version change (like v1.2.3 -> v2.0.0) indicates that there is an incompatible breaking change needing manual actions.
|
||||
|
||||
### To 16.0.0
|
||||
|
||||
This major release renames several values in this chart and adds missing features, in order to be inline with the rest of assets in the Bitnami charts repository.
|
||||
|
||||
Affected values:
|
||||
- `master.service.port` renamed as `master.service.ports.redis`.
|
||||
- `master.service.nodePort` renamed as `master.service.nodePorts.redis`.
|
||||
- `replica.service.port` renamed as `replica.service.ports.redis`.
|
||||
- `replica.service.nodePort` renamed as `replica.service.nodePorts.redis`.
|
||||
- `sentinel.service.port` renamed as `sentinel.service.ports.redis`.
|
||||
- `sentinel.service.sentinelPort` renamed as `sentinel.service.ports.sentinel`.
|
||||
- `master.containerPort` renamed as `master.containerPorts.redis`.
|
||||
- `replica.containerPort` renamed as `replica.containerPorts.redis`.
|
||||
- `sentinel.containerPort` renamed as `sentinel.containerPorts.sentinel`.
|
||||
- `master.spreadConstraints` renamed as `master.topologySpreadConstraints`
|
||||
- `replica.spreadConstraints` renamed as `replica.topologySpreadConstraints`
|
||||
|
||||
### To 15.0.0
|
||||
|
||||
The parameter to enable the usage of StaticIDs was removed. The behavior is to [always use StaticIDs](https://github.com/bitnami/charts/pull/7278).
|
||||
|
||||
### To 14.8.0
|
||||
|
||||
The Redis® sentinel exporter was removed in this version because the upstream project was deprecated. The regular Redis® exporter is included in the sentinel scenario as usual.
|
||||
|
||||
### To 14.0.0
|
||||
|
||||
- Several parameters were renamed or disappeared in favor of new ones on this major version:
|
||||
- The term *slave* has been replaced by the term *replica*. Therefore, parameters prefixed with `slave` are now prefixed with `replicas`.
|
||||
- Credentials parameter are reorganized under the `auth` parameter.
|
||||
- `cluster.enabled` parameter is deprecated in favor of `architecture` parameter that accepts two values: `standalone` and `replication`.
|
||||
- `securityContext.*` is deprecated in favor of `XXX.podSecurityContext` and `XXX.containerSecurityContext`.
|
||||
- `sentinel.metrics.*` parameters are deprecated in favor of `metrics.sentinel.*` ones.
|
||||
- New parameters to add custom command, environment variables, sidecars, init containers, etc. were added.
|
||||
- Chart labels were adapted to follow the [Helm charts standard labels](https://helm.sh/docs/chart_best_practices/labels/#standard-labels).
|
||||
- values.yaml metadata was adapted to follow the format supported by [Readme Generator for Helm](https://github.com/bitnami-labs/readme-generator-for-helm).
|
||||
|
||||
Consequences:
|
||||
|
||||
Backwards compatibility is not guaranteed. To upgrade to `14.0.0`, install a new release of the Redis® chart, and migrate the data from your previous release. You have 2 alternatives to do so:
|
||||
|
||||
- Create a backup of the database, and restore it on the new release as explained in the [Backup and restore](#backup-and-restore) section.
|
||||
- Reuse the PVC used to hold the master data on your previous release. To do so, use the `master.persistence.existingClaim` parameter. The following example assumes that the release name is `redis`:
|
||||
|
||||
```bash
|
||||
$ helm install redis bitnami/redis --set auth.password=[PASSWORD] --set master.persistence.existingClaim=[EXISTING_PVC]
|
||||
```
|
||||
|
||||
| Note: you need to substitute the placeholder _[EXISTING_PVC]_ with the name of the PVC used on your previous release, and _[PASSWORD]_ with the password used in your previous release.
|
||||
|
||||
### To 13.0.0
|
||||
|
||||
This major version updates the Redis® docker image version used from `6.0` to `6.2`, the new stable version. There are no major changes in the chart and there shouldn't be any breaking changes in it as `6.2` is basically a stricter superset of `6.0`. For more information, please refer to [Redis® 6.2 release notes](https://raw.githubusercontent.com/redis/redis/6.2/00-RELEASENOTES).
|
||||
|
||||
### To 12.3.0
|
||||
|
||||
This version also introduces `bitnami/common`, a [library chart](https://helm.sh/docs/topics/library_charts/#helm) as a dependency. More documentation about this new utility could be found [here](https://github.com/bitnami/charts/tree/master/bitnami/common#bitnami-common-library-chart). Please, make sure that you have updated the chart dependencies before executing any upgrade.
|
||||
|
||||
### To 12.0.0
|
||||
|
||||
[On November 13, 2020, Helm v2 support was formally finished](https://github.com/helm/charts#status-of-the-project), this major version is the result of the required changes applied to the Helm Chart to be able to incorporate the different features added in Helm v3 and to be consistent with the Helm project itself regarding the Helm v2 EOL.
|
||||
|
||||
**What changes were introduced in this major version?**
|
||||
|
||||
- Previous versions of this Helm Chart use `apiVersion: v1` (installable by both Helm 2 and 3), this Helm Chart was updated to `apiVersion: v2` (installable by Helm 3 only). [Here](https://helm.sh/docs/topics/charts/#the-apiversion-field) you can find more information about the `apiVersion` field.
|
||||
- The different fields present in the *Chart.yaml* file has been ordered alphabetically in a homogeneous way for all the Bitnami Helm Charts
|
||||
|
||||
**Considerations when upgrading to this version**
|
||||
|
||||
- If you want to upgrade to this version from a previous one installed with Helm v3, you shouldn't face any issues
|
||||
- If you want to upgrade to this version using Helm v2, this scenario is not supported as this version doesn't support Helm v2 anymore
|
||||
- If you installed the previous version with Helm v2 and wants to upgrade to this version with Helm v3, please refer to the [official Helm documentation](https://helm.sh/docs/topics/v2_v3_migration/#migration-use-cases) about migrating from Helm v2 to v3
|
||||
|
||||
**Useful links**
|
||||
|
||||
- https://docs.bitnami.com/tutorials/resolve-helm2-helm3-post-migration-issues/
|
||||
- https://helm.sh/docs/topics/v2_v3_migration/
|
||||
- https://helm.sh/blog/migrate-from-helm-v2-to-helm-v3/
|
||||
|
||||
### To 11.0.0
|
||||
|
||||
When deployed with sentinel enabled, only a group of nodes is deployed and the master/slave role is handled in the group. To avoid breaking the compatibility, the settings for this nodes are given through the `slave.xxxx` parameters in `values.yaml`
|
||||
|
||||
### To 9.0.0
|
||||
|
||||
The metrics exporter has been changed from a separate deployment to a sidecar container, due to the latest changes in the Redis® exporter code. Check the [official page](https://github.com/oliver006/redis_exporter/) for more information. The metrics container image was changed from oliver006/redis_exporter to bitnami/redis-exporter (Bitnami's maintained package of oliver006/redis_exporter).
|
||||
|
||||
### To 7.0.0
|
||||
|
||||
In order to improve the performance in case of slave failure, we added persistence to the read-only slaves. That means that we moved from Deployment to StatefulSets. This should not affect upgrades from previous versions of the chart, as the deployments did not contain any persistence at all.
|
||||
|
||||
This version also allows enabling Redis® Sentinel containers inside of the Redis® Pods (feature disabled by default). In case the master crashes, a new Redis® node will be elected as master. In order to query the current master (no redis master service is exposed), you need to query first the Sentinel cluster.
|
||||
|
||||
### To 11.0.0
|
||||
|
||||
When using sentinel, a new statefulset called `-node` was introduced. This will break upgrading from a previous version where the statefulsets are called master and slave. Hence the PVC will not match the new naming and won't be reused. If you want to keep your data, you will need to perform a backup and then a restore the data in this new version.
|
||||
|
||||
### To 10.0.0
|
||||
|
||||
For releases with `usePassword: true`, the value `sentinel.usePassword` controls whether the password authentication also applies to the sentinel port. This defaults to `true` for a secure configuration, however it is possible to disable to account for the following cases:
|
||||
|
||||
- Using a version of redis-sentinel prior to `5.0.1` where the authentication feature was introduced.
|
||||
- Where redis clients need to be updated to support sentinel authentication.
|
||||
|
||||
If using a master/slave topology, or with `usePassword: false`, no action is required.
|
||||
|
||||
### To 8.0.18
|
||||
|
||||
For releases with `metrics.enabled: true` the default tag for the exporter image is now `v1.x.x`. This introduces many changes including metrics names. You'll want to use [this dashboard](https://github.com/oliver006/redis_exporter/blob/master/contrib/grafana_prometheus_redis_dashboard.json) now. Please see the [redis_exporter github page](https://github.com/oliver006/redis_exporter#upgrading-from-0x-to-1x) for more details.
|
||||
|
||||
### To 7.0.0
|
||||
|
||||
This version causes a change in the Redis® Master StatefulSet definition, so the command helm upgrade would not work out of the box. As an alternative, one of the following could be done:
|
||||
|
||||
- Recommended: Create a clone of the Redis® Master PVC (for example, using projects like [this one](https://github.com/edseymour/pvc-transfer)). Then launch a fresh release reusing this cloned PVC.
|
||||
|
||||
```
|
||||
helm install my-release bitnami/redis --set persistence.existingClaim=<NEW PVC>
|
||||
```
|
||||
|
||||
- Alternative (not recommended, do at your own risk): `helm delete --purge` does not remove the PVC assigned to the Redis® Master StatefulSet. As a consequence, the following commands can be done to upgrade the release
|
||||
|
||||
```
|
||||
helm delete --purge <RELEASE>
|
||||
helm install <RELEASE> bitnami/redis
|
||||
```
|
||||
|
||||
Previous versions of the chart were not using persistence in the slaves, so this upgrade would add it to them. Another important change is that no values are inherited from master to slaves. For example, in 6.0.0 `slaves.readinessProbe.periodSeconds`, if empty, would be set to `master.readinessProbe.periodSeconds`. This approach lacked transparency and was difficult to maintain. From now on, all the slave parameters must be configured just as it is done with the masters.
|
||||
|
||||
Some values have changed as well:
|
||||
|
||||
- `master.port` and `slave.port` have been changed to `redisPort` (same value for both master and slaves)
|
||||
- `master.securityContext` and `slave.securityContext` have been changed to `securityContext`(same values for both master and slaves)
|
||||
|
||||
By default, the upgrade will not change the cluster topology. In case you want to use Redis® Sentinel, you must explicitly set `sentinel.enabled` to `true`.
|
||||
|
||||
### To 6.0.0
|
||||
|
||||
Previous versions of the chart were using an init-container to change the permissions of the volumes. This was done in case the `securityContext` directive in the template was not enough for that (for example, with cephFS). In this new version of the chart, this container is disabled by default (which should not affect most of the deployments). If your installation still requires that init container, execute `helm upgrade` with the `--set volumePermissions.enabled=true`.
|
||||
|
||||
### To 5.0.0
|
||||
|
||||
The default image in this release may be switched out for any image containing the `redis-server`
|
||||
and `redis-cli` binaries. If `redis-server` is not the default image ENTRYPOINT, `master.command`
|
||||
must be specified.
|
||||
|
||||
#### Breaking changes
|
||||
|
||||
- `master.args` and `slave.args` are removed. Use `master.command` or `slave.command` instead in order to override the image entrypoint, or `master.extraFlags` to pass additional flags to `redis-server`.
|
||||
- `disableCommands` is now interpreted as an array of strings instead of a string of comma separated values.
|
||||
- `master.persistence.path` now defaults to `/data`.
|
||||
|
||||
### To 4.0.0
|
||||
|
||||
This version removes the `chart` label from the `spec.selector.matchLabels`
|
||||
which is immutable since `StatefulSet apps/v1beta2`. It has been inadvertently
|
||||
added, causing any subsequent upgrade to fail. See https://github.com/helm/charts/issues/7726.
|
||||
|
||||
It also fixes https://github.com/helm/charts/issues/7726 where a deployment `extensions/v1beta1` can not be upgraded if `spec.selector` is not explicitly set.
|
||||
|
||||
Finally, it fixes https://github.com/helm/charts/issues/7803 by removing mutable labels in `spec.VolumeClaimTemplate.metadata.labels` so that it is upgradable.
|
||||
|
||||
In order to upgrade, delete the Redis® StatefulSet before upgrading:
|
||||
|
||||
```bash
|
||||
kubectl delete statefulsets.apps --cascade=false my-release-redis-master
|
||||
```
|
||||
|
||||
And edit the Redis® slave (and metrics if enabled) deployment:
|
||||
|
||||
```bash
|
||||
kubectl patch deployments my-release-redis-slave --type=json -p='[{"op": "remove", "path": "/spec/selector/matchLabels/chart"}]'
|
||||
kubectl patch deployments my-release-redis-metrics --type=json -p='[{"op": "remove", "path": "/spec/selector/matchLabels/chart"}]'
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Copyright © 2022 Bitnami
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
22
pomerium/charts/redis/charts/common/.helmignore
Normal file
22
pomerium/charts/redis/charts/common/.helmignore
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# 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/
|
||||
23
pomerium/charts/redis/charts/common/Chart.yaml
Normal file
23
pomerium/charts/redis/charts/common/Chart.yaml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
annotations:
|
||||
category: Infrastructure
|
||||
apiVersion: v2
|
||||
appVersion: 1.16.0
|
||||
description: A Library Helm Chart for grouping common logic between bitnami charts.
|
||||
This chart is not deployable by itself.
|
||||
home: https://github.com/bitnami/charts/tree/master/bitnami/common
|
||||
icon: https://bitnami.com/downloads/logos/bitnami-mark.png
|
||||
keywords:
|
||||
- common
|
||||
- helper
|
||||
- template
|
||||
- function
|
||||
- bitnami
|
||||
maintainers:
|
||||
- name: Bitnami
|
||||
url: https://github.com/bitnami/charts
|
||||
name: common
|
||||
sources:
|
||||
- https://github.com/bitnami/charts
|
||||
- https://www.bitnami.com/
|
||||
type: library
|
||||
version: 1.16.1
|
||||
350
pomerium/charts/redis/charts/common/README.md
Normal file
350
pomerium/charts/redis/charts/common/README.md
Normal file
|
|
@ -0,0 +1,350 @@
|
|||
# Bitnami Common Library Chart
|
||||
|
||||
A [Helm Library Chart](https://helm.sh/docs/topics/library_charts/#helm) for grouping common logic between bitnami charts.
|
||||
|
||||
## TL;DR
|
||||
|
||||
```yaml
|
||||
dependencies:
|
||||
- name: common
|
||||
version: 1.x.x
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
```
|
||||
|
||||
```bash
|
||||
$ helm dependency update
|
||||
```
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "common.names.fullname" . }}
|
||||
data:
|
||||
myvalue: "Hello World"
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
||||
This chart provides a common template helpers which can be used to develop new charts using [Helm](https://helm.sh) package manager.
|
||||
|
||||
Bitnami charts can be used with [Kubeapps](https://kubeapps.dev/) for deployment and management of Helm Charts in clusters.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Kubernetes 1.19+
|
||||
- Helm 3.2.0+
|
||||
|
||||
## Parameters
|
||||
|
||||
The following table lists the helpers available in the library which are scoped in different sections.
|
||||
|
||||
### Affinities
|
||||
|
||||
| Helper identifier | Description | Expected Input |
|
||||
|-------------------------------|------------------------------------------------------|------------------------------------------------|
|
||||
| `common.affinities.nodes.soft` | Return a soft nodeAffinity definition | `dict "key" "FOO" "values" (list "BAR" "BAZ")` |
|
||||
| `common.affinities.nodes.hard` | Return a hard nodeAffinity definition | `dict "key" "FOO" "values" (list "BAR" "BAZ")` |
|
||||
| `common.affinities.pods.soft` | Return a soft podAffinity/podAntiAffinity definition | `dict "component" "FOO" "context" $` |
|
||||
| `common.affinities.pods.hard` | Return a hard podAffinity/podAntiAffinity definition | `dict "component" "FOO" "context" $` |
|
||||
|
||||
### Capabilities
|
||||
|
||||
| Helper identifier | Description | Expected Input |
|
||||
|------------------------------------------------|------------------------------------------------------------------------------------------------|-------------------|
|
||||
| `common.capabilities.kubeVersion` | Return the target Kubernetes version (using client default if .Values.kubeVersion is not set). | `.` Chart context |
|
||||
| `common.capabilities.cronjob.apiVersion` | Return the appropriate apiVersion for cronjob. | `.` Chart context |
|
||||
| `common.capabilities.deployment.apiVersion` | Return the appropriate apiVersion for deployment. | `.` Chart context |
|
||||
| `common.capabilities.statefulset.apiVersion` | Return the appropriate apiVersion for statefulset. | `.` Chart context |
|
||||
| `common.capabilities.ingress.apiVersion` | Return the appropriate apiVersion for ingress. | `.` Chart context |
|
||||
| `common.capabilities.rbac.apiVersion` | Return the appropriate apiVersion for RBAC resources. | `.` Chart context |
|
||||
| `common.capabilities.crd.apiVersion` | Return the appropriate apiVersion for CRDs. | `.` Chart context |
|
||||
| `common.capabilities.policy.apiVersion` | Return the appropriate apiVersion for podsecuritypolicy. | `.` Chart context |
|
||||
| `common.capabilities.networkPolicy.apiVersion` | Return the appropriate apiVersion for networkpolicy. | `.` Chart context |
|
||||
| `common.capabilities.apiService.apiVersion` | Return the appropriate apiVersion for APIService. | `.` Chart context |
|
||||
| `common.capabilities.hpa.apiVersion` | Return the appropriate apiVersion for Horizontal Pod Autoscaler | `.` Chart context |
|
||||
| `common.capabilities.supportsHelmVersion` | Returns true if the used Helm version is 3.3+ | `.` Chart context |
|
||||
|
||||
### Errors
|
||||
|
||||
| Helper identifier | Description | Expected Input |
|
||||
|-----------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|
|
||||
| `common.errors.upgrade.passwords.empty` | It will ensure required passwords are given when we are upgrading a chart. If `validationErrors` is not empty it will throw an error and will stop the upgrade action. | `dict "validationErrors" (list $validationError00 $validationError01) "context" $` |
|
||||
|
||||
### Images
|
||||
|
||||
| Helper identifier | Description | Expected Input |
|
||||
|-----------------------------|------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
|
||||
| `common.images.image` | Return the proper and full image name | `dict "imageRoot" .Values.path.to.the.image "global" $`, see [ImageRoot](#imageroot) for the structure. |
|
||||
| `common.images.pullSecrets` | Return the proper Docker Image Registry Secret Names (deprecated: use common.images.renderPullSecrets instead) | `dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "global" .Values.global` |
|
||||
| `common.images.renderPullSecrets` | Return the proper Docker Image Registry Secret Names (evaluates values as templates) | `dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "context" $` |
|
||||
|
||||
### Ingress
|
||||
|
||||
| Helper identifier | Description | Expected Input |
|
||||
|-------------------------------------------|-------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `common.ingress.backend` | Generate a proper Ingress backend entry depending on the API version | `dict "serviceName" "foo" "servicePort" "bar"`, see the [Ingress deprecation notice](https://kubernetes.io/blog/2019/07/18/api-deprecations-in-1-16/) for the syntax differences |
|
||||
| `common.ingress.supportsPathType` | Prints "true" if the pathType field is supported | `.` Chart context |
|
||||
| `common.ingress.supportsIngressClassname` | Prints "true" if the ingressClassname field is supported | `.` Chart context |
|
||||
| `common.ingress.certManagerRequest` | Prints "true" if required cert-manager annotations for TLS signed certificates are set in the Ingress annotations | `dict "annotations" .Values.path.to.the.ingress.annotations` |
|
||||
|
||||
### Labels
|
||||
|
||||
| Helper identifier | Description | Expected Input |
|
||||
|-----------------------------|-----------------------------------------------------------------------------|-------------------|
|
||||
| `common.labels.standard` | Return Kubernetes standard labels | `.` Chart context |
|
||||
| `common.labels.matchLabels` | Labels to use on `deploy.spec.selector.matchLabels` and `svc.spec.selector` | `.` Chart context |
|
||||
|
||||
### Names
|
||||
|
||||
| Helper identifier | Description | Expected Input |
|
||||
|-----------------------------------|-----------------------------------------------------------------------|-------------------|
|
||||
| `common.names.name` | Expand the name of the chart or use `.Values.nameOverride` | `.` Chart context |
|
||||
| `common.names.fullname` | Create a default fully qualified app name. | `.` Chart context |
|
||||
| `common.names.namespace` | Allow the release namespace to be overridden | `.` Chart context |
|
||||
| `common.names.fullname.namespace` | Create a fully qualified app name adding the installation's namespace | `.` Chart context |
|
||||
| `common.names.chart` | Chart name plus version | `.` Chart context |
|
||||
|
||||
### Secrets
|
||||
|
||||
| Helper identifier | Description | Expected Input |
|
||||
|---------------------------|--------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `common.secrets.name` | Generate the name of the secret. | `dict "existingSecret" .Values.path.to.the.existingSecret "defaultNameSuffix" "mySuffix" "context" $` see [ExistingSecret](#existingsecret) for the structure. |
|
||||
| `common.secrets.key` | Generate secret key. | `dict "existingSecret" .Values.path.to.the.existingSecret "key" "keyName"` see [ExistingSecret](#existingsecret) for the structure. |
|
||||
| `common.passwords.manage` | Generate secret password or retrieve one if already created. | `dict "secret" "secret-name" "key" "keyName" "providedValues" (list "path.to.password1" "path.to.password2") "length" 10 "strong" false "chartName" "chartName" "context" $`, length, strong and chartNAme fields are optional. |
|
||||
| `common.secrets.exists` | Returns whether a previous generated secret already exists. | `dict "secret" "secret-name" "context" $` |
|
||||
|
||||
### Storage
|
||||
|
||||
| Helper identifier | Description | Expected Input |
|
||||
|-------------------------------|---------------------------------------|---------------------------------------------------------------------------------------------------------------------|
|
||||
| `common.storage.class` | Return the proper Storage Class | `dict "persistence" .Values.path.to.the.persistence "global" $`, see [Persistence](#persistence) for the structure. |
|
||||
|
||||
### TplValues
|
||||
|
||||
| Helper identifier | Description | Expected Input |
|
||||
|---------------------------|----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `common.tplvalues.render` | Renders a value that contains template | `dict "value" .Values.path.to.the.Value "context" $`, value is the value should rendered as template, context frequently is the chart context `$` or `.` |
|
||||
|
||||
### Utils
|
||||
|
||||
| Helper identifier | Description | Expected Input |
|
||||
|--------------------------------|------------------------------------------------------------------------------------------|------------------------------------------------------------------------|
|
||||
| `common.utils.fieldToEnvVar` | Build environment variable name given a field. | `dict "field" "my-password"` |
|
||||
| `common.utils.secret.getvalue` | Print instructions to get a secret value. | `dict "secret" "secret-name" "field" "secret-value-field" "context" $` |
|
||||
| `common.utils.getValueFromKey` | Gets a value from `.Values` object given its key path | `dict "key" "path.to.key" "context" $` |
|
||||
| `common.utils.getKeyFromList` | Returns first `.Values` key with a defined value or first of the list if all non-defined | `dict "keys" (list "path.to.key1" "path.to.key2") "context" $` |
|
||||
|
||||
### Validations
|
||||
|
||||
| Helper identifier | Description | Expected Input |
|
||||
|--------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `common.validations.values.single.empty` | Validate a value must not be empty. | `dict "valueKey" "path.to.value" "secret" "secret.name" "field" "my-password" "subchart" "subchart" "context" $` secret, field and subchart are optional. In case they are given, the helper will generate a how to get instruction. See [ValidateValue](#validatevalue) |
|
||||
| `common.validations.values.multiple.empty` | Validate a multiple values must not be empty. It returns a shared error for all the values. | `dict "required" (list $validateValueConf00 $validateValueConf01) "context" $`. See [ValidateValue](#validatevalue) |
|
||||
| `common.validations.values.mariadb.passwords` | This helper will ensure required password for MariaDB are not empty. It returns a shared error for all the values. | `dict "secret" "mariadb-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use mariadb chart and the helper. |
|
||||
| `common.validations.values.mysql.passwords` | This helper will ensure required password for MySQL are not empty. It returns a shared error for all the values. | `dict "secret" "mysql-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use mysql chart and the helper. |
|
||||
| `common.validations.values.postgresql.passwords` | This helper will ensure required password for PostgreSQL are not empty. It returns a shared error for all the values. | `dict "secret" "postgresql-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use postgresql chart and the helper. |
|
||||
| `common.validations.values.redis.passwords` | This helper will ensure required password for Redis® are not empty. It returns a shared error for all the values. | `dict "secret" "redis-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use redis chart and the helper. |
|
||||
| `common.validations.values.cassandra.passwords` | This helper will ensure required password for Cassandra are not empty. It returns a shared error for all the values. | `dict "secret" "cassandra-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use cassandra chart and the helper. |
|
||||
| `common.validations.values.mongodb.passwords` | This helper will ensure required password for MongoDB® are not empty. It returns a shared error for all the values. | `dict "secret" "mongodb-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use mongodb chart and the helper. |
|
||||
|
||||
### Warnings
|
||||
|
||||
| Helper identifier | Description | Expected Input |
|
||||
|------------------------------|----------------------------------|------------------------------------------------------------|
|
||||
| `common.warnings.rollingTag` | Warning about using rolling tag. | `ImageRoot` see [ImageRoot](#imageroot) for the structure. |
|
||||
|
||||
## Special input schemas
|
||||
|
||||
### ImageRoot
|
||||
|
||||
```yaml
|
||||
registry:
|
||||
type: string
|
||||
description: Docker registry where the image is located
|
||||
example: docker.io
|
||||
|
||||
repository:
|
||||
type: string
|
||||
description: Repository and image name
|
||||
example: bitnami/nginx
|
||||
|
||||
tag:
|
||||
type: string
|
||||
description: image tag
|
||||
example: 1.16.1-debian-10-r63
|
||||
|
||||
pullPolicy:
|
||||
type: string
|
||||
description: Specify a imagePullPolicy. Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
|
||||
|
||||
pullSecrets:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: Optionally specify an array of imagePullSecrets (evaluated as templates).
|
||||
|
||||
debug:
|
||||
type: boolean
|
||||
description: Set to true if you would like to see extra information on logs
|
||||
example: false
|
||||
|
||||
## An instance would be:
|
||||
# registry: docker.io
|
||||
# repository: bitnami/nginx
|
||||
# tag: 1.16.1-debian-10-r63
|
||||
# pullPolicy: IfNotPresent
|
||||
# debug: false
|
||||
```
|
||||
|
||||
### Persistence
|
||||
|
||||
```yaml
|
||||
enabled:
|
||||
type: boolean
|
||||
description: Whether enable persistence.
|
||||
example: true
|
||||
|
||||
storageClass:
|
||||
type: string
|
||||
description: Ghost data Persistent Volume Storage Class, If set to "-", storageClassName: "" which disables dynamic provisioning.
|
||||
example: "-"
|
||||
|
||||
accessMode:
|
||||
type: string
|
||||
description: Access mode for the Persistent Volume Storage.
|
||||
example: ReadWriteOnce
|
||||
|
||||
size:
|
||||
type: string
|
||||
description: Size the Persistent Volume Storage.
|
||||
example: 8Gi
|
||||
|
||||
path:
|
||||
type: string
|
||||
description: Path to be persisted.
|
||||
example: /bitnami
|
||||
|
||||
## An instance would be:
|
||||
# enabled: true
|
||||
# storageClass: "-"
|
||||
# accessMode: ReadWriteOnce
|
||||
# size: 8Gi
|
||||
# path: /bitnami
|
||||
```
|
||||
|
||||
### ExistingSecret
|
||||
|
||||
```yaml
|
||||
name:
|
||||
type: string
|
||||
description: Name of the existing secret.
|
||||
example: mySecret
|
||||
keyMapping:
|
||||
description: Mapping between the expected key name and the name of the key in the existing secret.
|
||||
type: object
|
||||
|
||||
## An instance would be:
|
||||
# name: mySecret
|
||||
# keyMapping:
|
||||
# password: myPasswordKey
|
||||
```
|
||||
|
||||
#### Example of use
|
||||
|
||||
When we store sensitive data for a deployment in a secret, some times we want to give to users the possibility of using theirs existing secrets.
|
||||
|
||||
```yaml
|
||||
# templates/secret.yaml
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ include "common.names.fullname" . }}
|
||||
labels:
|
||||
app: {{ include "common.names.fullname" . }}
|
||||
type: Opaque
|
||||
data:
|
||||
password: {{ .Values.password | b64enc | quote }}
|
||||
|
||||
# templates/dpl.yaml
|
||||
---
|
||||
...
|
||||
env:
|
||||
- name: PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "common.secrets.name" (dict "existingSecret" .Values.existingSecret "context" $) }}
|
||||
key: {{ include "common.secrets.key" (dict "existingSecret" .Values.existingSecret "key" "password") }}
|
||||
...
|
||||
|
||||
# values.yaml
|
||||
---
|
||||
name: mySecret
|
||||
keyMapping:
|
||||
password: myPasswordKey
|
||||
```
|
||||
|
||||
### ValidateValue
|
||||
|
||||
#### NOTES.txt
|
||||
|
||||
```console
|
||||
{{- $validateValueConf00 := (dict "valueKey" "path.to.value00" "secret" "secretName" "field" "password-00") -}}
|
||||
{{- $validateValueConf01 := (dict "valueKey" "path.to.value01" "secret" "secretName" "field" "password-01") -}}
|
||||
|
||||
{{ include "common.validations.values.multiple.empty" (dict "required" (list $validateValueConf00 $validateValueConf01) "context" $) }}
|
||||
```
|
||||
|
||||
If we force those values to be empty we will see some alerts
|
||||
|
||||
```console
|
||||
$ helm install test mychart --set path.to.value00="",path.to.value01=""
|
||||
'path.to.value00' must not be empty, please add '--set path.to.value00=$PASSWORD_00' to the command. To get the current value:
|
||||
|
||||
export PASSWORD_00=$(kubectl get secret --namespace default secretName -o jsonpath="{.data.password-00}" | base64 -d)
|
||||
|
||||
'path.to.value01' must not be empty, please add '--set path.to.value01=$PASSWORD_01' to the command. To get the current value:
|
||||
|
||||
export PASSWORD_01=$(kubectl get secret --namespace default secretName -o jsonpath="{.data.password-01}" | base64 -d)
|
||||
```
|
||||
|
||||
## Upgrading
|
||||
|
||||
### To 1.0.0
|
||||
|
||||
[On November 13, 2020, Helm v2 support was formally finished](https://github.com/helm/charts#status-of-the-project), this major version is the result of the required changes applied to the Helm Chart to be able to incorporate the different features added in Helm v3 and to be consistent with the Helm project itself regarding the Helm v2 EOL.
|
||||
|
||||
**What changes were introduced in this major version?**
|
||||
|
||||
- Previous versions of this Helm Chart use `apiVersion: v1` (installable by both Helm 2 and 3), this Helm Chart was updated to `apiVersion: v2` (installable by Helm 3 only). [Here](https://helm.sh/docs/topics/charts/#the-apiversion-field) you can find more information about the `apiVersion` field.
|
||||
- Use `type: library`. [Here](https://v3.helm.sh/docs/faq/#library-chart-support) you can find more information.
|
||||
- The different fields present in the *Chart.yaml* file has been ordered alphabetically in a homogeneous way for all the Bitnami Helm Charts
|
||||
|
||||
**Considerations when upgrading to this version**
|
||||
|
||||
- If you want to upgrade to this version from a previous one installed with Helm v3, you shouldn't face any issues
|
||||
- If you want to upgrade to this version using Helm v2, this scenario is not supported as this version doesn't support Helm v2 anymore
|
||||
- If you installed the previous version with Helm v2 and wants to upgrade to this version with Helm v3, please refer to the [official Helm documentation](https://helm.sh/docs/topics/v2_v3_migration/#migration-use-cases) about migrating from Helm v2 to v3
|
||||
|
||||
**Useful links**
|
||||
|
||||
- https://docs.bitnami.com/tutorials/resolve-helm2-helm3-post-migration-issues/
|
||||
- https://helm.sh/docs/topics/v2_v3_migration/
|
||||
- https://helm.sh/blog/migrate-from-helm-v2-to-helm-v3/
|
||||
|
||||
## License
|
||||
|
||||
Copyright © 2022 Bitnami
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
102
pomerium/charts/redis/charts/common/templates/_affinities.tpl
Normal file
102
pomerium/charts/redis/charts/common/templates/_affinities.tpl
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
{{/* vim: set filetype=mustache: */}}
|
||||
|
||||
{{/*
|
||||
Return a soft nodeAffinity definition
|
||||
{{ include "common.affinities.nodes.soft" (dict "key" "FOO" "values" (list "BAR" "BAZ")) -}}
|
||||
*/}}
|
||||
{{- define "common.affinities.nodes.soft" -}}
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- preference:
|
||||
matchExpressions:
|
||||
- key: {{ .key }}
|
||||
operator: In
|
||||
values:
|
||||
{{- range .values }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
weight: 1
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return a hard nodeAffinity definition
|
||||
{{ include "common.affinities.nodes.hard" (dict "key" "FOO" "values" (list "BAR" "BAZ")) -}}
|
||||
*/}}
|
||||
{{- define "common.affinities.nodes.hard" -}}
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: {{ .key }}
|
||||
operator: In
|
||||
values:
|
||||
{{- range .values }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return a nodeAffinity definition
|
||||
{{ include "common.affinities.nodes" (dict "type" "soft" "key" "FOO" "values" (list "BAR" "BAZ")) -}}
|
||||
*/}}
|
||||
{{- define "common.affinities.nodes" -}}
|
||||
{{- if eq .type "soft" }}
|
||||
{{- include "common.affinities.nodes.soft" . -}}
|
||||
{{- else if eq .type "hard" }}
|
||||
{{- include "common.affinities.nodes.hard" . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return a soft podAffinity/podAntiAffinity definition
|
||||
{{ include "common.affinities.pods.soft" (dict "component" "FOO" "extraMatchLabels" .Values.extraMatchLabels "context" $) -}}
|
||||
*/}}
|
||||
{{- define "common.affinities.pods.soft" -}}
|
||||
{{- $component := default "" .component -}}
|
||||
{{- $extraMatchLabels := default (dict) .extraMatchLabels -}}
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- podAffinityTerm:
|
||||
labelSelector:
|
||||
matchLabels: {{- (include "common.labels.matchLabels" .context) | nindent 10 }}
|
||||
{{- if not (empty $component) }}
|
||||
{{ printf "app.kubernetes.io/component: %s" $component }}
|
||||
{{- end }}
|
||||
{{- range $key, $value := $extraMatchLabels }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
namespaces:
|
||||
- {{ include "common.names.namespace" .context | quote }}
|
||||
topologyKey: kubernetes.io/hostname
|
||||
weight: 1
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return a hard podAffinity/podAntiAffinity definition
|
||||
{{ include "common.affinities.pods.hard" (dict "component" "FOO" "extraMatchLabels" .Values.extraMatchLabels "context" $) -}}
|
||||
*/}}
|
||||
{{- define "common.affinities.pods.hard" -}}
|
||||
{{- $component := default "" .component -}}
|
||||
{{- $extraMatchLabels := default (dict) .extraMatchLabels -}}
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
- labelSelector:
|
||||
matchLabels: {{- (include "common.labels.matchLabels" .context) | nindent 8 }}
|
||||
{{- if not (empty $component) }}
|
||||
{{ printf "app.kubernetes.io/component: %s" $component }}
|
||||
{{- end }}
|
||||
{{- range $key, $value := $extraMatchLabels }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
namespaces:
|
||||
- {{ include "common.names.namespace" .context | quote }}
|
||||
topologyKey: kubernetes.io/hostname
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return a podAffinity/podAntiAffinity definition
|
||||
{{ include "common.affinities.pods" (dict "type" "soft" "key" "FOO" "values" (list "BAR" "BAZ")) -}}
|
||||
*/}}
|
||||
{{- define "common.affinities.pods" -}}
|
||||
{{- if eq .type "soft" }}
|
||||
{{- include "common.affinities.pods.soft" . -}}
|
||||
{{- else if eq .type "hard" }}
|
||||
{{- include "common.affinities.pods.hard" . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
154
pomerium/charts/redis/charts/common/templates/_capabilities.tpl
Normal file
154
pomerium/charts/redis/charts/common/templates/_capabilities.tpl
Normal file
|
|
@ -0,0 +1,154 @@
|
|||
{{/* vim: set filetype=mustache: */}}
|
||||
|
||||
{{/*
|
||||
Return the target Kubernetes version
|
||||
*/}}
|
||||
{{- define "common.capabilities.kubeVersion" -}}
|
||||
{{- if .Values.global }}
|
||||
{{- if .Values.global.kubeVersion }}
|
||||
{{- .Values.global.kubeVersion -}}
|
||||
{{- else }}
|
||||
{{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}}
|
||||
{{- end -}}
|
||||
{{- else }}
|
||||
{{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the appropriate apiVersion for poddisruptionbudget.
|
||||
*/}}
|
||||
{{- define "common.capabilities.policy.apiVersion" -}}
|
||||
{{- if semverCompare "<1.21-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||
{{- print "policy/v1beta1" -}}
|
||||
{{- else -}}
|
||||
{{- print "policy/v1" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the appropriate apiVersion for networkpolicy.
|
||||
*/}}
|
||||
{{- define "common.capabilities.networkPolicy.apiVersion" -}}
|
||||
{{- if semverCompare "<1.7-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||
{{- print "extensions/v1beta1" -}}
|
||||
{{- else -}}
|
||||
{{- print "networking.k8s.io/v1" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the appropriate apiVersion for cronjob.
|
||||
*/}}
|
||||
{{- define "common.capabilities.cronjob.apiVersion" -}}
|
||||
{{- if semverCompare "<1.21-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||
{{- print "batch/v1beta1" -}}
|
||||
{{- else -}}
|
||||
{{- print "batch/v1" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the appropriate apiVersion for deployment.
|
||||
*/}}
|
||||
{{- define "common.capabilities.deployment.apiVersion" -}}
|
||||
{{- if semverCompare "<1.14-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||
{{- print "extensions/v1beta1" -}}
|
||||
{{- else -}}
|
||||
{{- print "apps/v1" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the appropriate apiVersion for statefulset.
|
||||
*/}}
|
||||
{{- define "common.capabilities.statefulset.apiVersion" -}}
|
||||
{{- if semverCompare "<1.14-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||
{{- print "apps/v1beta1" -}}
|
||||
{{- else -}}
|
||||
{{- print "apps/v1" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the appropriate apiVersion for ingress.
|
||||
*/}}
|
||||
{{- define "common.capabilities.ingress.apiVersion" -}}
|
||||
{{- if .Values.ingress -}}
|
||||
{{- if .Values.ingress.apiVersion -}}
|
||||
{{- .Values.ingress.apiVersion -}}
|
||||
{{- else if semverCompare "<1.14-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||
{{- print "extensions/v1beta1" -}}
|
||||
{{- else if semverCompare "<1.19-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||
{{- print "networking.k8s.io/v1beta1" -}}
|
||||
{{- else -}}
|
||||
{{- print "networking.k8s.io/v1" -}}
|
||||
{{- end }}
|
||||
{{- else if semverCompare "<1.14-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||
{{- print "extensions/v1beta1" -}}
|
||||
{{- else if semverCompare "<1.19-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||
{{- print "networking.k8s.io/v1beta1" -}}
|
||||
{{- else -}}
|
||||
{{- print "networking.k8s.io/v1" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the appropriate apiVersion for RBAC resources.
|
||||
*/}}
|
||||
{{- define "common.capabilities.rbac.apiVersion" -}}
|
||||
{{- if semverCompare "<1.17-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||
{{- print "rbac.authorization.k8s.io/v1beta1" -}}
|
||||
{{- else -}}
|
||||
{{- print "rbac.authorization.k8s.io/v1" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the appropriate apiVersion for CRDs.
|
||||
*/}}
|
||||
{{- define "common.capabilities.crd.apiVersion" -}}
|
||||
{{- if semverCompare "<1.19-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||
{{- print "apiextensions.k8s.io/v1beta1" -}}
|
||||
{{- else -}}
|
||||
{{- print "apiextensions.k8s.io/v1" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the appropriate apiVersion for APIService.
|
||||
*/}}
|
||||
{{- define "common.capabilities.apiService.apiVersion" -}}
|
||||
{{- if semverCompare "<1.10-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||
{{- print "apiregistration.k8s.io/v1beta1" -}}
|
||||
{{- else -}}
|
||||
{{- print "apiregistration.k8s.io/v1" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the appropriate apiVersion for Horizontal Pod Autoscaler.
|
||||
*/}}
|
||||
{{- define "common.capabilities.hpa.apiVersion" -}}
|
||||
{{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .context) -}}
|
||||
{{- if .beta2 -}}
|
||||
{{- print "autoscaling/v2beta2" -}}
|
||||
{{- else -}}
|
||||
{{- print "autoscaling/v2beta1" -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- print "autoscaling/v2" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Returns true if the used Helm version is 3.3+.
|
||||
A way to check the used Helm version was not introduced until version 3.3.0 with .Capabilities.HelmVersion, which contains an additional "{}}" structure.
|
||||
This check is introduced as a regexMatch instead of {{ if .Capabilities.HelmVersion }} because checking for the key HelmVersion in <3.3 results in a "interface not found" error.
|
||||
**To be removed when the catalog's minimun Helm version is 3.3**
|
||||
*/}}
|
||||
{{- define "common.capabilities.supportsHelmVersion" -}}
|
||||
{{- if regexMatch "{(v[0-9])*[^}]*}}$" (.Capabilities | toString ) }}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
23
pomerium/charts/redis/charts/common/templates/_errors.tpl
Normal file
23
pomerium/charts/redis/charts/common/templates/_errors.tpl
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Through error when upgrading using empty passwords values that must not be empty.
|
||||
|
||||
Usage:
|
||||
{{- $validationError00 := include "common.validations.values.single.empty" (dict "valueKey" "path.to.password00" "secret" "secretName" "field" "password-00") -}}
|
||||
{{- $validationError01 := include "common.validations.values.single.empty" (dict "valueKey" "path.to.password01" "secret" "secretName" "field" "password-01") -}}
|
||||
{{ include "common.errors.upgrade.passwords.empty" (dict "validationErrors" (list $validationError00 $validationError01) "context" $) }}
|
||||
|
||||
Required password params:
|
||||
- validationErrors - String - Required. List of validation strings to be return, if it is empty it won't throw error.
|
||||
- context - Context - Required. Parent context.
|
||||
*/}}
|
||||
{{- define "common.errors.upgrade.passwords.empty" -}}
|
||||
{{- $validationErrors := join "" .validationErrors -}}
|
||||
{{- if and $validationErrors .context.Release.IsUpgrade -}}
|
||||
{{- $errorString := "\nPASSWORDS ERROR: You must provide your current passwords when upgrading the release." -}}
|
||||
{{- $errorString = print $errorString "\n Note that even after reinstallation, old credentials may be needed as they may be kept in persistent volume claims." -}}
|
||||
{{- $errorString = print $errorString "\n Further information can be obtained at https://docs.bitnami.com/general/how-to/troubleshoot-helm-chart-issues/#credential-errors-while-upgrading-chart-releases" -}}
|
||||
{{- $errorString = print $errorString "\n%s" -}}
|
||||
{{- printf $errorString $validationErrors | fail -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
75
pomerium/charts/redis/charts/common/templates/_images.tpl
Normal file
75
pomerium/charts/redis/charts/common/templates/_images.tpl
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Return the proper image name
|
||||
{{ include "common.images.image" ( dict "imageRoot" .Values.path.to.the.image "global" $) }}
|
||||
*/}}
|
||||
{{- define "common.images.image" -}}
|
||||
{{- $registryName := .imageRoot.registry -}}
|
||||
{{- $repositoryName := .imageRoot.repository -}}
|
||||
{{- $tag := .imageRoot.tag | toString -}}
|
||||
{{- if .global }}
|
||||
{{- if .global.imageRegistry }}
|
||||
{{- $registryName = .global.imageRegistry -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if $registryName }}
|
||||
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s:%s" $repositoryName $tag -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Docker Image Registry Secret Names (deprecated: use common.images.renderPullSecrets instead)
|
||||
{{ include "common.images.pullSecrets" ( dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "global" .Values.global) }}
|
||||
*/}}
|
||||
{{- define "common.images.pullSecrets" -}}
|
||||
{{- $pullSecrets := list }}
|
||||
|
||||
{{- if .global }}
|
||||
{{- range .global.imagePullSecrets -}}
|
||||
{{- $pullSecrets = append $pullSecrets . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- range .images -}}
|
||||
{{- range .pullSecrets -}}
|
||||
{{- $pullSecrets = append $pullSecrets . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if (not (empty $pullSecrets)) }}
|
||||
imagePullSecrets:
|
||||
{{- range $pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Docker Image Registry Secret Names evaluating values as templates
|
||||
{{ include "common.images.renderPullSecrets" ( dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "context" $) }}
|
||||
*/}}
|
||||
{{- define "common.images.renderPullSecrets" -}}
|
||||
{{- $pullSecrets := list }}
|
||||
{{- $context := .context }}
|
||||
|
||||
{{- if $context.Values.global }}
|
||||
{{- range $context.Values.global.imagePullSecrets -}}
|
||||
{{- $pullSecrets = append $pullSecrets (include "common.tplvalues.render" (dict "value" . "context" $context)) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- range .images -}}
|
||||
{{- range .pullSecrets -}}
|
||||
{{- $pullSecrets = append $pullSecrets (include "common.tplvalues.render" (dict "value" . "context" $context)) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if (not (empty $pullSecrets)) }}
|
||||
imagePullSecrets:
|
||||
{{- range $pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
68
pomerium/charts/redis/charts/common/templates/_ingress.tpl
Normal file
68
pomerium/charts/redis/charts/common/templates/_ingress.tpl
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
{{/* vim: set filetype=mustache: */}}
|
||||
|
||||
{{/*
|
||||
Generate backend entry that is compatible with all Kubernetes API versions.
|
||||
|
||||
Usage:
|
||||
{{ include "common.ingress.backend" (dict "serviceName" "backendName" "servicePort" "backendPort" "context" $) }}
|
||||
|
||||
Params:
|
||||
- serviceName - String. Name of an existing service backend
|
||||
- servicePort - String/Int. Port name (or number) of the service. It will be translated to different yaml depending if it is a string or an integer.
|
||||
- context - Dict - Required. The context for the template evaluation.
|
||||
*/}}
|
||||
{{- define "common.ingress.backend" -}}
|
||||
{{- $apiVersion := (include "common.capabilities.ingress.apiVersion" .context) -}}
|
||||
{{- if or (eq $apiVersion "extensions/v1beta1") (eq $apiVersion "networking.k8s.io/v1beta1") -}}
|
||||
serviceName: {{ .serviceName }}
|
||||
servicePort: {{ .servicePort }}
|
||||
{{- else -}}
|
||||
service:
|
||||
name: {{ .serviceName }}
|
||||
port:
|
||||
{{- if typeIs "string" .servicePort }}
|
||||
name: {{ .servicePort }}
|
||||
{{- else if or (typeIs "int" .servicePort) (typeIs "float64" .servicePort) }}
|
||||
number: {{ .servicePort | int }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Print "true" if the API pathType field is supported
|
||||
Usage:
|
||||
{{ include "common.ingress.supportsPathType" . }}
|
||||
*/}}
|
||||
{{- define "common.ingress.supportsPathType" -}}
|
||||
{{- if (semverCompare "<1.18-0" (include "common.capabilities.kubeVersion" .)) -}}
|
||||
{{- print "false" -}}
|
||||
{{- else -}}
|
||||
{{- print "true" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Returns true if the ingressClassname field is supported
|
||||
Usage:
|
||||
{{ include "common.ingress.supportsIngressClassname" . }}
|
||||
*/}}
|
||||
{{- define "common.ingress.supportsIngressClassname" -}}
|
||||
{{- if semverCompare "<1.18-0" (include "common.capabilities.kubeVersion" .) -}}
|
||||
{{- print "false" -}}
|
||||
{{- else -}}
|
||||
{{- print "true" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return true if cert-manager required annotations for TLS signed
|
||||
certificates are set in the Ingress annotations
|
||||
Ref: https://cert-manager.io/docs/usage/ingress/#supported-annotations
|
||||
Usage:
|
||||
{{ include "common.ingress.certManagerRequest" ( dict "annotations" .Values.path.to.the.ingress.annotations ) }}
|
||||
*/}}
|
||||
{{- define "common.ingress.certManagerRequest" -}}
|
||||
{{ if or (hasKey .annotations "cert-manager.io/cluster-issuer") (hasKey .annotations "cert-manager.io/issuer") }}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
18
pomerium/charts/redis/charts/common/templates/_labels.tpl
Normal file
18
pomerium/charts/redis/charts/common/templates/_labels.tpl
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Kubernetes standard labels
|
||||
*/}}
|
||||
{{- define "common.labels.standard" -}}
|
||||
app.kubernetes.io/name: {{ include "common.names.name" . }}
|
||||
helm.sh/chart: {{ include "common.names.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Labels to use on deploy.spec.selector.matchLabels and svc.spec.selector
|
||||
*/}}
|
||||
{{- define "common.labels.matchLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "common.names.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end -}}
|
||||
70
pomerium/charts/redis/charts/common/templates/_names.tpl
Normal file
70
pomerium/charts/redis/charts/common/templates/_names.tpl
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "common.names.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "common.names.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | 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 "common.names.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 a default fully qualified dependency 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.
|
||||
Usage:
|
||||
{{ include "common.names.dependency.fullname" (dict "chartName" "dependency-chart-name" "chartValues" .Values.dependency-chart "context" $) }}
|
||||
*/}}
|
||||
{{- define "common.names.dependency.fullname" -}}
|
||||
{{- if .chartValues.fullnameOverride -}}
|
||||
{{- .chartValues.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- $name := default .chartName .chartValues.nameOverride -}}
|
||||
{{- if contains $name .context.Release.Name -}}
|
||||
{{- .context.Release.Name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-%s" .context.Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Allow the release namespace to be overridden for multi-namespace deployments in combined charts.
|
||||
*/}}
|
||||
{{- define "common.names.namespace" -}}
|
||||
{{- if .Values.namespaceOverride -}}
|
||||
{{- .Values.namespaceOverride -}}
|
||||
{{- else -}}
|
||||
{{- .Release.Namespace -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a fully qualified app name adding the installation's namespace.
|
||||
*/}}
|
||||
{{- define "common.names.fullname.namespace" -}}
|
||||
{{- printf "%s-%s" (include "common.names.fullname" .) (include "common.names.namespace" .) | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
140
pomerium/charts/redis/charts/common/templates/_secrets.tpl
Normal file
140
pomerium/charts/redis/charts/common/templates/_secrets.tpl
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Generate secret name.
|
||||
|
||||
Usage:
|
||||
{{ include "common.secrets.name" (dict "existingSecret" .Values.path.to.the.existingSecret "defaultNameSuffix" "mySuffix" "context" $) }}
|
||||
|
||||
Params:
|
||||
- existingSecret - ExistingSecret/String - Optional. The path to the existing secrets in the values.yaml given by the user
|
||||
to be used instead of the default one. Allows for it to be of type String (just the secret name) for backwards compatibility.
|
||||
+info: https://github.com/bitnami/charts/tree/master/bitnami/common#existingsecret
|
||||
- defaultNameSuffix - String - Optional. It is used only if we have several secrets in the same deployment.
|
||||
- context - Dict - Required. The context for the template evaluation.
|
||||
*/}}
|
||||
{{- define "common.secrets.name" -}}
|
||||
{{- $name := (include "common.names.fullname" .context) -}}
|
||||
|
||||
{{- if .defaultNameSuffix -}}
|
||||
{{- $name = printf "%s-%s" $name .defaultNameSuffix | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- with .existingSecret -}}
|
||||
{{- if not (typeIs "string" .) -}}
|
||||
{{- with .name -}}
|
||||
{{- $name = . -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- $name = . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- printf "%s" $name -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Generate secret key.
|
||||
|
||||
Usage:
|
||||
{{ include "common.secrets.key" (dict "existingSecret" .Values.path.to.the.existingSecret "key" "keyName") }}
|
||||
|
||||
Params:
|
||||
- existingSecret - ExistingSecret/String - Optional. The path to the existing secrets in the values.yaml given by the user
|
||||
to be used instead of the default one. Allows for it to be of type String (just the secret name) for backwards compatibility.
|
||||
+info: https://github.com/bitnami/charts/tree/master/bitnami/common#existingsecret
|
||||
- key - String - Required. Name of the key in the secret.
|
||||
*/}}
|
||||
{{- define "common.secrets.key" -}}
|
||||
{{- $key := .key -}}
|
||||
|
||||
{{- if .existingSecret -}}
|
||||
{{- if not (typeIs "string" .existingSecret) -}}
|
||||
{{- if .existingSecret.keyMapping -}}
|
||||
{{- $key = index .existingSecret.keyMapping $.key -}}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- printf "%s" $key -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Generate secret password or retrieve one if already created.
|
||||
|
||||
Usage:
|
||||
{{ include "common.secrets.passwords.manage" (dict "secret" "secret-name" "key" "keyName" "providedValues" (list "path.to.password1" "path.to.password2") "length" 10 "strong" false "chartName" "chartName" "context" $) }}
|
||||
|
||||
Params:
|
||||
- secret - String - Required - Name of the 'Secret' resource where the password is stored.
|
||||
- key - String - Required - Name of the key in the secret.
|
||||
- providedValues - List<String> - Required - The path to the validating value in the values.yaml, e.g: "mysql.password". Will pick first parameter with a defined value.
|
||||
- length - int - Optional - Length of the generated random password.
|
||||
- strong - Boolean - Optional - Whether to add symbols to the generated random password.
|
||||
- chartName - String - Optional - Name of the chart used when said chart is deployed as a subchart.
|
||||
- context - Context - Required - Parent context.
|
||||
|
||||
The order in which this function returns a secret password:
|
||||
1. Already existing 'Secret' resource
|
||||
(If a 'Secret' resource is found under the name provided to the 'secret' parameter to this function and that 'Secret' resource contains a key with the name passed as the 'key' parameter to this function then the value of this existing secret password will be returned)
|
||||
2. Password provided via the values.yaml
|
||||
(If one of the keys passed to the 'providedValues' parameter to this function is a valid path to a key in the values.yaml and has a value, the value of the first key with a value will be returned)
|
||||
3. Randomly generated secret password
|
||||
(A new random secret password with the length specified in the 'length' parameter will be generated and returned)
|
||||
|
||||
*/}}
|
||||
{{- define "common.secrets.passwords.manage" -}}
|
||||
|
||||
{{- $password := "" }}
|
||||
{{- $subchart := "" }}
|
||||
{{- $chartName := default "" .chartName }}
|
||||
{{- $passwordLength := default 10 .length }}
|
||||
{{- $providedPasswordKey := include "common.utils.getKeyFromList" (dict "keys" .providedValues "context" $.context) }}
|
||||
{{- $providedPasswordValue := include "common.utils.getValueFromKey" (dict "key" $providedPasswordKey "context" $.context) }}
|
||||
{{- $secretData := (lookup "v1" "Secret" $.context.Release.Namespace .secret).data }}
|
||||
{{- if $secretData }}
|
||||
{{- if hasKey $secretData .key }}
|
||||
{{- $password = index $secretData .key }}
|
||||
{{- else }}
|
||||
{{- printf "\nPASSWORDS ERROR: The secret \"%s\" does not contain the key \"%s\"\n" .secret .key | fail -}}
|
||||
{{- end -}}
|
||||
{{- else if $providedPasswordValue }}
|
||||
{{- $password = $providedPasswordValue | toString | b64enc | quote }}
|
||||
{{- else }}
|
||||
|
||||
{{- if .context.Values.enabled }}
|
||||
{{- $subchart = $chartName }}
|
||||
{{- end -}}
|
||||
|
||||
{{- $requiredPassword := dict "valueKey" $providedPasswordKey "secret" .secret "field" .key "subchart" $subchart "context" $.context -}}
|
||||
{{- $requiredPasswordError := include "common.validations.values.single.empty" $requiredPassword -}}
|
||||
{{- $passwordValidationErrors := list $requiredPasswordError -}}
|
||||
{{- include "common.errors.upgrade.passwords.empty" (dict "validationErrors" $passwordValidationErrors "context" $.context) -}}
|
||||
|
||||
{{- if .strong }}
|
||||
{{- $subStr := list (lower (randAlpha 1)) (randNumeric 1) (upper (randAlpha 1)) | join "_" }}
|
||||
{{- $password = randAscii $passwordLength }}
|
||||
{{- $password = regexReplaceAllLiteral "\\W" $password "@" | substr 5 $passwordLength }}
|
||||
{{- $password = printf "%s%s" $subStr $password | toString | shuffle | b64enc | quote }}
|
||||
{{- else }}
|
||||
{{- $password = randAlphaNum $passwordLength | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- printf "%s" $password -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Returns whether a previous generated secret already exists
|
||||
|
||||
Usage:
|
||||
{{ include "common.secrets.exists" (dict "secret" "secret-name" "context" $) }}
|
||||
|
||||
Params:
|
||||
- secret - String - Required - Name of the 'Secret' resource where the password is stored.
|
||||
- context - Context - Required - Parent context.
|
||||
*/}}
|
||||
{{- define "common.secrets.exists" -}}
|
||||
{{- $secret := (lookup "v1" "Secret" $.context.Release.Namespace .secret) }}
|
||||
{{- if $secret }}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
23
pomerium/charts/redis/charts/common/templates/_storage.tpl
Normal file
23
pomerium/charts/redis/charts/common/templates/_storage.tpl
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Return the proper Storage Class
|
||||
{{ include "common.storage.class" ( dict "persistence" .Values.path.to.the.persistence "global" $) }}
|
||||
*/}}
|
||||
{{- define "common.storage.class" -}}
|
||||
|
||||
{{- $storageClass := .persistence.storageClass -}}
|
||||
{{- if .global -}}
|
||||
{{- if .global.storageClass -}}
|
||||
{{- $storageClass = .global.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $storageClass -}}
|
||||
{{- if (eq "-" $storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" $storageClass -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- end -}}
|
||||
13
pomerium/charts/redis/charts/common/templates/_tplvalues.tpl
Normal file
13
pomerium/charts/redis/charts/common/templates/_tplvalues.tpl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Renders a value that contains template.
|
||||
Usage:
|
||||
{{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $) }}
|
||||
*/}}
|
||||
{{- define "common.tplvalues.render" -}}
|
||||
{{- if typeIs "string" .value }}
|
||||
{{- tpl .value .context }}
|
||||
{{- else }}
|
||||
{{- tpl (.value | toYaml) .context }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
62
pomerium/charts/redis/charts/common/templates/_utils.tpl
Normal file
62
pomerium/charts/redis/charts/common/templates/_utils.tpl
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Print instructions to get a secret value.
|
||||
Usage:
|
||||
{{ include "common.utils.secret.getvalue" (dict "secret" "secret-name" "field" "secret-value-field" "context" $) }}
|
||||
*/}}
|
||||
{{- define "common.utils.secret.getvalue" -}}
|
||||
{{- $varname := include "common.utils.fieldToEnvVar" . -}}
|
||||
export {{ $varname }}=$(kubectl get secret --namespace {{ .context.Release.Namespace | quote }} {{ .secret }} -o jsonpath="{.data.{{ .field }}}" | base64 -d)
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Build env var name given a field
|
||||
Usage:
|
||||
{{ include "common.utils.fieldToEnvVar" dict "field" "my-password" }}
|
||||
*/}}
|
||||
{{- define "common.utils.fieldToEnvVar" -}}
|
||||
{{- $fieldNameSplit := splitList "-" .field -}}
|
||||
{{- $upperCaseFieldNameSplit := list -}}
|
||||
|
||||
{{- range $fieldNameSplit -}}
|
||||
{{- $upperCaseFieldNameSplit = append $upperCaseFieldNameSplit ( upper . ) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ join "_" $upperCaseFieldNameSplit }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Gets a value from .Values given
|
||||
Usage:
|
||||
{{ include "common.utils.getValueFromKey" (dict "key" "path.to.key" "context" $) }}
|
||||
*/}}
|
||||
{{- define "common.utils.getValueFromKey" -}}
|
||||
{{- $splitKey := splitList "." .key -}}
|
||||
{{- $value := "" -}}
|
||||
{{- $latestObj := $.context.Values -}}
|
||||
{{- range $splitKey -}}
|
||||
{{- if not $latestObj -}}
|
||||
{{- printf "please review the entire path of '%s' exists in values" $.key | fail -}}
|
||||
{{- end -}}
|
||||
{{- $value = ( index $latestObj . ) -}}
|
||||
{{- $latestObj = $value -}}
|
||||
{{- end -}}
|
||||
{{- printf "%v" (default "" $value) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Returns first .Values key with a defined value or first of the list if all non-defined
|
||||
Usage:
|
||||
{{ include "common.utils.getKeyFromList" (dict "keys" (list "path.to.key1" "path.to.key2") "context" $) }}
|
||||
*/}}
|
||||
{{- define "common.utils.getKeyFromList" -}}
|
||||
{{- $key := first .keys -}}
|
||||
{{- $reverseKeys := reverse .keys }}
|
||||
{{- range $reverseKeys }}
|
||||
{{- $value := include "common.utils.getValueFromKey" (dict "key" . "context" $.context ) }}
|
||||
{{- if $value -}}
|
||||
{{- $key = . }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- printf "%s" $key -}}
|
||||
{{- end -}}
|
||||
14
pomerium/charts/redis/charts/common/templates/_warnings.tpl
Normal file
14
pomerium/charts/redis/charts/common/templates/_warnings.tpl
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Warning about using rolling tag.
|
||||
Usage:
|
||||
{{ include "common.warnings.rollingTag" .Values.path.to.the.imageRoot }}
|
||||
*/}}
|
||||
{{- define "common.warnings.rollingTag" -}}
|
||||
|
||||
{{- if and (contains "bitnami/" .repository) (not (.tag | toString | regexFind "-r\\d+$|sha256:")) }}
|
||||
WARNING: Rolling tag detected ({{ .repository }}:{{ .tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
|
||||
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
|
||||
{{- end }}
|
||||
|
||||
{{- end -}}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Validate Cassandra required passwords are not empty.
|
||||
|
||||
Usage:
|
||||
{{ include "common.validations.values.cassandra.passwords" (dict "secret" "secretName" "subchart" false "context" $) }}
|
||||
Params:
|
||||
- secret - String - Required. Name of the secret where Cassandra values are stored, e.g: "cassandra-passwords-secret"
|
||||
- subchart - Boolean - Optional. Whether Cassandra is used as subchart or not. Default: false
|
||||
*/}}
|
||||
{{- define "common.validations.values.cassandra.passwords" -}}
|
||||
{{- $existingSecret := include "common.cassandra.values.existingSecret" . -}}
|
||||
{{- $enabled := include "common.cassandra.values.enabled" . -}}
|
||||
{{- $dbUserPrefix := include "common.cassandra.values.key.dbUser" . -}}
|
||||
{{- $valueKeyPassword := printf "%s.password" $dbUserPrefix -}}
|
||||
|
||||
{{- if and (or (not $existingSecret) (eq $existingSecret "\"\"")) (eq $enabled "true") -}}
|
||||
{{- $requiredPasswords := list -}}
|
||||
|
||||
{{- $requiredPassword := dict "valueKey" $valueKeyPassword "secret" .secret "field" "cassandra-password" -}}
|
||||
{{- $requiredPasswords = append $requiredPasswords $requiredPassword -}}
|
||||
|
||||
{{- include "common.validations.values.multiple.empty" (dict "required" $requiredPasswords "context" .context) -}}
|
||||
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Auxiliary function to get the right value for existingSecret.
|
||||
|
||||
Usage:
|
||||
{{ include "common.cassandra.values.existingSecret" (dict "context" $) }}
|
||||
Params:
|
||||
- subchart - Boolean - Optional. Whether Cassandra is used as subchart or not. Default: false
|
||||
*/}}
|
||||
{{- define "common.cassandra.values.existingSecret" -}}
|
||||
{{- if .subchart -}}
|
||||
{{- .context.Values.cassandra.dbUser.existingSecret | quote -}}
|
||||
{{- else -}}
|
||||
{{- .context.Values.dbUser.existingSecret | quote -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Auxiliary function to get the right value for enabled cassandra.
|
||||
|
||||
Usage:
|
||||
{{ include "common.cassandra.values.enabled" (dict "context" $) }}
|
||||
*/}}
|
||||
{{- define "common.cassandra.values.enabled" -}}
|
||||
{{- if .subchart -}}
|
||||
{{- printf "%v" .context.Values.cassandra.enabled -}}
|
||||
{{- else -}}
|
||||
{{- printf "%v" (not .context.Values.enabled) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Auxiliary function to get the right value for the key dbUser
|
||||
|
||||
Usage:
|
||||
{{ include "common.cassandra.values.key.dbUser" (dict "subchart" "true" "context" $) }}
|
||||
Params:
|
||||
- subchart - Boolean - Optional. Whether Cassandra is used as subchart or not. Default: false
|
||||
*/}}
|
||||
{{- define "common.cassandra.values.key.dbUser" -}}
|
||||
{{- if .subchart -}}
|
||||
cassandra.dbUser
|
||||
{{- else -}}
|
||||
dbUser
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Validate MariaDB required passwords are not empty.
|
||||
|
||||
Usage:
|
||||
{{ include "common.validations.values.mariadb.passwords" (dict "secret" "secretName" "subchart" false "context" $) }}
|
||||
Params:
|
||||
- secret - String - Required. Name of the secret where MariaDB values are stored, e.g: "mysql-passwords-secret"
|
||||
- subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false
|
||||
*/}}
|
||||
{{- define "common.validations.values.mariadb.passwords" -}}
|
||||
{{- $existingSecret := include "common.mariadb.values.auth.existingSecret" . -}}
|
||||
{{- $enabled := include "common.mariadb.values.enabled" . -}}
|
||||
{{- $architecture := include "common.mariadb.values.architecture" . -}}
|
||||
{{- $authPrefix := include "common.mariadb.values.key.auth" . -}}
|
||||
{{- $valueKeyRootPassword := printf "%s.rootPassword" $authPrefix -}}
|
||||
{{- $valueKeyUsername := printf "%s.username" $authPrefix -}}
|
||||
{{- $valueKeyPassword := printf "%s.password" $authPrefix -}}
|
||||
{{- $valueKeyReplicationPassword := printf "%s.replicationPassword" $authPrefix -}}
|
||||
|
||||
{{- if and (or (not $existingSecret) (eq $existingSecret "\"\"")) (eq $enabled "true") -}}
|
||||
{{- $requiredPasswords := list -}}
|
||||
|
||||
{{- $requiredRootPassword := dict "valueKey" $valueKeyRootPassword "secret" .secret "field" "mariadb-root-password" -}}
|
||||
{{- $requiredPasswords = append $requiredPasswords $requiredRootPassword -}}
|
||||
|
||||
{{- $valueUsername := include "common.utils.getValueFromKey" (dict "key" $valueKeyUsername "context" .context) }}
|
||||
{{- if not (empty $valueUsername) -}}
|
||||
{{- $requiredPassword := dict "valueKey" $valueKeyPassword "secret" .secret "field" "mariadb-password" -}}
|
||||
{{- $requiredPasswords = append $requiredPasswords $requiredPassword -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if (eq $architecture "replication") -}}
|
||||
{{- $requiredReplicationPassword := dict "valueKey" $valueKeyReplicationPassword "secret" .secret "field" "mariadb-replication-password" -}}
|
||||
{{- $requiredPasswords = append $requiredPasswords $requiredReplicationPassword -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- include "common.validations.values.multiple.empty" (dict "required" $requiredPasswords "context" .context) -}}
|
||||
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Auxiliary function to get the right value for existingSecret.
|
||||
|
||||
Usage:
|
||||
{{ include "common.mariadb.values.auth.existingSecret" (dict "context" $) }}
|
||||
Params:
|
||||
- subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false
|
||||
*/}}
|
||||
{{- define "common.mariadb.values.auth.existingSecret" -}}
|
||||
{{- if .subchart -}}
|
||||
{{- .context.Values.mariadb.auth.existingSecret | quote -}}
|
||||
{{- else -}}
|
||||
{{- .context.Values.auth.existingSecret | quote -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Auxiliary function to get the right value for enabled mariadb.
|
||||
|
||||
Usage:
|
||||
{{ include "common.mariadb.values.enabled" (dict "context" $) }}
|
||||
*/}}
|
||||
{{- define "common.mariadb.values.enabled" -}}
|
||||
{{- if .subchart -}}
|
||||
{{- printf "%v" .context.Values.mariadb.enabled -}}
|
||||
{{- else -}}
|
||||
{{- printf "%v" (not .context.Values.enabled) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Auxiliary function to get the right value for architecture
|
||||
|
||||
Usage:
|
||||
{{ include "common.mariadb.values.architecture" (dict "subchart" "true" "context" $) }}
|
||||
Params:
|
||||
- subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false
|
||||
*/}}
|
||||
{{- define "common.mariadb.values.architecture" -}}
|
||||
{{- if .subchart -}}
|
||||
{{- .context.Values.mariadb.architecture -}}
|
||||
{{- else -}}
|
||||
{{- .context.Values.architecture -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Auxiliary function to get the right value for the key auth
|
||||
|
||||
Usage:
|
||||
{{ include "common.mariadb.values.key.auth" (dict "subchart" "true" "context" $) }}
|
||||
Params:
|
||||
- subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false
|
||||
*/}}
|
||||
{{- define "common.mariadb.values.key.auth" -}}
|
||||
{{- if .subchart -}}
|
||||
mariadb.auth
|
||||
{{- else -}}
|
||||
auth
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Validate MongoDB® required passwords are not empty.
|
||||
|
||||
Usage:
|
||||
{{ include "common.validations.values.mongodb.passwords" (dict "secret" "secretName" "subchart" false "context" $) }}
|
||||
Params:
|
||||
- secret - String - Required. Name of the secret where MongoDB® values are stored, e.g: "mongodb-passwords-secret"
|
||||
- subchart - Boolean - Optional. Whether MongoDB® is used as subchart or not. Default: false
|
||||
*/}}
|
||||
{{- define "common.validations.values.mongodb.passwords" -}}
|
||||
{{- $existingSecret := include "common.mongodb.values.auth.existingSecret" . -}}
|
||||
{{- $enabled := include "common.mongodb.values.enabled" . -}}
|
||||
{{- $authPrefix := include "common.mongodb.values.key.auth" . -}}
|
||||
{{- $architecture := include "common.mongodb.values.architecture" . -}}
|
||||
{{- $valueKeyRootPassword := printf "%s.rootPassword" $authPrefix -}}
|
||||
{{- $valueKeyUsername := printf "%s.username" $authPrefix -}}
|
||||
{{- $valueKeyDatabase := printf "%s.database" $authPrefix -}}
|
||||
{{- $valueKeyPassword := printf "%s.password" $authPrefix -}}
|
||||
{{- $valueKeyReplicaSetKey := printf "%s.replicaSetKey" $authPrefix -}}
|
||||
{{- $valueKeyAuthEnabled := printf "%s.enabled" $authPrefix -}}
|
||||
|
||||
{{- $authEnabled := include "common.utils.getValueFromKey" (dict "key" $valueKeyAuthEnabled "context" .context) -}}
|
||||
|
||||
{{- if and (or (not $existingSecret) (eq $existingSecret "\"\"")) (eq $enabled "true") (eq $authEnabled "true") -}}
|
||||
{{- $requiredPasswords := list -}}
|
||||
|
||||
{{- $requiredRootPassword := dict "valueKey" $valueKeyRootPassword "secret" .secret "field" "mongodb-root-password" -}}
|
||||
{{- $requiredPasswords = append $requiredPasswords $requiredRootPassword -}}
|
||||
|
||||
{{- $valueUsername := include "common.utils.getValueFromKey" (dict "key" $valueKeyUsername "context" .context) }}
|
||||
{{- $valueDatabase := include "common.utils.getValueFromKey" (dict "key" $valueKeyDatabase "context" .context) }}
|
||||
{{- if and $valueUsername $valueDatabase -}}
|
||||
{{- $requiredPassword := dict "valueKey" $valueKeyPassword "secret" .secret "field" "mongodb-password" -}}
|
||||
{{- $requiredPasswords = append $requiredPasswords $requiredPassword -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if (eq $architecture "replicaset") -}}
|
||||
{{- $requiredReplicaSetKey := dict "valueKey" $valueKeyReplicaSetKey "secret" .secret "field" "mongodb-replica-set-key" -}}
|
||||
{{- $requiredPasswords = append $requiredPasswords $requiredReplicaSetKey -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- include "common.validations.values.multiple.empty" (dict "required" $requiredPasswords "context" .context) -}}
|
||||
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Auxiliary function to get the right value for existingSecret.
|
||||
|
||||
Usage:
|
||||
{{ include "common.mongodb.values.auth.existingSecret" (dict "context" $) }}
|
||||
Params:
|
||||
- subchart - Boolean - Optional. Whether MongoDb is used as subchart or not. Default: false
|
||||
*/}}
|
||||
{{- define "common.mongodb.values.auth.existingSecret" -}}
|
||||
{{- if .subchart -}}
|
||||
{{- .context.Values.mongodb.auth.existingSecret | quote -}}
|
||||
{{- else -}}
|
||||
{{- .context.Values.auth.existingSecret | quote -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Auxiliary function to get the right value for enabled mongodb.
|
||||
|
||||
Usage:
|
||||
{{ include "common.mongodb.values.enabled" (dict "context" $) }}
|
||||
*/}}
|
||||
{{- define "common.mongodb.values.enabled" -}}
|
||||
{{- if .subchart -}}
|
||||
{{- printf "%v" .context.Values.mongodb.enabled -}}
|
||||
{{- else -}}
|
||||
{{- printf "%v" (not .context.Values.enabled) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Auxiliary function to get the right value for the key auth
|
||||
|
||||
Usage:
|
||||
{{ include "common.mongodb.values.key.auth" (dict "subchart" "true" "context" $) }}
|
||||
Params:
|
||||
- subchart - Boolean - Optional. Whether MongoDB® is used as subchart or not. Default: false
|
||||
*/}}
|
||||
{{- define "common.mongodb.values.key.auth" -}}
|
||||
{{- if .subchart -}}
|
||||
mongodb.auth
|
||||
{{- else -}}
|
||||
auth
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Auxiliary function to get the right value for architecture
|
||||
|
||||
Usage:
|
||||
{{ include "common.mongodb.values.architecture" (dict "subchart" "true" "context" $) }}
|
||||
Params:
|
||||
- subchart - Boolean - Optional. Whether MongoDB® is used as subchart or not. Default: false
|
||||
*/}}
|
||||
{{- define "common.mongodb.values.architecture" -}}
|
||||
{{- if .subchart -}}
|
||||
{{- .context.Values.mongodb.architecture -}}
|
||||
{{- else -}}
|
||||
{{- .context.Values.architecture -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Validate MySQL required passwords are not empty.
|
||||
|
||||
Usage:
|
||||
{{ include "common.validations.values.mysql.passwords" (dict "secret" "secretName" "subchart" false "context" $) }}
|
||||
Params:
|
||||
- secret - String - Required. Name of the secret where MySQL values are stored, e.g: "mysql-passwords-secret"
|
||||
- subchart - Boolean - Optional. Whether MySQL is used as subchart or not. Default: false
|
||||
*/}}
|
||||
{{- define "common.validations.values.mysql.passwords" -}}
|
||||
{{- $existingSecret := include "common.mysql.values.auth.existingSecret" . -}}
|
||||
{{- $enabled := include "common.mysql.values.enabled" . -}}
|
||||
{{- $architecture := include "common.mysql.values.architecture" . -}}
|
||||
{{- $authPrefix := include "common.mysql.values.key.auth" . -}}
|
||||
{{- $valueKeyRootPassword := printf "%s.rootPassword" $authPrefix -}}
|
||||
{{- $valueKeyUsername := printf "%s.username" $authPrefix -}}
|
||||
{{- $valueKeyPassword := printf "%s.password" $authPrefix -}}
|
||||
{{- $valueKeyReplicationPassword := printf "%s.replicationPassword" $authPrefix -}}
|
||||
|
||||
{{- if and (or (not $existingSecret) (eq $existingSecret "\"\"")) (eq $enabled "true") -}}
|
||||
{{- $requiredPasswords := list -}}
|
||||
|
||||
{{- $requiredRootPassword := dict "valueKey" $valueKeyRootPassword "secret" .secret "field" "mysql-root-password" -}}
|
||||
{{- $requiredPasswords = append $requiredPasswords $requiredRootPassword -}}
|
||||
|
||||
{{- $valueUsername := include "common.utils.getValueFromKey" (dict "key" $valueKeyUsername "context" .context) }}
|
||||
{{- if not (empty $valueUsername) -}}
|
||||
{{- $requiredPassword := dict "valueKey" $valueKeyPassword "secret" .secret "field" "mysql-password" -}}
|
||||
{{- $requiredPasswords = append $requiredPasswords $requiredPassword -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if (eq $architecture "replication") -}}
|
||||
{{- $requiredReplicationPassword := dict "valueKey" $valueKeyReplicationPassword "secret" .secret "field" "mysql-replication-password" -}}
|
||||
{{- $requiredPasswords = append $requiredPasswords $requiredReplicationPassword -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- include "common.validations.values.multiple.empty" (dict "required" $requiredPasswords "context" .context) -}}
|
||||
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Auxiliary function to get the right value for existingSecret.
|
||||
|
||||
Usage:
|
||||
{{ include "common.mysql.values.auth.existingSecret" (dict "context" $) }}
|
||||
Params:
|
||||
- subchart - Boolean - Optional. Whether MySQL is used as subchart or not. Default: false
|
||||
*/}}
|
||||
{{- define "common.mysql.values.auth.existingSecret" -}}
|
||||
{{- if .subchart -}}
|
||||
{{- .context.Values.mysql.auth.existingSecret | quote -}}
|
||||
{{- else -}}
|
||||
{{- .context.Values.auth.existingSecret | quote -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Auxiliary function to get the right value for enabled mysql.
|
||||
|
||||
Usage:
|
||||
{{ include "common.mysql.values.enabled" (dict "context" $) }}
|
||||
*/}}
|
||||
{{- define "common.mysql.values.enabled" -}}
|
||||
{{- if .subchart -}}
|
||||
{{- printf "%v" .context.Values.mysql.enabled -}}
|
||||
{{- else -}}
|
||||
{{- printf "%v" (not .context.Values.enabled) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Auxiliary function to get the right value for architecture
|
||||
|
||||
Usage:
|
||||
{{ include "common.mysql.values.architecture" (dict "subchart" "true" "context" $) }}
|
||||
Params:
|
||||
- subchart - Boolean - Optional. Whether MySQL is used as subchart or not. Default: false
|
||||
*/}}
|
||||
{{- define "common.mysql.values.architecture" -}}
|
||||
{{- if .subchart -}}
|
||||
{{- .context.Values.mysql.architecture -}}
|
||||
{{- else -}}
|
||||
{{- .context.Values.architecture -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Auxiliary function to get the right value for the key auth
|
||||
|
||||
Usage:
|
||||
{{ include "common.mysql.values.key.auth" (dict "subchart" "true" "context" $) }}
|
||||
Params:
|
||||
- subchart - Boolean - Optional. Whether MySQL is used as subchart or not. Default: false
|
||||
*/}}
|
||||
{{- define "common.mysql.values.key.auth" -}}
|
||||
{{- if .subchart -}}
|
||||
mysql.auth
|
||||
{{- else -}}
|
||||
auth
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Validate PostgreSQL required passwords are not empty.
|
||||
|
||||
Usage:
|
||||
{{ include "common.validations.values.postgresql.passwords" (dict "secret" "secretName" "subchart" false "context" $) }}
|
||||
Params:
|
||||
- secret - String - Required. Name of the secret where postgresql values are stored, e.g: "postgresql-passwords-secret"
|
||||
- subchart - Boolean - Optional. Whether postgresql is used as subchart or not. Default: false
|
||||
*/}}
|
||||
{{- define "common.validations.values.postgresql.passwords" -}}
|
||||
{{- $existingSecret := include "common.postgresql.values.existingSecret" . -}}
|
||||
{{- $enabled := include "common.postgresql.values.enabled" . -}}
|
||||
{{- $valueKeyPostgresqlPassword := include "common.postgresql.values.key.postgressPassword" . -}}
|
||||
{{- $valueKeyPostgresqlReplicationEnabled := include "common.postgresql.values.key.replicationPassword" . -}}
|
||||
{{- if and (or (not $existingSecret) (eq $existingSecret "\"\"")) (eq $enabled "true") -}}
|
||||
{{- $requiredPasswords := list -}}
|
||||
{{- $requiredPostgresqlPassword := dict "valueKey" $valueKeyPostgresqlPassword "secret" .secret "field" "postgresql-password" -}}
|
||||
{{- $requiredPasswords = append $requiredPasswords $requiredPostgresqlPassword -}}
|
||||
|
||||
{{- $enabledReplication := include "common.postgresql.values.enabled.replication" . -}}
|
||||
{{- if (eq $enabledReplication "true") -}}
|
||||
{{- $requiredPostgresqlReplicationPassword := dict "valueKey" $valueKeyPostgresqlReplicationEnabled "secret" .secret "field" "postgresql-replication-password" -}}
|
||||
{{- $requiredPasswords = append $requiredPasswords $requiredPostgresqlReplicationPassword -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- include "common.validations.values.multiple.empty" (dict "required" $requiredPasswords "context" .context) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Auxiliary function to decide whether evaluate global values.
|
||||
|
||||
Usage:
|
||||
{{ include "common.postgresql.values.use.global" (dict "key" "key-of-global" "context" $) }}
|
||||
Params:
|
||||
- key - String - Required. Field to be evaluated within global, e.g: "existingSecret"
|
||||
*/}}
|
||||
{{- define "common.postgresql.values.use.global" -}}
|
||||
{{- if .context.Values.global -}}
|
||||
{{- if .context.Values.global.postgresql -}}
|
||||
{{- index .context.Values.global.postgresql .key | quote -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Auxiliary function to get the right value for existingSecret.
|
||||
|
||||
Usage:
|
||||
{{ include "common.postgresql.values.existingSecret" (dict "context" $) }}
|
||||
*/}}
|
||||
{{- define "common.postgresql.values.existingSecret" -}}
|
||||
{{- $globalValue := include "common.postgresql.values.use.global" (dict "key" "existingSecret" "context" .context) -}}
|
||||
|
||||
{{- if .subchart -}}
|
||||
{{- default (.context.Values.postgresql.existingSecret | quote) $globalValue -}}
|
||||
{{- else -}}
|
||||
{{- default (.context.Values.existingSecret | quote) $globalValue -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Auxiliary function to get the right value for enabled postgresql.
|
||||
|
||||
Usage:
|
||||
{{ include "common.postgresql.values.enabled" (dict "context" $) }}
|
||||
*/}}
|
||||
{{- define "common.postgresql.values.enabled" -}}
|
||||
{{- if .subchart -}}
|
||||
{{- printf "%v" .context.Values.postgresql.enabled -}}
|
||||
{{- else -}}
|
||||
{{- printf "%v" (not .context.Values.enabled) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Auxiliary function to get the right value for the key postgressPassword.
|
||||
|
||||
Usage:
|
||||
{{ include "common.postgresql.values.key.postgressPassword" (dict "subchart" "true" "context" $) }}
|
||||
Params:
|
||||
- subchart - Boolean - Optional. Whether postgresql is used as subchart or not. Default: false
|
||||
*/}}
|
||||
{{- define "common.postgresql.values.key.postgressPassword" -}}
|
||||
{{- $globalValue := include "common.postgresql.values.use.global" (dict "key" "postgresqlUsername" "context" .context) -}}
|
||||
|
||||
{{- if not $globalValue -}}
|
||||
{{- if .subchart -}}
|
||||
postgresql.postgresqlPassword
|
||||
{{- else -}}
|
||||
postgresqlPassword
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
global.postgresql.postgresqlPassword
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Auxiliary function to get the right value for enabled.replication.
|
||||
|
||||
Usage:
|
||||
{{ include "common.postgresql.values.enabled.replication" (dict "subchart" "true" "context" $) }}
|
||||
Params:
|
||||
- subchart - Boolean - Optional. Whether postgresql is used as subchart or not. Default: false
|
||||
*/}}
|
||||
{{- define "common.postgresql.values.enabled.replication" -}}
|
||||
{{- if .subchart -}}
|
||||
{{- printf "%v" .context.Values.postgresql.replication.enabled -}}
|
||||
{{- else -}}
|
||||
{{- printf "%v" .context.Values.replication.enabled -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Auxiliary function to get the right value for the key replication.password.
|
||||
|
||||
Usage:
|
||||
{{ include "common.postgresql.values.key.replicationPassword" (dict "subchart" "true" "context" $) }}
|
||||
Params:
|
||||
- subchart - Boolean - Optional. Whether postgresql is used as subchart or not. Default: false
|
||||
*/}}
|
||||
{{- define "common.postgresql.values.key.replicationPassword" -}}
|
||||
{{- if .subchart -}}
|
||||
postgresql.replication.password
|
||||
{{- else -}}
|
||||
replication.password
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Validate Redis® required passwords are not empty.
|
||||
|
||||
Usage:
|
||||
{{ include "common.validations.values.redis.passwords" (dict "secret" "secretName" "subchart" false "context" $) }}
|
||||
Params:
|
||||
- secret - String - Required. Name of the secret where redis values are stored, e.g: "redis-passwords-secret"
|
||||
- subchart - Boolean - Optional. Whether redis is used as subchart or not. Default: false
|
||||
*/}}
|
||||
{{- define "common.validations.values.redis.passwords" -}}
|
||||
{{- $enabled := include "common.redis.values.enabled" . -}}
|
||||
{{- $valueKeyPrefix := include "common.redis.values.keys.prefix" . -}}
|
||||
{{- $standarizedVersion := include "common.redis.values.standarized.version" . }}
|
||||
|
||||
{{- $existingSecret := ternary (printf "%s%s" $valueKeyPrefix "auth.existingSecret") (printf "%s%s" $valueKeyPrefix "existingSecret") (eq $standarizedVersion "true") }}
|
||||
{{- $existingSecretValue := include "common.utils.getValueFromKey" (dict "key" $existingSecret "context" .context) }}
|
||||
|
||||
{{- $valueKeyRedisPassword := ternary (printf "%s%s" $valueKeyPrefix "auth.password") (printf "%s%s" $valueKeyPrefix "password") (eq $standarizedVersion "true") }}
|
||||
{{- $valueKeyRedisUseAuth := ternary (printf "%s%s" $valueKeyPrefix "auth.enabled") (printf "%s%s" $valueKeyPrefix "usePassword") (eq $standarizedVersion "true") }}
|
||||
|
||||
{{- if and (or (not $existingSecret) (eq $existingSecret "\"\"")) (eq $enabled "true") -}}
|
||||
{{- $requiredPasswords := list -}}
|
||||
|
||||
{{- $useAuth := include "common.utils.getValueFromKey" (dict "key" $valueKeyRedisUseAuth "context" .context) -}}
|
||||
{{- if eq $useAuth "true" -}}
|
||||
{{- $requiredRedisPassword := dict "valueKey" $valueKeyRedisPassword "secret" .secret "field" "redis-password" -}}
|
||||
{{- $requiredPasswords = append $requiredPasswords $requiredRedisPassword -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- include "common.validations.values.multiple.empty" (dict "required" $requiredPasswords "context" .context) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Auxiliary function to get the right value for enabled redis.
|
||||
|
||||
Usage:
|
||||
{{ include "common.redis.values.enabled" (dict "context" $) }}
|
||||
*/}}
|
||||
{{- define "common.redis.values.enabled" -}}
|
||||
{{- if .subchart -}}
|
||||
{{- printf "%v" .context.Values.redis.enabled -}}
|
||||
{{- else -}}
|
||||
{{- printf "%v" (not .context.Values.enabled) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Auxiliary function to get the right prefix path for the values
|
||||
|
||||
Usage:
|
||||
{{ include "common.redis.values.key.prefix" (dict "subchart" "true" "context" $) }}
|
||||
Params:
|
||||
- subchart - Boolean - Optional. Whether redis is used as subchart or not. Default: false
|
||||
*/}}
|
||||
{{- define "common.redis.values.keys.prefix" -}}
|
||||
{{- if .subchart -}}redis.{{- else -}}{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Checks whether the redis chart's includes the standarizations (version >= 14)
|
||||
|
||||
Usage:
|
||||
{{ include "common.redis.values.standarized.version" (dict "context" $) }}
|
||||
*/}}
|
||||
{{- define "common.redis.values.standarized.version" -}}
|
||||
|
||||
{{- $standarizedAuth := printf "%s%s" (include "common.redis.values.keys.prefix" .) "auth" -}}
|
||||
{{- $standarizedAuthValues := include "common.utils.getValueFromKey" (dict "key" $standarizedAuth "context" .context) }}
|
||||
|
||||
{{- if $standarizedAuthValues -}}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Validate values must not be empty.
|
||||
|
||||
Usage:
|
||||
{{- $validateValueConf00 := (dict "valueKey" "path.to.value" "secret" "secretName" "field" "password-00") -}}
|
||||
{{- $validateValueConf01 := (dict "valueKey" "path.to.value" "secret" "secretName" "field" "password-01") -}}
|
||||
{{ include "common.validations.values.empty" (dict "required" (list $validateValueConf00 $validateValueConf01) "context" $) }}
|
||||
|
||||
Validate value params:
|
||||
- valueKey - String - Required. The path to the validating value in the values.yaml, e.g: "mysql.password"
|
||||
- secret - String - Optional. Name of the secret where the validating value is generated/stored, e.g: "mysql-passwords-secret"
|
||||
- field - String - Optional. Name of the field in the secret data, e.g: "mysql-password"
|
||||
*/}}
|
||||
{{- define "common.validations.values.multiple.empty" -}}
|
||||
{{- range .required -}}
|
||||
{{- include "common.validations.values.single.empty" (dict "valueKey" .valueKey "secret" .secret "field" .field "context" $.context) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Validate a value must not be empty.
|
||||
|
||||
Usage:
|
||||
{{ include "common.validations.value.empty" (dict "valueKey" "mariadb.password" "secret" "secretName" "field" "my-password" "subchart" "subchart" "context" $) }}
|
||||
|
||||
Validate value params:
|
||||
- valueKey - String - Required. The path to the validating value in the values.yaml, e.g: "mysql.password"
|
||||
- secret - String - Optional. Name of the secret where the validating value is generated/stored, e.g: "mysql-passwords-secret"
|
||||
- field - String - Optional. Name of the field in the secret data, e.g: "mysql-password"
|
||||
- subchart - String - Optional - Name of the subchart that the validated password is part of.
|
||||
*/}}
|
||||
{{- define "common.validations.values.single.empty" -}}
|
||||
{{- $value := include "common.utils.getValueFromKey" (dict "key" .valueKey "context" .context) }}
|
||||
{{- $subchart := ternary "" (printf "%s." .subchart) (empty .subchart) }}
|
||||
|
||||
{{- if not $value -}}
|
||||
{{- $varname := "my-value" -}}
|
||||
{{- $getCurrentValue := "" -}}
|
||||
{{- if and .secret .field -}}
|
||||
{{- $varname = include "common.utils.fieldToEnvVar" . -}}
|
||||
{{- $getCurrentValue = printf " To get the current value:\n\n %s\n" (include "common.utils.secret.getvalue" .) -}}
|
||||
{{- end -}}
|
||||
{{- printf "\n '%s' must not be empty, please add '--set %s%s=$%s' to the command.%s" .valueKey $subchart .valueKey $varname $getCurrentValue -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
5
pomerium/charts/redis/charts/common/values.yaml
Normal file
5
pomerium/charts/redis/charts/common/values.yaml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
## bitnami/common
|
||||
## It is required by CI/CD tools and processes.
|
||||
## @skip exampleValue
|
||||
##
|
||||
exampleValue: common-chart
|
||||
BIN
pomerium/charts/redis/img/redis-cluster-topology.png
Normal file
BIN
pomerium/charts/redis/img/redis-cluster-topology.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
BIN
pomerium/charts/redis/img/redis-topology.png
Normal file
BIN
pomerium/charts/redis/img/redis-topology.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.5 KiB |
191
pomerium/charts/redis/templates/NOTES.txt
Normal file
191
pomerium/charts/redis/templates/NOTES.txt
Normal file
|
|
@ -0,0 +1,191 @@
|
|||
CHART NAME: {{ .Chart.Name }}
|
||||
CHART VERSION: {{ .Chart.Version }}
|
||||
APP VERSION: {{ .Chart.AppVersion }}
|
||||
|
||||
** Please be patient while the chart is being deployed **
|
||||
|
||||
{{- if .Values.diagnosticMode.enabled }}
|
||||
The chart has been deployed in diagnostic mode. All probes have been disabled and the command has been overwritten with:
|
||||
|
||||
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 4 }}
|
||||
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 4 }}
|
||||
|
||||
Get the list of pods by executing:
|
||||
|
||||
kubectl get pods --namespace {{ .Release.Namespace }} -l app.kubernetes.io/instance={{ .Release.Name }}
|
||||
|
||||
Access the pod you want to debug by executing
|
||||
|
||||
kubectl exec --namespace {{ .Release.Namespace }} -ti <NAME OF THE POD> -- bash
|
||||
|
||||
In order to replicate the container startup scripts execute this command:
|
||||
|
||||
For Redis:
|
||||
|
||||
/opt/bitnami/scripts/redis/entrypoint.sh /opt/bitnami/scripts/redis/run.sh
|
||||
|
||||
{{- if .Values.sentinel.enabled }}
|
||||
|
||||
For Redis Sentinel:
|
||||
|
||||
/opt/bitnami/scripts/redis-sentinel/entrypoint.sh /opt/bitnami/scripts/redis-sentinel/run.sh
|
||||
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
|
||||
{{- if contains .Values.master.service.type "LoadBalancer" }}
|
||||
{{- if not .Values.auth.enabled }}
|
||||
{{ if and (not .Values.networkPolicy.enabled) (.Values.networkPolicy.allowExternal) }}
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
WARNING
|
||||
|
||||
By specifying "master.service.type=LoadBalancer" and "auth.enabled=false" you have
|
||||
most likely exposed the Redis® service externally without any authentication
|
||||
mechanism.
|
||||
|
||||
For security reasons, we strongly suggest that you switch to "ClusterIP" or
|
||||
"NodePort". As alternative, you can also switch to "auth.enabled=true"
|
||||
providing a valid password on "password" parameter.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- if eq .Values.architecture "replication" }}
|
||||
{{- if .Values.sentinel.enabled }}
|
||||
|
||||
Redis® can be accessed via port {{ .Values.sentinel.service.ports.redis }} on the following DNS name from within your cluster:
|
||||
|
||||
{{ template "common.names.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }} for read only operations
|
||||
|
||||
For read/write operations, first access the Redis® Sentinel cluster, which is available in port {{ .Values.sentinel.service.ports.sentinel }} using the same domain name above.
|
||||
|
||||
{{- else }}
|
||||
|
||||
Redis® can be accessed on the following DNS names from within your cluster:
|
||||
|
||||
{{ printf "%s-master.%s.svc.%s" (include "common.names.fullname" .) .Release.Namespace .Values.clusterDomain }} for read/write operations (port {{ .Values.master.service.ports.redis }})
|
||||
{{ printf "%s-replicas.%s.svc.%s" (include "common.names.fullname" .) .Release.Namespace .Values.clusterDomain }} for read-only operations (port {{ .Values.replica.service.ports.redis }})
|
||||
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
|
||||
Redis® can be accessed via port {{ .Values.master.service.ports.redis }} on the following DNS name from within your cluster:
|
||||
|
||||
{{ template "common.names.fullname" . }}-master.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}
|
||||
|
||||
{{- end }}
|
||||
|
||||
{{ if .Values.auth.enabled }}
|
||||
|
||||
To get your password run:
|
||||
|
||||
export REDIS_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "redis.secretName" . }} -o jsonpath="{.data.redis-password}" | base64 -d)
|
||||
|
||||
{{- end }}
|
||||
|
||||
To connect to your Redis® server:
|
||||
|
||||
1. Run a Redis® pod that you can use as a client:
|
||||
|
||||
kubectl run --namespace {{ .Release.Namespace }} redis-client --restart='Never' {{ if .Values.auth.enabled }} --env REDIS_PASSWORD=$REDIS_PASSWORD {{ end }} --image {{ template "redis.image" . }} --command -- sleep infinity
|
||||
|
||||
{{- if .Values.tls.enabled }}
|
||||
|
||||
Copy your TLS certificates to the pod:
|
||||
|
||||
kubectl cp --namespace {{ .Release.Namespace }} /path/to/client.cert redis-client:/tmp/client.cert
|
||||
kubectl cp --namespace {{ .Release.Namespace }} /path/to/client.key redis-client:/tmp/client.key
|
||||
kubectl cp --namespace {{ .Release.Namespace }} /path/to/CA.cert redis-client:/tmp/CA.cert
|
||||
|
||||
{{- end }}
|
||||
|
||||
Use the following command to attach to the pod:
|
||||
|
||||
kubectl exec --tty -i redis-client \
|
||||
{{- if and (.Values.networkPolicy.enabled) (not .Values.networkPolicy.allowExternal) }}--labels="{{ template "common.names.fullname" . }}-client=true" \{{- end }}
|
||||
--namespace {{ .Release.Namespace }} -- bash
|
||||
|
||||
2. Connect using the Redis® CLI:
|
||||
|
||||
{{- if eq .Values.architecture "replication" }}
|
||||
{{- if .Values.sentinel.enabled }}
|
||||
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h {{ template "common.names.fullname" . }} -p {{ .Values.sentinel.service.ports.redis }}{{ if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }} # Read only operations
|
||||
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h {{ template "common.names.fullname" . }} -p {{ .Values.sentinel.service.ports.sentinel }}{{ if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }} # Sentinel access
|
||||
{{- else }}
|
||||
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h {{ printf "%s-master" (include "common.names.fullname" .) }}{{ if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }}
|
||||
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h {{ printf "%s-replicas" (include "common.names.fullname" .) }}{{ if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h {{ template "common.names.fullname" . }}-master{{ if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }}
|
||||
{{- end }}
|
||||
|
||||
{{- if and (.Values.networkPolicy.enabled) (not .Values.networkPolicy.allowExternal) }}
|
||||
|
||||
Note: Since NetworkPolicy is enabled, only pods with label {{ template "common.names.fullname" . }}-client=true" will be able to connect to redis.
|
||||
|
||||
{{- else }}
|
||||
|
||||
To connect to your database from outside the cluster execute the following commands:
|
||||
|
||||
{{- if and (eq .Values.architecture "replication") .Values.sentinel.enabled }}
|
||||
{{- if contains "NodePort" .Values.sentinel.service.type }}
|
||||
|
||||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "common.names.fullname" . }})
|
||||
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h $NODE_IP -p $NODE_PORT {{- if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }}
|
||||
|
||||
{{- else if contains "LoadBalancer" .Values.sentinel.service.type }}
|
||||
|
||||
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||
Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "common.names.fullname" . }}'
|
||||
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "common.names.fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}")
|
||||
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h $SERVICE_IP -p {{ .Values.sentinel.service.ports.redis }} {{- if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }}
|
||||
|
||||
{{- else if contains "ClusterIP" .Values.sentinel.service.type }}
|
||||
|
||||
kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "common.names.fullname" . }} {{ .Values.sentinel.service.ports.redis }}:{{ .Values.sentinel.service.ports.redis }} &
|
||||
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h 127.0.0.1 -p {{ .Values.sentinel.service.ports.redis }} {{- if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }}
|
||||
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- if contains "NodePort" .Values.master.service.type }}
|
||||
|
||||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ printf "%s-master" (include "common.names.fullname" .) }})
|
||||
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h $NODE_IP -p $NODE_PORT {{- if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }}
|
||||
|
||||
{{- else if contains "LoadBalancer" .Values.master.service.type }}
|
||||
|
||||
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||
Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "common.names.fullname" . }}'
|
||||
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ printf "%s-master" (include "common.names.fullname" .) }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}")
|
||||
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h $SERVICE_IP -p {{ .Values.master.service.ports.redis }} {{- if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }}
|
||||
|
||||
{{- else if contains "ClusterIP" .Values.master.service.type }}
|
||||
|
||||
kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ printf "%s-master" (include "common.names.fullname" .) }} {{ .Values.master.service.ports.redis }}:{{ .Values.master.service.ports.redis }} &
|
||||
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h 127.0.0.1 -p {{ .Values.master.service.ports.redis }} {{- if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }}
|
||||
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- include "redis.checkRollingTags" . }}
|
||||
{{- include "common.warnings.rollingTag" .Values.volumePermissions.image }}
|
||||
{{- include "common.warnings.rollingTag" .Values.sysctl.image }}
|
||||
{{- include "redis.validateValues" . }}
|
||||
|
||||
{{- if and (eq .Values.architecture "replication") .Values.sentinel.enabled (eq .Values.sentinel.service.type "NodePort") (not .Release.IsUpgrade ) }}
|
||||
{{- if $.Values.sentinel.service.nodePorts.sentinel }}
|
||||
No need to upgrade, ports and nodeports have been set from values
|
||||
{{- else }}
|
||||
#!#!#!#!#!#!#!# IMPORTANT #!#!#!#!#!#!#!#
|
||||
YOU NEED TO PERFORM AN UPGRADE FOR THE SERVICES AND WORKLOAD TO BE CREATED
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
291
pomerium/charts/redis/templates/_helpers.tpl
Normal file
291
pomerium/charts/redis/templates/_helpers.tpl
Normal file
|
|
@ -0,0 +1,291 @@
|
|||
{{/* vim: set filetype=mustache: */}}
|
||||
|
||||
{{/*
|
||||
Return the proper Redis image name
|
||||
*/}}
|
||||
{{- define "redis.image" -}}
|
||||
{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Redis Sentinel image name
|
||||
*/}}
|
||||
{{- define "redis.sentinel.image" -}}
|
||||
{{ include "common.images.image" (dict "imageRoot" .Values.sentinel.image "global" .Values.global) }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper image name (for the metrics image)
|
||||
*/}}
|
||||
{{- define "redis.metrics.image" -}}
|
||||
{{ include "common.images.image" (dict "imageRoot" .Values.metrics.image "global" .Values.global) }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper image name (for the init container volume-permissions image)
|
||||
*/}}
|
||||
{{- define "redis.volumePermissions.image" -}}
|
||||
{{ include "common.images.image" (dict "imageRoot" .Values.volumePermissions.image "global" .Values.global) }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return sysctl image
|
||||
*/}}
|
||||
{{- define "redis.sysctl.image" -}}
|
||||
{{ include "common.images.image" (dict "imageRoot" .Values.sysctl.image "global" .Values.global) }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Docker Image Registry Secret Names
|
||||
*/}}
|
||||
{{- define "redis.imagePullSecrets" -}}
|
||||
{{- include "common.images.pullSecrets" (dict "images" (list .Values.image .Values.sentinel.image .Values.metrics.image .Values.volumePermissions.image .Values.sysctl.image) "global" .Values.global) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the appropriate apiVersion for networkpolicy.
|
||||
*/}}
|
||||
{{- define "networkPolicy.apiVersion" -}}
|
||||
{{- if semverCompare ">=1.4-0, <1.7-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
{{- print "extensions/v1beta1" -}}
|
||||
{{- else -}}
|
||||
{{- print "networking.k8s.io/v1" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the appropriate apiGroup for PodSecurityPolicy.
|
||||
*/}}
|
||||
{{- define "podSecurityPolicy.apiGroup" -}}
|
||||
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
{{- print "policy" -}}
|
||||
{{- else -}}
|
||||
{{- print "extensions" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return true if a TLS secret object should be created
|
||||
*/}}
|
||||
{{- define "redis.createTlsSecret" -}}
|
||||
{{- if and .Values.tls.enabled .Values.tls.autoGenerated (and (not .Values.tls.existingSecret) (not .Values.tls.certificatesSecret)) }}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the secret containing Redis TLS certificates
|
||||
*/}}
|
||||
{{- define "redis.tlsSecretName" -}}
|
||||
{{- $secretName := coalesce .Values.tls.existingSecret .Values.tls.certificatesSecret -}}
|
||||
{{- if $secretName -}}
|
||||
{{- printf "%s" (tpl $secretName $) -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-crt" (include "common.names.fullname" .) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the path to the cert file.
|
||||
*/}}
|
||||
{{- define "redis.tlsCert" -}}
|
||||
{{- if (include "redis.createTlsSecret" . ) -}}
|
||||
{{- printf "/opt/bitnami/redis/certs/%s" "tls.crt" -}}
|
||||
{{- else -}}
|
||||
{{- required "Certificate filename is required when TLS in enabled" .Values.tls.certFilename | printf "/opt/bitnami/redis/certs/%s" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the path to the cert key file.
|
||||
*/}}
|
||||
{{- define "redis.tlsCertKey" -}}
|
||||
{{- if (include "redis.createTlsSecret" . ) -}}
|
||||
{{- printf "/opt/bitnami/redis/certs/%s" "tls.key" -}}
|
||||
{{- else -}}
|
||||
{{- required "Certificate Key filename is required when TLS in enabled" .Values.tls.certKeyFilename | printf "/opt/bitnami/redis/certs/%s" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the path to the CA cert file.
|
||||
*/}}
|
||||
{{- define "redis.tlsCACert" -}}
|
||||
{{- if (include "redis.createTlsSecret" . ) -}}
|
||||
{{- printf "/opt/bitnami/redis/certs/%s" "ca.crt" -}}
|
||||
{{- else -}}
|
||||
{{- required "Certificate CA filename is required when TLS in enabled" .Values.tls.certCAFilename | printf "/opt/bitnami/redis/certs/%s" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the path to the DH params file.
|
||||
*/}}
|
||||
{{- define "redis.tlsDHParams" -}}
|
||||
{{- if .Values.tls.dhParamsFilename -}}
|
||||
{{- printf "/opt/bitnami/redis/certs/%s" .Values.tls.dhParamsFilename -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "redis.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
{{ default (include "common.names.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else -}}
|
||||
{{ default "default" .Values.serviceAccount.name }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the configuration configmap name
|
||||
*/}}
|
||||
{{- define "redis.configmapName" -}}
|
||||
{{- if .Values.existingConfigmap -}}
|
||||
{{- printf "%s" (tpl .Values.existingConfigmap $) -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-configuration" (include "common.names.fullname" .) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return true if a configmap object should be created
|
||||
*/}}
|
||||
{{- define "redis.createConfigmap" -}}
|
||||
{{- if empty .Values.existingConfigmap }}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Get the password secret.
|
||||
*/}}
|
||||
{{- define "redis.secretName" -}}
|
||||
{{- if .Values.auth.existingSecret -}}
|
||||
{{- printf "%s" .Values.auth.existingSecret -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s" (include "common.names.fullname" .) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Get the password key to be retrieved from Redis® secret.
|
||||
*/}}
|
||||
{{- define "redis.secretPasswordKey" -}}
|
||||
{{- if and .Values.auth.existingSecret .Values.auth.existingSecretPasswordKey -}}
|
||||
{{- printf "%s" .Values.auth.existingSecretPasswordKey -}}
|
||||
{{- else -}}
|
||||
{{- printf "redis-password" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
{{/*
|
||||
Returns the available value for certain key in an existing secret (if it exists),
|
||||
otherwise it generates a random value.
|
||||
*/}}
|
||||
{{- define "getValueFromSecret" }}
|
||||
{{- $len := (default 16 .Length) | int -}}
|
||||
{{- $obj := (lookup "v1" "Secret" .Namespace .Name).data -}}
|
||||
{{- if $obj }}
|
||||
{{- index $obj .Key | b64dec -}}
|
||||
{{- else -}}
|
||||
{{- randAlphaNum $len -}}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Return Redis® password
|
||||
*/}}
|
||||
{{- define "redis.password" -}}
|
||||
{{- if not (empty .Values.global.redis.password) }}
|
||||
{{- .Values.global.redis.password -}}
|
||||
{{- else if not (empty .Values.auth.password) -}}
|
||||
{{- .Values.auth.password -}}
|
||||
{{- else -}}
|
||||
{{- include "getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" (include "common.names.fullname" .) "Length" 10 "Key" "redis-password") -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Check if there are rolling tags in the images */}}
|
||||
{{- define "redis.checkRollingTags" -}}
|
||||
{{- include "common.warnings.rollingTag" .Values.image }}
|
||||
{{- include "common.warnings.rollingTag" .Values.sentinel.image }}
|
||||
{{- include "common.warnings.rollingTag" .Values.metrics.image }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Compile all warnings into a single message, and call fail.
|
||||
*/}}
|
||||
{{- define "redis.validateValues" -}}
|
||||
{{- $messages := list -}}
|
||||
{{- $messages := append $messages (include "redis.validateValues.topologySpreadConstraints" .) -}}
|
||||
{{- $messages := append $messages (include "redis.validateValues.architecture" .) -}}
|
||||
{{- $messages := append $messages (include "redis.validateValues.podSecurityPolicy.create" .) -}}
|
||||
{{- $messages := append $messages (include "redis.validateValues.tls" .) -}}
|
||||
{{- $messages := without $messages "" -}}
|
||||
{{- $message := join "\n" $messages -}}
|
||||
|
||||
{{- if $message -}}
|
||||
{{- printf "\nVALUES VALIDATION:\n%s" $message | fail -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Validate values of Redis® - spreadConstrainsts K8s version */}}
|
||||
{{- define "redis.validateValues.topologySpreadConstraints" -}}
|
||||
{{- if and (semverCompare "<1.16-0" .Capabilities.KubeVersion.GitVersion) .Values.replica.topologySpreadConstraints -}}
|
||||
redis: topologySpreadConstraints
|
||||
Pod Topology Spread Constraints are only available on K8s >= 1.16
|
||||
Find more information at https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Validate values of Redis® - must provide a valid architecture */}}
|
||||
{{- define "redis.validateValues.architecture" -}}
|
||||
{{- if and (ne .Values.architecture "standalone") (ne .Values.architecture "replication") -}}
|
||||
redis: architecture
|
||||
Invalid architecture selected. Valid values are "standalone" and
|
||||
"replication". Please set a valid architecture (--set architecture="xxxx")
|
||||
{{- end -}}
|
||||
{{- if and .Values.sentinel.enabled (not (eq .Values.architecture "replication")) }}
|
||||
redis: architecture
|
||||
Using redis sentinel on standalone mode is not supported.
|
||||
To deploy redis sentinel, please select the "replication" mode
|
||||
(--set "architecture=replication,sentinel.enabled=true")
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Validate values of Redis® - PodSecurityPolicy create */}}
|
||||
{{- define "redis.validateValues.podSecurityPolicy.create" -}}
|
||||
{{- if and .Values.podSecurityPolicy.create (not .Values.podSecurityPolicy.enabled) }}
|
||||
redis: podSecurityPolicy.create
|
||||
In order to create PodSecurityPolicy, you also need to enable
|
||||
podSecurityPolicy.enabled field
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Validate values of Redis® - TLS enabled */}}
|
||||
{{- define "redis.validateValues.tls" -}}
|
||||
{{- if and .Values.tls.enabled (not .Values.tls.autoGenerated) (not .Values.tls.existingSecret) (not .Values.tls.certificatesSecret) }}
|
||||
redis: tls.enabled
|
||||
In order to enable TLS, you also need to provide
|
||||
an existing secret containing the TLS certificates or
|
||||
enable auto-generated certificates.
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Define the suffix utilized for external-dns */}}
|
||||
{{- define "redis.externalDNS.suffix" -}}
|
||||
{{ printf "%s.%s" (include "common.names.fullname" .) .Values.useExternalDNS.suffix }}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Compile all annotations utilized for external-dns */}}
|
||||
{{- define "redis.externalDNS.annotations" -}}
|
||||
{{- if .Values.useExternalDNS.enabled }}
|
||||
{{ .Values.useExternalDNS.annotationKey }}hostname: {{ include "redis.externalDNS.suffix" . }}
|
||||
{{- range $key, $val := .Values.useExternalDNS.additionalAnnotations }}
|
||||
{{ $.Values.useExternalDNS.annotationKey }}{{ $key }}: {{ $val | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
59
pomerium/charts/redis/templates/configmap.yaml
Normal file
59
pomerium/charts/redis/templates/configmap.yaml
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
{{- if (include "redis.createConfigmap" .) }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ printf "%s-configuration" (include "common.names.fullname" .) }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
data:
|
||||
redis.conf: |-
|
||||
# User-supplied common configuration:
|
||||
{{- if .Values.commonConfiguration }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonConfiguration "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
# End of common configuration
|
||||
master.conf: |-
|
||||
dir {{ .Values.master.persistence.path }}
|
||||
# User-supplied master configuration:
|
||||
{{- if .Values.master.configuration }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.master.configuration "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.master.disableCommands }}
|
||||
{{- range .Values.master.disableCommands }}
|
||||
rename-command {{ . }} ""
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
# End of master configuration
|
||||
replica.conf: |-
|
||||
dir {{ .Values.replica.persistence.path }}
|
||||
# User-supplied replica configuration:
|
||||
{{- if .Values.replica.configuration }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.replica.configuration "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.disableCommands }}
|
||||
{{- range .Values.replica.disableCommands }}
|
||||
rename-command {{ . }} ""
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
# End of replica configuration
|
||||
{{- if .Values.sentinel.enabled }}
|
||||
sentinel.conf: |-
|
||||
dir "/tmp"
|
||||
port {{ .Values.sentinel.containerPorts.sentinel }}
|
||||
sentinel monitor {{ .Values.sentinel.masterSet }} {{ template "common.names.fullname" . }}-node-0.{{ template "common.names.fullname" . }}-headless.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }} {{ .Values.sentinel.service.ports.redis }} {{ .Values.sentinel.quorum }}
|
||||
sentinel down-after-milliseconds {{ .Values.sentinel.masterSet }} {{ .Values.sentinel.downAfterMilliseconds }}
|
||||
sentinel failover-timeout {{ .Values.sentinel.masterSet }} {{ .Values.sentinel.failoverTimeout }}
|
||||
sentinel parallel-syncs {{ .Values.sentinel.masterSet }} {{ .Values.sentinel.parallelSyncs }}
|
||||
# User-supplied sentinel configuration:
|
||||
{{- if .Values.sentinel.configuration }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.sentinel.configuration "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
# End of sentinel configuration
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
4
pomerium/charts/redis/templates/extra-list.yaml
Normal file
4
pomerium/charts/redis/templates/extra-list.yaml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{{- range .Values.extraDeploy }}
|
||||
---
|
||||
{{ include "common.tplvalues.render" (dict "value" . "context" $) }}
|
||||
{{- end }}
|
||||
30
pomerium/charts/redis/templates/headless-svc.yaml
Normal file
30
pomerium/charts/redis/templates/headless-svc.yaml
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ printf "%s-headless" (include "common.names.fullname" .) }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
annotations:
|
||||
{{- if .Values.commonAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- include "redis.externalDNS.annotations" . | nindent 4 }}
|
||||
spec:
|
||||
type: ClusterIP
|
||||
clusterIP: None
|
||||
{{- if .Values.sentinel.enabled }}
|
||||
publishNotReadyAddresses: true
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: tcp-redis
|
||||
port: {{ if .Values.sentinel.enabled }}{{ .Values.sentinel.service.ports.redis }}{{ else }}{{ .Values.master.service.ports.redis }}{{ end }}
|
||||
targetPort: redis
|
||||
{{- if .Values.sentinel.enabled }}
|
||||
- name: tcp-sentinel
|
||||
port: {{ .Values.sentinel.service.ports.sentinel }}
|
||||
targetPort: redis-sentinel
|
||||
{{- end }}
|
||||
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
|
||||
192
pomerium/charts/redis/templates/health-configmap.yaml
Normal file
192
pomerium/charts/redis/templates/health-configmap.yaml
Normal file
|
|
@ -0,0 +1,192 @@
|
|||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ printf "%s-health" (include "common.names.fullname" .) }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
data:
|
||||
ping_readiness_local.sh: |-
|
||||
#!/bin/bash
|
||||
|
||||
[[ -f $REDIS_PASSWORD_FILE ]] && export REDIS_PASSWORD="$(< "${REDIS_PASSWORD_FILE}")"
|
||||
[[ -n "$REDIS_PASSWORD" ]] && export REDISCLI_AUTH="$REDIS_PASSWORD"
|
||||
response=$(
|
||||
timeout -s 3 $1 \
|
||||
redis-cli \
|
||||
-h localhost \
|
||||
{{- if .Values.tls.enabled }}
|
||||
-p $REDIS_TLS_PORT \
|
||||
--tls \
|
||||
--cacert {{ template "redis.tlsCACert" . }} \
|
||||
{{- if .Values.tls.authClients }}
|
||||
--cert {{ template "redis.tlsCert" . }} \
|
||||
--key {{ template "redis.tlsCertKey" . }} \
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
-p $REDIS_PORT \
|
||||
{{- end }}
|
||||
ping
|
||||
)
|
||||
if [ "$?" -eq "124" ]; then
|
||||
echo "Timed out"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$response" != "PONG" ]; then
|
||||
echo "$response"
|
||||
exit 1
|
||||
fi
|
||||
ping_liveness_local.sh: |-
|
||||
#!/bin/bash
|
||||
|
||||
[[ -f $REDIS_PASSWORD_FILE ]] && export REDIS_PASSWORD="$(< "${REDIS_PASSWORD_FILE}")"
|
||||
[[ -n "$REDIS_PASSWORD" ]] && export REDISCLI_AUTH="$REDIS_PASSWORD"
|
||||
response=$(
|
||||
timeout -s 3 $1 \
|
||||
redis-cli \
|
||||
-h localhost \
|
||||
{{- if .Values.tls.enabled }}
|
||||
-p $REDIS_TLS_PORT \
|
||||
--tls \
|
||||
--cacert {{ template "redis.tlsCACert" . }} \
|
||||
{{- if .Values.tls.authClients }}
|
||||
--cert {{ template "redis.tlsCert" . }} \
|
||||
--key {{ template "redis.tlsCertKey" . }} \
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
-p $REDIS_PORT \
|
||||
{{- end }}
|
||||
ping
|
||||
)
|
||||
if [ "$?" -eq "124" ]; then
|
||||
echo "Timed out"
|
||||
exit 1
|
||||
fi
|
||||
responseFirstWord=$(echo $response | head -n1 | awk '{print $1;}')
|
||||
if [ "$response" != "PONG" ] && [ "$responseFirstWord" != "LOADING" ] && [ "$responseFirstWord" != "MASTERDOWN" ]; then
|
||||
echo "$response"
|
||||
exit 1
|
||||
fi
|
||||
{{- if .Values.sentinel.enabled }}
|
||||
ping_sentinel.sh: |-
|
||||
#!/bin/bash
|
||||
|
||||
{{- if .Values.auth.sentinel }}
|
||||
[[ -f $REDIS_PASSWORD_FILE ]] && export REDIS_PASSWORD="$(< "${REDIS_PASSWORD_FILE}")"
|
||||
[[ -n "$REDIS_PASSWORD" ]] && export REDISCLI_AUTH="$REDIS_PASSWORD"
|
||||
{{- end }}
|
||||
response=$(
|
||||
timeout -s 3 $1 \
|
||||
redis-cli \
|
||||
-h localhost \
|
||||
{{- if .Values.tls.enabled }}
|
||||
-p $REDIS_SENTINEL_TLS_PORT_NUMBER \
|
||||
--tls \
|
||||
--cacert "$REDIS_SENTINEL_TLS_CA_FILE" \
|
||||
{{- if .Values.tls.authClients }}
|
||||
--cert "$REDIS_SENTINEL_TLS_CERT_FILE" \
|
||||
--key "$REDIS_SENTINEL_TLS_KEY_FILE" \
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
-p $REDIS_SENTINEL_PORT \
|
||||
{{- end }}
|
||||
ping
|
||||
)
|
||||
if [ "$?" -eq "124" ]; then
|
||||
echo "Timed out"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$response" != "PONG" ]; then
|
||||
echo "$response"
|
||||
exit 1
|
||||
fi
|
||||
parse_sentinels.awk: |-
|
||||
/ip/ {FOUND_IP=1}
|
||||
/port/ {FOUND_PORT=1}
|
||||
/runid/ {FOUND_RUNID=1}
|
||||
!/ip|port|runid/ {
|
||||
if (FOUND_IP==1) {
|
||||
IP=$1; FOUND_IP=0;
|
||||
}
|
||||
else if (FOUND_PORT==1) {
|
||||
PORT=$1;
|
||||
FOUND_PORT=0;
|
||||
} else if (FOUND_RUNID==1) {
|
||||
printf "\nsentinel known-sentinel {{ .Values.sentinel.masterSet }} %s %s %s", IP, PORT, $0; FOUND_RUNID=0;
|
||||
}
|
||||
}
|
||||
{{- end }}
|
||||
ping_readiness_master.sh: |-
|
||||
#!/bin/bash
|
||||
|
||||
[[ -f $REDIS_MASTER_PASSWORD_FILE ]] && export REDIS_MASTER_PASSWORD="$(< "${REDIS_MASTER_PASSWORD_FILE}")"
|
||||
[[ -n "$REDIS_MASTER_PASSWORD" ]] && export REDISCLI_AUTH="$REDIS_MASTER_PASSWORD"
|
||||
response=$(
|
||||
timeout -s 3 $1 \
|
||||
redis-cli \
|
||||
-h $REDIS_MASTER_HOST \
|
||||
-p $REDIS_MASTER_PORT_NUMBER \
|
||||
{{- if .Values.tls.enabled }}
|
||||
--tls \
|
||||
--cacert {{ template "redis.tlsCACert" . }} \
|
||||
{{- if .Values.tls.authClients }}
|
||||
--cert {{ template "redis.tlsCert" . }} \
|
||||
--key {{ template "redis.tlsCertKey" . }} \
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ping
|
||||
)
|
||||
if [ "$?" -eq "124" ]; then
|
||||
echo "Timed out"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$response" != "PONG" ]; then
|
||||
echo "$response"
|
||||
exit 1
|
||||
fi
|
||||
ping_liveness_master.sh: |-
|
||||
#!/bin/bash
|
||||
|
||||
[[ -f $REDIS_MASTER_PASSWORD_FILE ]] && export REDIS_MASTER_PASSWORD="$(< "${REDIS_MASTER_PASSWORD_FILE}")"
|
||||
[[ -n "$REDIS_MASTER_PASSWORD" ]] && export REDISCLI_AUTH="$REDIS_MASTER_PASSWORD"
|
||||
response=$(
|
||||
timeout -s 3 $1 \
|
||||
redis-cli \
|
||||
-h $REDIS_MASTER_HOST \
|
||||
-p $REDIS_MASTER_PORT_NUMBER \
|
||||
{{- if .Values.tls.enabled }}
|
||||
--tls \
|
||||
--cacert {{ template "redis.tlsCACert" . }} \
|
||||
{{- if .Values.tls.authClients }}
|
||||
--cert {{ template "redis.tlsCert" . }} \
|
||||
--key {{ template "redis.tlsCertKey" . }} \
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ping
|
||||
)
|
||||
if [ "$?" -eq "124" ]; then
|
||||
echo "Timed out"
|
||||
exit 1
|
||||
fi
|
||||
responseFirstWord=$(echo $response | head -n1 | awk '{print $1;}')
|
||||
if [ "$response" != "PONG" ] && [ "$responseFirstWord" != "LOADING" ]; then
|
||||
echo "$response"
|
||||
exit 1
|
||||
fi
|
||||
ping_readiness_local_and_master.sh: |-
|
||||
script_dir="$(dirname "$0")"
|
||||
exit_status=0
|
||||
"$script_dir/ping_readiness_local.sh" $1 || exit_status=$?
|
||||
"$script_dir/ping_readiness_master.sh" $1 || exit_status=$?
|
||||
exit $exit_status
|
||||
ping_liveness_local_and_master.sh: |-
|
||||
script_dir="$(dirname "$0")"
|
||||
exit_status=0
|
||||
"$script_dir/ping_liveness_local.sh" $1 || exit_status=$?
|
||||
"$script_dir/ping_liveness_master.sh" $1 || exit_status=$?
|
||||
exit $exit_status
|
||||
473
pomerium/charts/redis/templates/master/application.yaml
Normal file
473
pomerium/charts/redis/templates/master/application.yaml
Normal file
|
|
@ -0,0 +1,473 @@
|
|||
{{- if or (not (eq .Values.architecture "replication")) (not .Values.sentinel.enabled) }}
|
||||
apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
|
||||
kind: {{ .Values.master.kind }}
|
||||
metadata:
|
||||
name: {{ printf "%s-master" (include "common.names.fullname" .) }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/component: master
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
replicas: {{ .Values.master.count }}
|
||||
selector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: master
|
||||
{{- if (eq .Values.master.kind "StatefulSet") }}
|
||||
serviceName: {{ printf "%s-headless" (include "common.names.fullname" .) }}
|
||||
{{- end }}
|
||||
{{- if .Values.master.updateStrategy }}
|
||||
{{- if (eq .Values.master.kind "Deployment") }}
|
||||
strategy: {{- toYaml .Values.master.updateStrategy | nindent 4 }}
|
||||
{{- else }}
|
||||
updateStrategy: {{- toYaml .Values.master.updateStrategy | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
template:
|
||||
metadata:
|
||||
labels: {{- include "common.labels.standard" . | nindent 8 }}
|
||||
app.kubernetes.io/component: master
|
||||
{{- if .Values.master.podLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.master.podLabels "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if and .Values.metrics.enabled .Values.metrics.podLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.metrics.podLabels "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
annotations:
|
||||
{{- if (include "redis.createConfigmap" .) }}
|
||||
checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
||||
{{- end }}
|
||||
checksum/health: {{ include (print $.Template.BasePath "/health-configmap.yaml") . | sha256sum }}
|
||||
checksum/scripts: {{ include (print $.Template.BasePath "/scripts-configmap.yaml") . | sha256sum }}
|
||||
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
|
||||
{{- if .Values.master.podAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.master.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if and .Values.metrics.enabled .Values.metrics.podAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.metrics.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- include "redis.imagePullSecrets" . | nindent 6 }}
|
||||
{{- if .Values.master.hostAliases }}
|
||||
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.master.hostAliases "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.master.podSecurityContext.enabled }}
|
||||
securityContext: {{- omit .Values.master.podSecurityContext "enabled" | toYaml | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ template "redis.serviceAccountName" . }}
|
||||
{{- if .Values.master.priorityClassName }}
|
||||
priorityClassName: {{ .Values.master.priorityClassName | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.master.affinity }}
|
||||
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.master.affinity "context" $) | nindent 8 }}
|
||||
{{- else }}
|
||||
affinity:
|
||||
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.master.podAffinityPreset "component" "master" "context" $) | nindent 10 }}
|
||||
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.master.podAntiAffinityPreset "component" "master" "context" $) | nindent 10 }}
|
||||
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.master.nodeAffinityPreset.type "key" .Values.master.nodeAffinityPreset.key "values" .Values.master.nodeAffinityPreset.values) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if .Values.master.nodeSelector }}
|
||||
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.master.nodeSelector "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.master.tolerations }}
|
||||
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.master.tolerations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.master.topologySpreadConstraints }}
|
||||
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.master.topologySpreadConstraints "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.master.shareProcessNamespace }}
|
||||
shareProcessNamespace: {{ .Values.master.shareProcessNamespace }}
|
||||
{{- end }}
|
||||
{{- if .Values.master.schedulerName }}
|
||||
schedulerName: {{ .Values.master.schedulerName | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.master.dnsPolicy }}
|
||||
dnsPolicy: {{ .Values.master.dnsPolicy }}
|
||||
{{- end }}
|
||||
{{- if .Values.master.dnsConfig }}
|
||||
dnsConfig: {{- include "common.tplvalues.render" (dict "value" .Values.master.dnsConfig "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
terminationGracePeriodSeconds: {{ .Values.master.terminationGracePeriodSeconds }}
|
||||
containers:
|
||||
- name: redis
|
||||
image: {{ template "redis.image" . }}
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
||||
{{- if .Values.master.lifecycleHooks }}
|
||||
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.master.lifecycleHooks "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.master.containerSecurityContext.enabled }}
|
||||
securityContext: {{- omit .Values.master.containerSecurityContext "enabled" | toYaml | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.diagnosticMode.enabled }}
|
||||
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
|
||||
{{- else if .Values.master.command }}
|
||||
command: {{- include "common.tplvalues.render" (dict "value" .Values.master.command "context" $) | nindent 12 }}
|
||||
{{- else }}
|
||||
command:
|
||||
- /bin/bash
|
||||
{{- end }}
|
||||
{{- if .Values.diagnosticMode.enabled }}
|
||||
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
|
||||
{{- else if .Values.master.args }}
|
||||
args: {{- include "common.tplvalues.render" (dict "value" .Values.master.args "context" $) | nindent 12 }}
|
||||
{{- else }}
|
||||
args:
|
||||
- -c
|
||||
- /opt/bitnami/scripts/start-scripts/start-master.sh
|
||||
{{- end }}
|
||||
env:
|
||||
- name: BITNAMI_DEBUG
|
||||
value: {{ ternary "true" "false" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }}
|
||||
- name: REDIS_REPLICATION_MODE
|
||||
value: master
|
||||
- name: ALLOW_EMPTY_PASSWORD
|
||||
value: {{ ternary "no" "yes" .Values.auth.enabled | quote }}
|
||||
{{- if .Values.auth.enabled }}
|
||||
{{- if .Values.auth.usePasswordFiles }}
|
||||
- name: REDIS_PASSWORD_FILE
|
||||
value: "/opt/bitnami/redis/secrets/redis-password"
|
||||
{{- else }}
|
||||
- name: REDIS_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "redis.secretName" . }}
|
||||
key: {{ template "redis.secretPasswordKey" . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
- name: REDIS_TLS_ENABLED
|
||||
value: {{ ternary "yes" "no" .Values.tls.enabled | quote }}
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: REDIS_TLS_PORT
|
||||
value: {{ .Values.master.containerPorts.redis | quote }}
|
||||
- name: REDIS_TLS_AUTH_CLIENTS
|
||||
value: {{ ternary "yes" "no" .Values.tls.authClients | quote }}
|
||||
- name: REDIS_TLS_CERT_FILE
|
||||
value: {{ template "redis.tlsCert" . }}
|
||||
- name: REDIS_TLS_KEY_FILE
|
||||
value: {{ template "redis.tlsCertKey" . }}
|
||||
- name: REDIS_TLS_CA_FILE
|
||||
value: {{ template "redis.tlsCACert" . }}
|
||||
{{- if .Values.tls.dhParamsFilename }}
|
||||
- name: REDIS_TLS_DH_PARAMS_FILE
|
||||
value: {{ template "redis.tlsDHParams" . }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
- name: REDIS_PORT
|
||||
value: {{ .Values.master.containerPorts.redis | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.master.extraEnvVars }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.master.extraEnvVars "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.master.extraEnvVarsCM .Values.master.extraEnvVarsSecret }}
|
||||
envFrom:
|
||||
{{- if .Values.master.extraEnvVarsCM }}
|
||||
- configMapRef:
|
||||
name: {{ .Values.master.extraEnvVarsCM }}
|
||||
{{- end }}
|
||||
{{- if .Values.master.extraEnvVarsSecret }}
|
||||
- secretRef:
|
||||
name: {{ .Values.master.extraEnvVarsSecret }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: redis
|
||||
containerPort: {{ .Values.master.containerPorts.redis }}
|
||||
{{- if not .Values.diagnosticMode.enabled }}
|
||||
{{- if .Values.master.startupProbe.enabled }}
|
||||
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.master.startupProbe "enabled") "context" $) | nindent 12 }}
|
||||
tcpSocket:
|
||||
port: redis
|
||||
{{- else if .Values.master.customStartupProbe }}
|
||||
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.master.customStartupProbe "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.master.livenessProbe.enabled }}
|
||||
livenessProbe:
|
||||
initialDelaySeconds: {{ .Values.master.livenessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.master.livenessProbe.periodSeconds }}
|
||||
# One second longer than command timeout should prevent generation of zombie processes.
|
||||
timeoutSeconds: {{ add1 .Values.master.livenessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ .Values.master.livenessProbe.successThreshold }}
|
||||
failureThreshold: {{ .Values.master.livenessProbe.failureThreshold }}
|
||||
exec:
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- /health/ping_liveness_local.sh {{ .Values.master.livenessProbe.timeoutSeconds }}
|
||||
{{- else if .Values.master.customLivenessProbe }}
|
||||
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.master.customLivenessProbe "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.master.readinessProbe.enabled }}
|
||||
readinessProbe:
|
||||
initialDelaySeconds: {{ .Values.master.readinessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.master.readinessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ add1 .Values.master.readinessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ .Values.master.readinessProbe.successThreshold }}
|
||||
failureThreshold: {{ .Values.master.readinessProbe.failureThreshold }}
|
||||
exec:
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- /health/ping_readiness_local.sh {{ .Values.master.readinessProbe.timeoutSeconds }}
|
||||
{{- else if .Values.master.customReadinessProbe }}
|
||||
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.master.customReadinessProbe "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.master.resources }}
|
||||
resources: {{- toYaml .Values.master.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: start-scripts
|
||||
mountPath: /opt/bitnami/scripts/start-scripts
|
||||
- name: health
|
||||
mountPath: /health
|
||||
{{- if .Values.auth.usePasswordFiles }}
|
||||
- name: redis-password
|
||||
mountPath: /opt/bitnami/redis/secrets/
|
||||
{{- end }}
|
||||
- name: redis-data
|
||||
mountPath: {{ .Values.master.persistence.path }}
|
||||
subPath: {{ .Values.master.persistence.subPath }}
|
||||
- name: config
|
||||
mountPath: /opt/bitnami/redis/mounted-etc
|
||||
- name: redis-tmp-conf
|
||||
mountPath: /opt/bitnami/redis/etc/
|
||||
- name: tmp
|
||||
mountPath: /tmp
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: redis-certificates
|
||||
mountPath: /opt/bitnami/redis/certs
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
{{- if .Values.master.extraVolumeMounts }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.master.extraVolumeMounts "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.enabled }}
|
||||
- name: metrics
|
||||
image: {{ include "redis.metrics.image" . }}
|
||||
imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }}
|
||||
{{- if .Values.metrics.containerSecurityContext.enabled }}
|
||||
securityContext: {{- omit .Values.metrics.containerSecurityContext "enabled" | toYaml | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.diagnosticMode.enabled }}
|
||||
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
|
||||
{{- else }}
|
||||
command:
|
||||
- /bin/bash
|
||||
- -c
|
||||
- |
|
||||
if [[ -f '/secrets/redis-password' ]]; then
|
||||
export REDIS_PASSWORD=$(cat /secrets/redis-password)
|
||||
fi
|
||||
redis_exporter{{- range $key, $value := .Values.metrics.extraArgs }} --{{ $key }}={{ $value }}{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.diagnosticMode.enabled }}
|
||||
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
env:
|
||||
- name: REDIS_ALIAS
|
||||
value: {{ template "common.names.fullname" . }}
|
||||
{{- if .Values.auth.enabled }}
|
||||
- name: REDIS_USER
|
||||
value: default
|
||||
{{- if (not .Values.auth.usePasswordFiles) }}
|
||||
- name: REDIS_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "redis.secretName" . }}
|
||||
key: {{ template "redis.secretPasswordKey" . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: REDIS_ADDR
|
||||
value: rediss://{{ .Values.metrics.redisTargetHost }}:{{ .Values.master.containerPorts.redis }}
|
||||
{{- if .Values.tls.authClients }}
|
||||
- name: REDIS_EXPORTER_TLS_CLIENT_KEY_FILE
|
||||
value: {{ template "redis.tlsCertKey" . }}
|
||||
- name: REDIS_EXPORTER_TLS_CLIENT_CERT_FILE
|
||||
value: {{ template "redis.tlsCert" . }}
|
||||
{{- end }}
|
||||
- name: REDIS_EXPORTER_TLS_CA_CERT_FILE
|
||||
value: {{ template "redis.tlsCACert" . }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.extraEnvVars }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.metrics.extraEnvVars "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: metrics
|
||||
containerPort: 9121
|
||||
{{- if .Values.metrics.resources }}
|
||||
resources: {{- toYaml .Values.metrics.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
{{- if .Values.auth.usePasswordFiles }}
|
||||
- name: redis-password
|
||||
mountPath: /secrets/
|
||||
{{- end }}
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: redis-certificates
|
||||
mountPath: /opt/bitnami/redis/certs
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.extraVolumeMounts }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.metrics.extraVolumeMounts "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.master.sidecars }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.master.sidecars "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- $needsVolumePermissions := and .Values.volumePermissions.enabled .Values.master.persistence.enabled .Values.master.podSecurityContext.enabled .Values.master.containerSecurityContext.enabled }}
|
||||
{{- if or .Values.master.initContainers $needsVolumePermissions .Values.sysctl.enabled }}
|
||||
initContainers:
|
||||
{{- if .Values.master.initContainers }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.master.initContainers "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $needsVolumePermissions }}
|
||||
- name: volume-permissions
|
||||
image: {{ include "redis.volumePermissions.image" . }}
|
||||
imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }}
|
||||
command:
|
||||
- /bin/bash
|
||||
- -ec
|
||||
- |
|
||||
{{- if eq ( toString ( .Values.volumePermissions.containerSecurityContext.runAsUser )) "auto" }}
|
||||
chown -R `id -u`:`id -G | cut -d " " -f2` {{ .Values.master.persistence.path }}
|
||||
{{- else }}
|
||||
chown -R {{ .Values.master.containerSecurityContext.runAsUser }}:{{ .Values.master.podSecurityContext.fsGroup }} {{ .Values.master.persistence.path }}
|
||||
{{- end }}
|
||||
{{- if eq ( toString ( .Values.volumePermissions.containerSecurityContext.runAsUser )) "auto" }}
|
||||
securityContext: {{- omit .Values.volumePermissions.containerSecurityContext "runAsUser" | toYaml | nindent 12 }}
|
||||
{{- else }}
|
||||
securityContext: {{- .Values.volumePermissions.containerSecurityContext | toYaml | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.volumePermissions.resources }}
|
||||
resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: redis-data
|
||||
mountPath: {{ .Values.master.persistence.path }}
|
||||
subPath: {{ .Values.master.persistence.subPath }}
|
||||
{{- end }}
|
||||
{{- if .Values.sysctl.enabled }}
|
||||
- name: init-sysctl
|
||||
image: {{ include "redis.sysctl.image" . }}
|
||||
imagePullPolicy: {{ default "" .Values.sysctl.image.pullPolicy | quote }}
|
||||
securityContext:
|
||||
privileged: true
|
||||
runAsUser: 0
|
||||
{{- if .Values.sysctl.command }}
|
||||
command: {{- include "common.tplvalues.render" (dict "value" .Values.sysctl.command "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.sysctl.resources }}
|
||||
resources: {{- toYaml .Values.sysctl.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.sysctl.mountHostSys }}
|
||||
volumeMounts:
|
||||
- name: host-sys
|
||||
mountPath: /host-sys
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: start-scripts
|
||||
configMap:
|
||||
name: {{ printf "%s-scripts" (include "common.names.fullname" .) }}
|
||||
defaultMode: 0755
|
||||
- name: health
|
||||
configMap:
|
||||
name: {{ printf "%s-health" (include "common.names.fullname" .) }}
|
||||
defaultMode: 0755
|
||||
{{- if .Values.auth.usePasswordFiles }}
|
||||
- name: redis-password
|
||||
secret:
|
||||
secretName: {{ template "redis.secretName" . }}
|
||||
items:
|
||||
- key: {{ template "redis.secretPasswordKey" . }}
|
||||
path: redis-password
|
||||
{{- end }}
|
||||
- name: config
|
||||
configMap:
|
||||
name: {{ include "redis.configmapName" . }}
|
||||
{{- if .Values.sysctl.mountHostSys }}
|
||||
- name: host-sys
|
||||
hostPath:
|
||||
path: /sys
|
||||
{{- end }}
|
||||
- name: redis-tmp-conf
|
||||
{{- if .Values.master.persistence.medium }}
|
||||
emptyDir:
|
||||
medium: {{ .Values.master.persistence.medium | quote }}
|
||||
{{- if .Values.master.persistence.sizeLimit }}
|
||||
sizeLimit: {{ .Values.master.persistence.sizeLimit | quote }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
- name: tmp
|
||||
{{- if .Values.master.persistence.medium }}
|
||||
emptyDir:
|
||||
medium: {{ .Values.master.persistence.medium | quote }}
|
||||
{{- if .Values.master.persistence.sizeLimit }}
|
||||
sizeLimit: {{ .Values.master.persistence.sizeLimit | quote }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: redis-certificates
|
||||
secret:
|
||||
secretName: {{ include "redis.tlsSecretName" . }}
|
||||
defaultMode: 256
|
||||
{{- end }}
|
||||
{{- if .Values.master.extraVolumes }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.master.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.extraVolumes }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.metrics.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if not .Values.master.persistence.enabled }}
|
||||
- name: redis-data
|
||||
{{- if .Values.master.persistence.medium }}
|
||||
emptyDir: {
|
||||
medium: {{ .Values.master.persistence.medium | quote }}
|
||||
}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- else if .Values.master.persistence.existingClaim }}
|
||||
- name: redis-data
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ printf "%s" (tpl .Values.master.persistence.existingClaim .) }}
|
||||
{{- else if (eq .Values.master.kind "Deployment") }}
|
||||
- name: redis-data
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ printf "redis-data-%s-master" (include "common.names.fullname" .) }}
|
||||
{{- else }}
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: redis-data
|
||||
labels: {{- include "common.labels.matchLabels" . | nindent 10 }}
|
||||
app.kubernetes.io/component: master
|
||||
{{- if .Values.master.persistence.annotations }}
|
||||
annotations: {{- toYaml .Values.master.persistence.annotations | nindent 10 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
{{- range .Values.master.persistence.accessModes }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.master.persistence.size | quote }}
|
||||
{{- if .Values.master.persistence.selector }}
|
||||
selector: {{- include "common.tplvalues.render" (dict "value" .Values.master.persistence.selector "context" $) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if .Values.master.persistence.dataSource }}
|
||||
dataSource: {{- include "common.tplvalues.render" (dict "value" .Values.master.persistence.dataSource "context" $) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- include "common.storage.class" (dict "persistence" .Values.master.persistence "global" .Values.global) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
46
pomerium/charts/redis/templates/master/psp.yaml
Normal file
46
pomerium/charts/redis/templates/master/psp.yaml
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
{{- $pspAvailable := (semverCompare "<1.25-0" (include "common.capabilities.kubeVersion" .)) -}}
|
||||
{{- if and $pspAvailable .Values.podSecurityPolicy.create }}
|
||||
apiVersion: policy/v1beta1
|
||||
kind: PodSecurityPolicy
|
||||
metadata:
|
||||
name: {{ printf "%s-master" (include "common.names.fullname" .) }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
allowPrivilegeEscalation: false
|
||||
fsGroup:
|
||||
rule: 'MustRunAs'
|
||||
ranges:
|
||||
- min: {{ .Values.master.podSecurityContext.fsGroup }}
|
||||
max: {{ .Values.master.podSecurityContext.fsGroup }}
|
||||
hostIPC: false
|
||||
hostNetwork: false
|
||||
hostPID: false
|
||||
privileged: false
|
||||
readOnlyRootFilesystem: false
|
||||
requiredDropCapabilities:
|
||||
- ALL
|
||||
runAsUser:
|
||||
rule: 'MustRunAs'
|
||||
ranges:
|
||||
- min: {{ .Values.master.containerSecurityContext.runAsUser }}
|
||||
max: {{ .Values.master.containerSecurityContext.runAsUser }}
|
||||
seLinux:
|
||||
rule: 'RunAsAny'
|
||||
supplementalGroups:
|
||||
rule: 'MustRunAs'
|
||||
ranges:
|
||||
- min: {{ .Values.master.containerSecurityContext.runAsUser }}
|
||||
max: {{ .Values.master.containerSecurityContext.runAsUser }}
|
||||
volumes:
|
||||
- 'configMap'
|
||||
- 'secret'
|
||||
- 'emptyDir'
|
||||
- 'persistentVolumeClaim'
|
||||
{{- end }}
|
||||
27
pomerium/charts/redis/templates/master/pvc.yaml
Normal file
27
pomerium/charts/redis/templates/master/pvc.yaml
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{{- if and (eq .Values.architecture "standalone") (eq .Values.master.kind "Deployment") (.Values.master.persistence.enabled) (not .Values.master.persistence.existingClaim) }}
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: {{ printf "redis-data-%s-master" (include "common.names.fullname" .) }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.matchLabels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: master
|
||||
{{- if .Values.master.persistence.annotations }}
|
||||
annotations: {{- toYaml .Values.master.persistence.annotations | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
{{- range .Values.master.persistence.accessModes }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.master.persistence.size | quote }}
|
||||
{{- if .Values.master.persistence.selector }}
|
||||
selector: {{- include "common.tplvalues.render" (dict "value" .Values.master.persistence.selector "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.master.persistence.dataSource }}
|
||||
dataSource: {{- include "common.tplvalues.render" (dict "value" .Values.master.persistence.dataSource "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- include "common.storage.class" (dict "persistence" .Values.master.persistence "global" .Values.global) | nindent 2 }}
|
||||
{{- end }}
|
||||
58
pomerium/charts/redis/templates/master/service.yaml
Normal file
58
pomerium/charts/redis/templates/master/service.yaml
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
{{- if not .Values.sentinel.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ printf "%s-master" (include "common.names.fullname" .) }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/component: master
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.master.service.annotations .Values.commonAnnotations }}
|
||||
annotations:
|
||||
{{- if .Values.master.service.annotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.master.service.annotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.master.service.type }}
|
||||
{{- if or (eq .Values.master.service.type "LoadBalancer") (eq .Values.master.service.type "NodePort") }}
|
||||
externalTrafficPolicy: {{ .Values.master.service.externalTrafficPolicy | quote }}
|
||||
{{- end }}
|
||||
{{- if (semverCompare ">=1.22-0" (include "common.capabilities.kubeVersion" .)) }}
|
||||
internalTrafficPolicy: {{ .Values.master.service.internalTrafficPolicy }}
|
||||
{{- end }}
|
||||
{{- if and (eq .Values.master.service.type "LoadBalancer") (not (empty .Values.master.service.loadBalancerIP)) }}
|
||||
loadBalancerIP: {{ .Values.master.service.loadBalancerIP }}
|
||||
{{- end }}
|
||||
{{- if and (eq .Values.master.service.type "LoadBalancer") (not (empty .Values.master.service.loadBalancerSourceRanges)) }}
|
||||
loadBalancerSourceRanges: {{ .Values.master.service.loadBalancerSourceRanges }}
|
||||
{{- end }}
|
||||
{{- if and .Values.master.service.clusterIP (eq .Values.master.service.type "ClusterIP") }}
|
||||
clusterIP: {{ .Values.master.service.clusterIP }}
|
||||
{{- end }}
|
||||
{{- if .Values.master.service.sessionAffinity }}
|
||||
sessionAffinity: {{ .Values.master.service.sessionAffinity }}
|
||||
{{- end }}
|
||||
{{- if .Values.master.service.sessionAffinityConfig }}
|
||||
sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.master.service.sessionAffinityConfig "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: tcp-redis
|
||||
port: {{ .Values.master.service.ports.redis }}
|
||||
targetPort: redis
|
||||
{{- if and (or (eq .Values.master.service.type "NodePort") (eq .Values.master.service.type "LoadBalancer")) .Values.master.service.nodePorts.redis}}
|
||||
nodePort: {{ .Values.master.service.nodePorts.redis}}
|
||||
{{- else if eq .Values.master.service.type "ClusterIP" }}
|
||||
nodePort: null
|
||||
{{- end }}
|
||||
{{- if .Values.master.service.extraPorts }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.master.service.extraPorts "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: master
|
||||
{{- end }}
|
||||
41
pomerium/charts/redis/templates/metrics-svc.yaml
Normal file
41
pomerium/charts/redis/templates/metrics-svc.yaml
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{{- if .Values.metrics.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ printf "%s-metrics" (include "common.names.fullname" .) }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/component: metrics
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.metrics.service.annotations .Values.commonAnnotations }}
|
||||
annotations:
|
||||
{{- if .Values.metrics.service.annotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.metrics.service.annotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.metrics.service.type }}
|
||||
{{- if eq .Values.metrics.service.type "LoadBalancer" }}
|
||||
externalTrafficPolicy: {{ .Values.metrics.service.externalTrafficPolicy }}
|
||||
{{- end }}
|
||||
{{- if and (eq .Values.metrics.service.type "LoadBalancer") .Values.metrics.service.loadBalancerIP }}
|
||||
loadBalancerIP: {{ .Values.metrics.service.loadBalancerIP }}
|
||||
{{- end }}
|
||||
{{- if and (eq .Values.metrics.service.type "LoadBalancer") .Values.metrics.service.loadBalancerSourceRanges }}
|
||||
loadBalancerSourceRanges: {{- toYaml .Values.metrics.service.loadBalancerSourceRanges | nindent 4 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http-metrics
|
||||
port: {{ .Values.metrics.service.port }}
|
||||
protocol: TCP
|
||||
targetPort: metrics
|
||||
{{- if .Values.metrics.service.extraPorts }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.metrics.service.extraPorts "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
|
||||
{{- end }}
|
||||
78
pomerium/charts/redis/templates/networkpolicy.yaml
Normal file
78
pomerium/charts/redis/templates/networkpolicy.yaml
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
{{- if .Values.networkPolicy.enabled }}
|
||||
kind: NetworkPolicy
|
||||
apiVersion: {{ template "networkPolicy.apiVersion" . }}
|
||||
metadata:
|
||||
name: {{ template "common.names.fullname" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
|
||||
policyTypes:
|
||||
- Ingress
|
||||
{{- if or (eq .Values.architecture "replication") .Values.networkPolicy.extraEgress }}
|
||||
- Egress
|
||||
egress:
|
||||
{{- if eq .Values.architecture "replication" }}
|
||||
# Allow dns resolution
|
||||
- ports:
|
||||
- port: 53
|
||||
protocol: UDP
|
||||
# Allow outbound connections to other cluster pods
|
||||
- ports:
|
||||
- port: {{ .Values.master.containerPorts.redis }}
|
||||
{{- if .Values.sentinel.enabled }}
|
||||
- port: {{ .Values.sentinel.containerPorts.sentinel }}
|
||||
{{- end }}
|
||||
to:
|
||||
- podSelector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" . | nindent 14 }}
|
||||
{{- end }}
|
||||
{{- if .Values.networkPolicy.extraEgress }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.networkPolicy.extraEgress "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ingress:
|
||||
# Allow inbound connections
|
||||
- ports:
|
||||
- port: {{ .Values.master.containerPorts.redis }}
|
||||
{{- if .Values.sentinel.enabled }}
|
||||
- port: {{ .Values.sentinel.containerPorts.sentinel }}
|
||||
{{- end }}
|
||||
{{- if not .Values.networkPolicy.allowExternal }}
|
||||
from:
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
{{ template "common.names.fullname" . }}-client: "true"
|
||||
- podSelector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" . | nindent 14 }}
|
||||
{{- if .Values.networkPolicy.ingressNSMatchLabels }}
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
{{- range $key, $value := .Values.networkPolicy.ingressNSMatchLabels }}
|
||||
{{ $key | quote }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.networkPolicy.ingressNSPodMatchLabels }}
|
||||
podSelector:
|
||||
matchLabels:
|
||||
{{- range $key, $value := .Values.networkPolicy.ingressNSPodMatchLabels }}
|
||||
{{ $key | quote }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.enabled }}
|
||||
# Allow prometheus scrapes for metrics
|
||||
- ports:
|
||||
- port: 9121
|
||||
{{- end }}
|
||||
{{- if .Values.networkPolicy.extraIngress }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.networkPolicy.extraIngress "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
23
pomerium/charts/redis/templates/pdb.yaml
Normal file
23
pomerium/charts/redis/templates/pdb.yaml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{{- if .Values.pdb.create }}
|
||||
apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
|
||||
kind: PodDisruptionBudget
|
||||
metadata:
|
||||
name: {{ template "common.names.fullname" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.pdb.minAvailable }}
|
||||
minAvailable: {{ .Values.pdb.minAvailable }}
|
||||
{{- end }}
|
||||
{{- if .Values.pdb.maxUnavailable }}
|
||||
maxUnavailable: {{ .Values.pdb.maxUnavailable }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
|
||||
{{- end }}
|
||||
23
pomerium/charts/redis/templates/prometheusrule.yaml
Normal file
23
pomerium/charts/redis/templates/prometheusrule.yaml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{{- if and .Values.metrics.enabled .Values.metrics.prometheusRule.enabled }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: PrometheusRule
|
||||
metadata:
|
||||
name: {{ template "common.names.fullname" . }}
|
||||
namespace: {{ default .Release.Namespace .Values.metrics.prometheusRule.namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.metrics.prometheusRule.additionalLabels }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.metrics.prometheusRule.additionalLabels "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with .Values.metrics.prometheusRule.rules }}
|
||||
groups:
|
||||
- name: {{ template "common.names.name" $ }}
|
||||
rules: {{- tpl (toYaml .) $ | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
47
pomerium/charts/redis/templates/replicas/hpa.yaml
Normal file
47
pomerium/charts/redis/templates/replicas/hpa.yaml
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
{{- if and .Values.replica.autoscaling.enabled (not .Values.sentinel.enabled) }}
|
||||
apiVersion: {{ include "common.capabilities.hpa.apiVersion" ( dict "context" $ ) }}
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ printf "%s-replicas" (include "common.names.fullname" .) }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/component: replica
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
|
||||
kind: StatefulSet
|
||||
name: {{ printf "%s-replicas" (include "common.names.fullname" .) }}
|
||||
minReplicas: {{ .Values.replica.autoscaling.minReplicas }}
|
||||
maxReplicas: {{ .Values.replica.autoscaling.maxReplicas }}
|
||||
metrics:
|
||||
{{- if .Values.replica.autoscaling.targetMemory }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: memory
|
||||
{{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
|
||||
targetAverageUtilization: {{ .Values.replica.autoscaling.targetMemory }}
|
||||
{{- else }}
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ .Values.replica.autoscaling.targetMemory }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.autoscaling.targetCPU }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
{{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
|
||||
targetAverageUtilization: {{ .Values.replica.autoscaling.targetCPU }}
|
||||
{{- else }}
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ .Values.replica.autoscaling.targetCPU }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
58
pomerium/charts/redis/templates/replicas/service.yaml
Normal file
58
pomerium/charts/redis/templates/replicas/service.yaml
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
{{- if and (eq .Values.architecture "replication") (not .Values.sentinel.enabled) }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ printf "%s-replicas" (include "common.names.fullname" .) }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/component: replica
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.replica.service.annotations .Values.commonAnnotations }}
|
||||
annotations:
|
||||
{{- if .Values.replica.service.annotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.replica.service.annotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.replica.service.type }}
|
||||
{{- if or (eq .Values.replica.service.type "LoadBalancer") (eq .Values.replica.service.type "NodePort") }}
|
||||
externalTrafficPolicy: {{ .Values.replica.service.externalTrafficPolicy | quote }}
|
||||
{{- end }}
|
||||
{{- if (semverCompare ">=1.22-0" (include "common.capabilities.kubeVersion" .)) }}
|
||||
internalTrafficPolicy: {{ .Values.replica.service.internalTrafficPolicy }}
|
||||
{{- end }}
|
||||
{{- if and (eq .Values.replica.service.type "LoadBalancer") (not (empty .Values.replica.service.loadBalancerIP)) }}
|
||||
loadBalancerIP: {{ .Values.replica.service.loadBalancerIP }}
|
||||
{{- end }}
|
||||
{{- if and (eq .Values.replica.service.type "LoadBalancer") (not (empty .Values.replica.service.loadBalancerSourceRanges)) }}
|
||||
loadBalancerSourceRanges: {{ .Values.replica.service.loadBalancerSourceRanges }}
|
||||
{{- end }}
|
||||
{{- if and .Values.replica.service.clusterIP (eq .Values.replica.service.type "ClusterIP") }}
|
||||
clusterIP: {{ .Values.replica.service.clusterIP }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.service.sessionAffinity }}
|
||||
sessionAffinity: {{ .Values.replica.service.sessionAffinity }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.service.sessionAffinityConfig }}
|
||||
sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.replica.service.sessionAffinityConfig "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: tcp-redis
|
||||
port: {{ .Values.replica.service.ports.redis }}
|
||||
targetPort: redis
|
||||
{{- if and (or (eq .Values.replica.service.type "NodePort") (eq .Values.replica.service.type "LoadBalancer")) .Values.replica.service.nodePorts.redis}}
|
||||
nodePort: {{ .Values.replica.service.nodePorts.redis}}
|
||||
{{- else if eq .Values.replica.service.type "ClusterIP" }}
|
||||
nodePort: null
|
||||
{{- end }}
|
||||
{{- if .Values.replica.service.extraPorts }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.replica.service.extraPorts "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: replica
|
||||
{{- end }}
|
||||
471
pomerium/charts/redis/templates/replicas/statefulset.yaml
Normal file
471
pomerium/charts/redis/templates/replicas/statefulset.yaml
Normal file
|
|
@ -0,0 +1,471 @@
|
|||
{{- if and (eq .Values.architecture "replication") (not .Values.sentinel.enabled) }}
|
||||
apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ printf "%s-replicas" (include "common.names.fullname" .) }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/component: replica
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if not .Values.replica.autoscaling.enabled }}
|
||||
replicas: {{ .Values.replica.replicaCount }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: replica
|
||||
serviceName: {{ printf "%s-headless" (include "common.names.fullname" .) }}
|
||||
{{- if .Values.replica.updateStrategy }}
|
||||
updateStrategy: {{- toYaml .Values.replica.updateStrategy | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.podManagementPolicy }}
|
||||
podManagementPolicy: {{ .Values.replica.podManagementPolicy | quote }}
|
||||
{{- end }}
|
||||
template:
|
||||
metadata:
|
||||
labels: {{- include "common.labels.standard" . | nindent 8 }}
|
||||
app.kubernetes.io/component: replica
|
||||
{{- if .Values.replica.podLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.replica.podLabels "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if and .Values.metrics.enabled .Values.metrics.podLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.metrics.podLabels "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
annotations:
|
||||
{{- if (include "redis.createConfigmap" .) }}
|
||||
checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
||||
{{- end }}
|
||||
checksum/health: {{ include (print $.Template.BasePath "/health-configmap.yaml") . | sha256sum }}
|
||||
checksum/scripts: {{ include (print $.Template.BasePath "/scripts-configmap.yaml") . | sha256sum }}
|
||||
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
|
||||
{{- if .Values.replica.podAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.replica.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if and .Values.metrics.enabled .Values.metrics.podAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.metrics.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- include "redis.imagePullSecrets" . | nindent 6 }}
|
||||
{{- if .Values.replica.hostAliases }}
|
||||
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.replica.hostAliases "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.podSecurityContext.enabled }}
|
||||
securityContext: {{- omit .Values.replica.podSecurityContext "enabled" | toYaml | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ template "redis.serviceAccountName" . }}
|
||||
{{- if .Values.replica.priorityClassName }}
|
||||
priorityClassName: {{ .Values.replica.priorityClassName | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.affinity }}
|
||||
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.replica.affinity "context" $) | nindent 8 }}
|
||||
{{- else }}
|
||||
affinity:
|
||||
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.replica.podAffinityPreset "component" "replica" "context" $) | nindent 10 }}
|
||||
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.replica.podAntiAffinityPreset "component" "replica" "context" $) | nindent 10 }}
|
||||
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.replica.nodeAffinityPreset.type "key" .Values.replica.nodeAffinityPreset.key "values" .Values.replica.nodeAffinityPreset.values) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.nodeSelector }}
|
||||
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.replica.nodeSelector "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.tolerations }}
|
||||
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.replica.tolerations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.topologySpreadConstraints }}
|
||||
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.replica.topologySpreadConstraints "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.shareProcessNamespace }}
|
||||
shareProcessNamespace: {{ .Values.replica.shareProcessNamespace }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.schedulerName }}
|
||||
schedulerName: {{ .Values.replica.schedulerName | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.dnsPolicy }}
|
||||
dnsPolicy: {{ .Values.replica.dnsPolicy }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.dnsConfig }}
|
||||
dnsConfig: {{- include "common.tplvalues.render" (dict "value" .Values.replica.dnsConfig "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
terminationGracePeriodSeconds: {{ .Values.replica.terminationGracePeriodSeconds }}
|
||||
containers:
|
||||
- name: redis
|
||||
image: {{ template "redis.image" . }}
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
||||
{{- if not .Values.diagnosticMode.enabled }}
|
||||
{{- if .Values.replica.lifecycleHooks }}
|
||||
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.replica.lifecycleHooks "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.containerSecurityContext.enabled }}
|
||||
securityContext: {{- omit .Values.replica.containerSecurityContext "enabled" | toYaml | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.diagnosticMode.enabled }}
|
||||
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
|
||||
{{- else if .Values.replica.command }}
|
||||
command: {{- include "common.tplvalues.render" (dict "value" .Values.replica.command "context" $) | nindent 12 }}
|
||||
{{- else }}
|
||||
command:
|
||||
- /bin/bash
|
||||
{{- end }}
|
||||
{{- if .Values.diagnosticMode.enabled }}
|
||||
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
|
||||
{{- else if .Values.replica.args }}
|
||||
args: {{- include "common.tplvalues.render" (dict "value" .Values.replica.args "context" $) | nindent 12 }}
|
||||
{{- else }}
|
||||
args:
|
||||
- -c
|
||||
- /opt/bitnami/scripts/start-scripts/start-replica.sh
|
||||
{{- end }}
|
||||
env:
|
||||
- name: BITNAMI_DEBUG
|
||||
value: {{ ternary "true" "false" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }}
|
||||
- name: REDIS_REPLICATION_MODE
|
||||
value: slave
|
||||
- name: REDIS_MASTER_HOST
|
||||
{{- if and (eq (int64 .Values.master.count) 1) (ne .Values.master.kind "Deployment") }}
|
||||
value: {{ template "common.names.fullname" . }}-master-0.{{ template "common.names.fullname" . }}-headless.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}
|
||||
{{- else }}
|
||||
value: {{ template "common.names.fullname" . }}-master.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}
|
||||
{{- end }}
|
||||
- name: REDIS_MASTER_PORT_NUMBER
|
||||
value: {{ .Values.master.containerPorts.redis | quote }}
|
||||
- name: ALLOW_EMPTY_PASSWORD
|
||||
value: {{ ternary "no" "yes" .Values.auth.enabled | quote }}
|
||||
{{- if .Values.auth.enabled }}
|
||||
{{- if .Values.auth.usePasswordFiles }}
|
||||
- name: REDIS_PASSWORD_FILE
|
||||
value: "/opt/bitnami/redis/secrets/redis-password"
|
||||
- name: REDIS_MASTER_PASSWORD_FILE
|
||||
value: "/opt/bitnami/redis/secrets/redis-password"
|
||||
{{- else }}
|
||||
- name: REDIS_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "redis.secretName" . }}
|
||||
key: {{ template "redis.secretPasswordKey" . }}
|
||||
- name: REDIS_MASTER_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "redis.secretName" . }}
|
||||
key: {{ template "redis.secretPasswordKey" . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
- name: REDIS_TLS_ENABLED
|
||||
value: {{ ternary "yes" "no" .Values.tls.enabled | quote }}
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: REDIS_TLS_PORT
|
||||
value: {{ .Values.replica.containerPorts.redis | quote }}
|
||||
- name: REDIS_TLS_AUTH_CLIENTS
|
||||
value: {{ ternary "yes" "no" .Values.tls.authClients | quote }}
|
||||
- name: REDIS_TLS_CERT_FILE
|
||||
value: {{ template "redis.tlsCert" . }}
|
||||
- name: REDIS_TLS_KEY_FILE
|
||||
value: {{ template "redis.tlsCertKey" . }}
|
||||
- name: REDIS_TLS_CA_FILE
|
||||
value: {{ template "redis.tlsCACert" . }}
|
||||
{{- if .Values.tls.dhParamsFilename }}
|
||||
- name: REDIS_TLS_DH_PARAMS_FILE
|
||||
value: {{ template "redis.tlsDHParams" . }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
- name: REDIS_PORT
|
||||
value: {{ .Values.replica.containerPorts.redis | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.extraEnvVars }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.replica.extraEnvVars "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.replica.extraEnvVarsCM .Values.replica.extraEnvVarsSecret }}
|
||||
envFrom:
|
||||
{{- if .Values.replica.extraEnvVarsCM }}
|
||||
- configMapRef:
|
||||
name: {{ .Values.replica.extraEnvVarsCM }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.extraEnvVarsSecret }}
|
||||
- secretRef:
|
||||
name: {{ .Values.replica.extraEnvVarsSecret }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: redis
|
||||
containerPort: {{ .Values.replica.containerPorts.redis }}
|
||||
{{- if not .Values.diagnosticMode.enabled }}
|
||||
{{- if .Values.replica.startupProbe.enabled }}
|
||||
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.replica.startupProbe "enabled") "context" $) | nindent 12 }}
|
||||
tcpSocket:
|
||||
port: redis
|
||||
{{- else if .Values.replica.customStartupProbe }}
|
||||
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.replica.customStartupProbe "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.livenessProbe.enabled }}
|
||||
livenessProbe:
|
||||
initialDelaySeconds: {{ .Values.replica.livenessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.replica.livenessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ add1 .Values.replica.livenessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ .Values.replica.livenessProbe.successThreshold }}
|
||||
failureThreshold: {{ .Values.replica.livenessProbe.failureThreshold }}
|
||||
exec:
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- /health/ping_liveness_local_and_master.sh {{ .Values.replica.livenessProbe.timeoutSeconds }}
|
||||
{{- else if .Values.replica.customLivenessProbe }}
|
||||
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.replica.customLivenessProbe "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.readinessProbe.enabled }}
|
||||
readinessProbe:
|
||||
initialDelaySeconds: {{ .Values.replica.readinessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.replica.readinessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ add1 .Values.replica.readinessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ .Values.replica.readinessProbe.successThreshold }}
|
||||
failureThreshold: {{ .Values.replica.readinessProbe.failureThreshold }}
|
||||
exec:
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- /health/ping_readiness_local_and_master.sh {{ .Values.replica.readinessProbe.timeoutSeconds }}
|
||||
{{- else if .Values.replica.customReadinessProbe }}
|
||||
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.replica.customReadinessProbe "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.resources }}
|
||||
resources: {{- toYaml .Values.replica.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: start-scripts
|
||||
mountPath: /opt/bitnami/scripts/start-scripts
|
||||
- name: health
|
||||
mountPath: /health
|
||||
{{- if .Values.auth.usePasswordFiles }}
|
||||
- name: redis-password
|
||||
mountPath: /opt/bitnami/redis/secrets/
|
||||
{{- end }}
|
||||
- name: redis-data
|
||||
mountPath: /data
|
||||
subPath: {{ .Values.replica.persistence.subPath }}
|
||||
- name: config
|
||||
mountPath: /opt/bitnami/redis/mounted-etc
|
||||
- name: redis-tmp-conf
|
||||
mountPath: /opt/bitnami/redis/etc
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: redis-certificates
|
||||
mountPath: /opt/bitnami/redis/certs
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
{{- if .Values.replica.extraVolumeMounts }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.replica.extraVolumeMounts "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.enabled }}
|
||||
- name: metrics
|
||||
image: {{ include "redis.metrics.image" . }}
|
||||
imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }}
|
||||
{{- if .Values.metrics.containerSecurityContext.enabled }}
|
||||
securityContext: {{- omit .Values.metrics.containerSecurityContext "enabled" | toYaml | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.diagnosticMode.enabled }}
|
||||
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
|
||||
{{- else if .Values.metrics.command }}
|
||||
command: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.command "context" $) | nindent 12 }}
|
||||
{{- else }}
|
||||
command:
|
||||
- /bin/bash
|
||||
- -c
|
||||
- |
|
||||
if [[ -f '/secrets/redis-password' ]]; then
|
||||
export REDIS_PASSWORD=$(cat /secrets/redis-password)
|
||||
fi
|
||||
redis_exporter{{- range $key, $value := .Values.metrics.extraArgs }} --{{ $key }}={{ $value }}{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.diagnosticMode.enabled }}
|
||||
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
env:
|
||||
- name: REDIS_ALIAS
|
||||
value: {{ template "common.names.fullname" . }}
|
||||
{{- if .Values.auth.enabled }}
|
||||
- name: REDIS_USER
|
||||
value: default
|
||||
{{- if (not .Values.auth.usePasswordFiles) }}
|
||||
- name: REDIS_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "redis.secretName" . }}
|
||||
key: {{ template "redis.secretPasswordKey" . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: REDIS_ADDR
|
||||
value: rediss://{{ .Values.metrics.redisTargetHost }}:{{ .Values.replica.containerPorts.redis }}
|
||||
{{- if .Values.tls.authClients }}
|
||||
- name: REDIS_EXPORTER_TLS_CLIENT_KEY_FILE
|
||||
value: {{ template "redis.tlsCertKey" . }}
|
||||
- name: REDIS_EXPORTER_TLS_CLIENT_CERT_FILE
|
||||
value: {{ template "redis.tlsCert" . }}
|
||||
{{- end }}
|
||||
- name: REDIS_EXPORTER_TLS_CA_CERT_FILE
|
||||
value: {{ template "redis.tlsCACert" . }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: metrics
|
||||
containerPort: 9121
|
||||
{{- if .Values.metrics.resources }}
|
||||
resources: {{- toYaml .Values.metrics.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
{{- if .Values.auth.usePasswordFiles }}
|
||||
- name: redis-password
|
||||
mountPath: /secrets/
|
||||
{{- end }}
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: redis-certificates
|
||||
mountPath: /opt/bitnami/redis/certs
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.extraVolumeMounts }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.metrics.extraVolumeMounts "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.sidecars }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.replica.sidecars "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- $needsVolumePermissions := and .Values.volumePermissions.enabled .Values.replica.persistence.enabled .Values.replica.podSecurityContext.enabled .Values.replica.containerSecurityContext.enabled }}
|
||||
{{- if or .Values.replica.initContainers $needsVolumePermissions .Values.sysctl.enabled }}
|
||||
initContainers:
|
||||
{{- if .Values.replica.initContainers }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.replica.initContainers "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $needsVolumePermissions }}
|
||||
- name: volume-permissions
|
||||
image: {{ include "redis.volumePermissions.image" . }}
|
||||
imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }}
|
||||
command:
|
||||
- /bin/bash
|
||||
- -ec
|
||||
- |
|
||||
{{- if eq ( toString ( .Values.volumePermissions.containerSecurityContext.runAsUser )) "auto" }}
|
||||
chown -R `id -u`:`id -G | cut -d " " -f2` {{ .Values.replica.persistence.path }}
|
||||
{{- else }}
|
||||
chown -R {{ .Values.replica.containerSecurityContext.runAsUser }}:{{ .Values.replica.podSecurityContext.fsGroup }} {{ .Values.replica.persistence.path }}
|
||||
{{- end }}
|
||||
{{- if eq ( toString ( .Values.volumePermissions.containerSecurityContext.runAsUser )) "auto" }}
|
||||
securityContext: {{- omit .Values.volumePermissions.containerSecurityContext "runAsUser" | toYaml | nindent 12 }}
|
||||
{{- else }}
|
||||
securityContext: {{- .Values.volumePermissions.containerSecurityContext | toYaml | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.volumePermissions.resources }}
|
||||
resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: redis-data
|
||||
mountPath: {{ .Values.replica.persistence.path }}
|
||||
subPath: {{ .Values.replica.persistence.subPath }}
|
||||
{{- end }}
|
||||
{{- if .Values.sysctl.enabled }}
|
||||
- name: init-sysctl
|
||||
image: {{ include "redis.sysctl.image" . }}
|
||||
imagePullPolicy: {{ default "" .Values.sysctl.image.pullPolicy | quote }}
|
||||
securityContext:
|
||||
privileged: true
|
||||
runAsUser: 0
|
||||
{{- if .Values.sysctl.command }}
|
||||
command: {{- include "common.tplvalues.render" (dict "value" .Values.sysctl.command "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.sysctl.resources }}
|
||||
resources: {{- toYaml .Values.sysctl.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.sysctl.mountHostSys }}
|
||||
volumeMounts:
|
||||
- name: host-sys
|
||||
mountPath: /host-sys
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: start-scripts
|
||||
configMap:
|
||||
name: {{ printf "%s-scripts" (include "common.names.fullname" .) }}
|
||||
defaultMode: 0755
|
||||
- name: health
|
||||
configMap:
|
||||
name: {{ printf "%s-health" (include "common.names.fullname" .) }}
|
||||
defaultMode: 0755
|
||||
{{- if .Values.auth.usePasswordFiles }}
|
||||
- name: redis-password
|
||||
secret:
|
||||
secretName: {{ template "redis.secretName" . }}
|
||||
items:
|
||||
- key: {{ template "redis.secretPasswordKey" . }}
|
||||
path: redis-password
|
||||
{{- end }}
|
||||
- name: config
|
||||
configMap:
|
||||
name: {{ include "redis.configmapName" . }}
|
||||
{{- if .Values.sysctl.mountHostSys }}
|
||||
- name: host-sys
|
||||
hostPath:
|
||||
path: /sys
|
||||
{{- end }}
|
||||
- name: redis-tmp-conf
|
||||
{{- if .Values.replica.persistence.medium }}
|
||||
emptyDir:
|
||||
medium: {{ .Values.replica.persistence.medium | quote }}
|
||||
{{- if .Values.replica.persistence.sizeLimit }}
|
||||
sizeLimit: {{ .Values.replica.persistence.sizeLimit | quote }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: redis-certificates
|
||||
secret:
|
||||
secretName: {{ include "redis.tlsSecretName" . }}
|
||||
defaultMode: 256
|
||||
{{- end }}
|
||||
{{- if .Values.replica.extraVolumes }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.replica.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.extraVolumes }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.metrics.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if not .Values.replica.persistence.enabled }}
|
||||
- name: redis-data
|
||||
{{- if .Values.replica.persistence.medium }}
|
||||
emptyDir: {
|
||||
medium: {{ .Values.replica.persistence.medium | quote }}
|
||||
}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- else if .Values.replica.persistence.existingClaim }}
|
||||
- name: redis-data
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ printf "%s" (tpl .Values.replica.persistence.existingClaim .) }}
|
||||
{{- else }}
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: redis-data
|
||||
labels: {{- include "common.labels.matchLabels" . | nindent 10 }}
|
||||
app.kubernetes.io/component: replica
|
||||
{{- if .Values.replica.persistence.annotations }}
|
||||
annotations: {{- toYaml .Values.replica.persistence.annotations | nindent 10 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
{{- range .Values.replica.persistence.accessModes }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.replica.persistence.size | quote }}
|
||||
{{- if .Values.replica.persistence.selector }}
|
||||
selector: {{- include "common.tplvalues.render" (dict "value" .Values.replica.persistence.selector "context" $) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.persistence.dataSource }}
|
||||
dataSource: {{- include "common.tplvalues.render" (dict "value" .Values.replica.persistence.dataSource "context" $) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- include "common.storage.class" (dict "persistence" .Values.replica.persistence "global" .Values.global) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
28
pomerium/charts/redis/templates/role.yaml
Normal file
28
pomerium/charts/redis/templates/role.yaml
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{{- if .Values.rbac.create }}
|
||||
apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
|
||||
kind: Role
|
||||
metadata:
|
||||
name: {{ template "common.names.fullname" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- $pspAvailable := (semverCompare "<1.25-0" (include "common.capabilities.kubeVersion" .)) -}}
|
||||
{{- if and $pspAvailable .Values.podSecurityPolicy.enabled }}
|
||||
- apiGroups:
|
||||
- '{{ template "podSecurityPolicy.apiGroup" . }}'
|
||||
resources:
|
||||
- 'podsecuritypolicies'
|
||||
verbs:
|
||||
- 'use'
|
||||
resourceNames: [{{ printf "%s-master" (include "common.names.fullname" .) }}]
|
||||
{{- end }}
|
||||
{{- if .Values.rbac.rules }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.rbac.rules "context" $ ) | nindent 2 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
21
pomerium/charts/redis/templates/rolebinding.yaml
Normal file
21
pomerium/charts/redis/templates/rolebinding.yaml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{{- if .Values.rbac.create }}
|
||||
apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: {{ template "common.names.fullname" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: {{ template "common.names.fullname" . }}
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ template "redis.serviceAccountName" . }}
|
||||
{{- end }}
|
||||
627
pomerium/charts/redis/templates/scripts-configmap.yaml
Normal file
627
pomerium/charts/redis/templates/scripts-configmap.yaml
Normal file
|
|
@ -0,0 +1,627 @@
|
|||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ printf "%s-scripts" (include "common.names.fullname" .) }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
data:
|
||||
{{- if and (eq .Values.architecture "replication") .Values.sentinel.enabled }}
|
||||
start-node.sh: |
|
||||
#!/bin/bash
|
||||
|
||||
. /opt/bitnami/scripts/libos.sh
|
||||
. /opt/bitnami/scripts/liblog.sh
|
||||
. /opt/bitnami/scripts/libvalidations.sh
|
||||
|
||||
get_port() {
|
||||
hostname="$1"
|
||||
type="$2"
|
||||
|
||||
port_var=$(echo "${hostname^^}_SERVICE_PORT_$type" | sed "s/-/_/g")
|
||||
port=${!port_var}
|
||||
|
||||
if [ -z "$port" ]; then
|
||||
case $type in
|
||||
"SENTINEL")
|
||||
echo {{ .Values.sentinel.containerPorts.sentinel }}
|
||||
;;
|
||||
"REDIS")
|
||||
echo {{ .Values.master.containerPorts.redis }}
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo $port
|
||||
fi
|
||||
}
|
||||
|
||||
get_full_hostname() {
|
||||
hostname="$1"
|
||||
|
||||
{{- if .Values.useExternalDNS.enabled }}
|
||||
echo "${hostname}.{{- include "redis.externalDNS.suffix" . }}"
|
||||
{{- else if eq .Values.sentinel.service.type "NodePort" }}
|
||||
echo "${hostname}.{{- .Release.Namespace }}"
|
||||
{{- else }}
|
||||
echo "${hostname}.${HEADLESS_SERVICE}"
|
||||
{{- end }}
|
||||
}
|
||||
|
||||
REDISPORT=$(get_port "$HOSTNAME" "REDIS")
|
||||
|
||||
HEADLESS_SERVICE="{{ template "common.names.fullname" . }}-headless.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}"
|
||||
|
||||
if [ -n "$REDIS_EXTERNAL_MASTER_HOST" ]; then
|
||||
REDIS_SERVICE="$REDIS_EXTERNAL_MASTER_HOST"
|
||||
else
|
||||
REDIS_SERVICE="{{ template "common.names.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}"
|
||||
fi
|
||||
|
||||
SENTINEL_SERVICE_PORT=$(get_port "{{ include "common.names.fullname" . }}" "TCP_SENTINEL")
|
||||
validate_quorum() {
|
||||
if is_boolean_yes "$REDIS_SENTINEL_TLS_ENABLED"; then
|
||||
quorum_info_command="{{- if and .Values.auth.enabled .Values.auth.sentinel }}REDISCLI_AUTH="\$REDIS_PASSWORD" {{ end }}redis-cli -h $REDIS_SERVICE -p $SENTINEL_SERVICE_PORT --tls --cert ${REDIS_SENTINEL_TLS_CERT_FILE} --key ${REDIS_SENTINEL_TLS_KEY_FILE} --cacert ${REDIS_SENTINEL_TLS_CA_FILE} sentinel master {{ .Values.sentinel.masterSet }}"
|
||||
else
|
||||
quorum_info_command="{{- if and .Values.auth.enabled .Values.auth.sentinel }}REDISCLI_AUTH="\$REDIS_PASSWORD" {{ end }}redis-cli -h $REDIS_SERVICE -p $SENTINEL_SERVICE_PORT sentinel master {{ .Values.sentinel.masterSet }}"
|
||||
fi
|
||||
info "about to run the command: $quorum_info_command"
|
||||
eval $quorum_info_command | grep -Fq "s_down"
|
||||
}
|
||||
|
||||
trigger_manual_failover() {
|
||||
if is_boolean_yes "$REDIS_SENTINEL_TLS_ENABLED"; then
|
||||
failover_command="{{- if and .Values.auth.enabled .Values.auth.sentinel }}REDISCLI_AUTH="\$REDIS_PASSWORD" {{ end }}redis-cli -h $REDIS_SERVICE -p $SENTINEL_SERVICE_PORT --tls --cert ${REDIS_SENTINEL_TLS_CERT_FILE} --key ${REDIS_SENTINEL_TLS_KEY_FILE} --cacert ${REDIS_SENTINEL_TLS_CA_FILE} sentinel failover {{ .Values.sentinel.masterSet }}"
|
||||
else
|
||||
failover_command="{{- if and .Values.auth.enabled .Values.auth.sentinel }}REDISCLI_AUTH="\$REDIS_PASSWORD" {{ end }}redis-cli -h $REDIS_SERVICE -p $SENTINEL_SERVICE_PORT sentinel failover {{ .Values.sentinel.masterSet }}"
|
||||
fi
|
||||
|
||||
info "about to run the command: $failover_command"
|
||||
eval $failover_command
|
||||
}
|
||||
|
||||
get_sentinel_master_info() {
|
||||
if is_boolean_yes "$REDIS_SENTINEL_TLS_ENABLED"; then
|
||||
sentinel_info_command="{{- if and .Values.auth.enabled .Values.auth.sentinel }}REDISCLI_AUTH="\$REDIS_PASSWORD" {{ end }}timeout {{ .Values.sentinel.getMasterTimeout }} redis-cli -h $REDIS_SERVICE -p $SENTINEL_SERVICE_PORT --tls --cert ${REDIS_SENTINEL_TLS_CERT_FILE} --key ${REDIS_SENTINEL_TLS_KEY_FILE} --cacert ${REDIS_SENTINEL_TLS_CA_FILE} sentinel get-master-addr-by-name {{ .Values.sentinel.masterSet }}"
|
||||
else
|
||||
sentinel_info_command="{{- if and .Values.auth.enabled .Values.auth.sentinel }}REDISCLI_AUTH="\$REDIS_PASSWORD" {{ end }}timeout {{ .Values.sentinel.getMasterTimeout }} redis-cli -h $REDIS_SERVICE -p $SENTINEL_SERVICE_PORT sentinel get-master-addr-by-name {{ .Values.sentinel.masterSet }}"
|
||||
fi
|
||||
|
||||
info "about to run the command: $sentinel_info_command"
|
||||
eval $sentinel_info_command
|
||||
}
|
||||
|
||||
{{- if and .Values.replica.containerSecurityContext.runAsUser (eq (.Values.replica.containerSecurityContext.runAsUser | int) 0) }}
|
||||
useradd redis
|
||||
chown -R redis {{ .Values.replica.persistence.path }}
|
||||
{{- end }}
|
||||
|
||||
[[ -f $REDIS_PASSWORD_FILE ]] && export REDIS_PASSWORD="$(< "${REDIS_PASSWORD_FILE}")"
|
||||
[[ -f $REDIS_MASTER_PASSWORD_FILE ]] && export REDIS_MASTER_PASSWORD="$(< "${REDIS_MASTER_PASSWORD_FILE}")"
|
||||
|
||||
# check if there is a master
|
||||
master_in_persisted_conf="$(get_full_hostname "$HOSTNAME")"
|
||||
master_port_in_persisted_conf="$REDIS_MASTER_PORT_NUMBER"
|
||||
master_in_sentinel="$(get_sentinel_master_info)"
|
||||
redisRetVal=$?
|
||||
|
||||
{{- if .Values.sentinel.persistence.enabled }}
|
||||
if [[ -f /opt/bitnami/redis-sentinel/etc/sentinel.conf ]]; then
|
||||
master_in_persisted_conf="$(awk '/monitor/ {print $4}' /opt/bitnami/redis-sentinel/etc/sentinel.conf)"
|
||||
master_port_in_persisted_conf="$(awk '/monitor/ {print $5}' /opt/bitnami/redis-sentinel/etc/sentinel.conf)"
|
||||
info "Found previous master ${master_in_persisted_conf}:${master_port_in_persisted_conf} in /opt/bitnami/redis-sentinel/etc/sentinel.conf"
|
||||
debug "$(cat /opt/bitnami/redis-sentinel/etc/sentinel.conf | grep monitor)"
|
||||
touch /opt/bitnami/redis-sentinel/etc/.node_read
|
||||
fi
|
||||
{{- end }}
|
||||
|
||||
if [[ $redisRetVal -ne 0 ]]; then
|
||||
if [[ "$master_in_persisted_conf" == "$(get_full_hostname "$HOSTNAME")" ]]; then
|
||||
# Case 1: No active sentinel and in previous sentinel.conf we were the master --> MASTER
|
||||
info "Configuring the node as master"
|
||||
export REDIS_REPLICATION_MODE="master"
|
||||
else
|
||||
# Case 2: No active sentinel and in previous sentinel.conf we were not master --> REPLICA
|
||||
info "Configuring the node as replica"
|
||||
export REDIS_REPLICATION_MODE="slave"
|
||||
REDIS_MASTER_HOST=${master_in_persisted_conf}
|
||||
REDIS_MASTER_PORT_NUMBER=${master_port_in_persisted_conf}
|
||||
fi
|
||||
else
|
||||
# Fetches current master's host and port
|
||||
REDIS_SENTINEL_INFO=($(get_sentinel_master_info))
|
||||
info "Current master: REDIS_SENTINEL_INFO=(${REDIS_SENTINEL_INFO[0]},${REDIS_SENTINEL_INFO[1]})"
|
||||
REDIS_MASTER_HOST=${REDIS_SENTINEL_INFO[0]}
|
||||
REDIS_MASTER_PORT_NUMBER=${REDIS_SENTINEL_INFO[1]}
|
||||
|
||||
if [[ "$REDIS_MASTER_HOST" == "$(get_full_hostname "$HOSTNAME")" ]]; then
|
||||
# Case 3: Active sentinel and master it is this node --> MASTER
|
||||
info "Configuring the node as master"
|
||||
export REDIS_REPLICATION_MODE="master"
|
||||
else
|
||||
# Case 4: Active sentinel and master is not this node --> REPLICA
|
||||
info "Configuring the node as replica"
|
||||
export REDIS_REPLICATION_MODE="slave"
|
||||
|
||||
{{- if and .Values.sentinel.automateClusterRecovery (le (int .Values.sentinel.downAfterMilliseconds) 2000) }}
|
||||
retry_count=1
|
||||
while validate_quorum
|
||||
do
|
||||
info "sleeping, waiting for Redis master to come up"
|
||||
sleep 1s
|
||||
if ! ((retry_count % 11)); then
|
||||
info "Trying to manually failover"
|
||||
failover_result=$(trigger_manual_failover)
|
||||
|
||||
debug "Failover result: $failover_result"
|
||||
fi
|
||||
|
||||
((retry_count+=1))
|
||||
done
|
||||
info "Redis master is up now"
|
||||
{{- end }}
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -n "$REDIS_EXTERNAL_MASTER_HOST" ]]; then
|
||||
REDIS_MASTER_HOST="$REDIS_EXTERNAL_MASTER_HOST"
|
||||
REDIS_MASTER_PORT_NUMBER="${REDIS_EXTERNAL_MASTER_PORT}"
|
||||
fi
|
||||
|
||||
if [[ ! -f /opt/bitnami/redis/etc/replica.conf ]];then
|
||||
cp /opt/bitnami/redis/mounted-etc/replica.conf /opt/bitnami/redis/etc/replica.conf
|
||||
fi
|
||||
|
||||
if [[ ! -f /opt/bitnami/redis/etc/redis.conf ]];then
|
||||
cp /opt/bitnami/redis/mounted-etc/redis.conf /opt/bitnami/redis/etc/redis.conf
|
||||
fi
|
||||
|
||||
echo "" >> /opt/bitnami/redis/etc/replica.conf
|
||||
echo "replica-announce-port $REDISPORT" >> /opt/bitnami/redis/etc/replica.conf
|
||||
echo "replica-announce-ip $(get_full_hostname "$HOSTNAME")" >> /opt/bitnami/redis/etc/replica.conf
|
||||
|
||||
{{- if .Values.tls.enabled }}
|
||||
ARGS=("--port" "0")
|
||||
ARGS+=("--tls-port" "${REDIS_TLS_PORT}")
|
||||
ARGS+=("--tls-cert-file" "${REDIS_TLS_CERT_FILE}")
|
||||
ARGS+=("--tls-key-file" "${REDIS_TLS_KEY_FILE}")
|
||||
ARGS+=("--tls-ca-cert-file" "${REDIS_TLS_CA_FILE}")
|
||||
ARGS+=("--tls-auth-clients" "${REDIS_TLS_AUTH_CLIENTS}")
|
||||
ARGS+=("--tls-replication" "yes")
|
||||
{{- if .Values.tls.dhParamsFilename }}
|
||||
ARGS+=("--tls-dh-params-file" "${REDIS_TLS_DH_PARAMS_FILE}")
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
ARGS=("--port" "${REDIS_PORT}")
|
||||
{{- end }}
|
||||
|
||||
if [[ "$REDIS_REPLICATION_MODE" = "slave" ]]; then
|
||||
ARGS+=("--replicaof" "${REDIS_MASTER_HOST}" "${REDIS_MASTER_PORT_NUMBER}")
|
||||
fi
|
||||
|
||||
{{- if .Values.auth.enabled }}
|
||||
ARGS+=("--requirepass" "${REDIS_PASSWORD}")
|
||||
ARGS+=("--masterauth" "${REDIS_MASTER_PASSWORD}")
|
||||
{{- else }}
|
||||
ARGS+=("--protected-mode" "no")
|
||||
{{- end }}
|
||||
ARGS+=("--include" "/opt/bitnami/redis/etc/replica.conf")
|
||||
ARGS+=("--include" "/opt/bitnami/redis/etc/redis.conf")
|
||||
{{- if .Values.replica.extraFlags }}
|
||||
{{- range .Values.replica.extraFlags }}
|
||||
ARGS+=({{ . | quote }})
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- if .Values.replica.preExecCmds }}
|
||||
{{- .Values.replica.preExecCmds | nindent 4 }}
|
||||
{{- end }}
|
||||
|
||||
{{- if .Values.replica.command }}
|
||||
exec {{ .Values.replica.command }} "${ARGS[@]}"
|
||||
{{- else }}
|
||||
exec redis-server "${ARGS[@]}"
|
||||
{{- end }}
|
||||
|
||||
start-sentinel.sh: |
|
||||
#!/bin/bash
|
||||
|
||||
. /opt/bitnami/scripts/libos.sh
|
||||
. /opt/bitnami/scripts/libvalidations.sh
|
||||
. /opt/bitnami/scripts/libfile.sh
|
||||
|
||||
HEADLESS_SERVICE="{{ template "common.names.fullname" . }}-headless.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}"
|
||||
REDIS_SERVICE="{{ template "common.names.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}"
|
||||
|
||||
get_port() {
|
||||
hostname="$1"
|
||||
type="$2"
|
||||
|
||||
port_var=$(echo "${hostname^^}_SERVICE_PORT_$type" | sed "s/-/_/g")
|
||||
port=${!port_var}
|
||||
|
||||
if [ -z "$port" ]; then
|
||||
case $type in
|
||||
"SENTINEL")
|
||||
echo {{ .Values.sentinel.containerPorts.sentinel }}
|
||||
;;
|
||||
"REDIS")
|
||||
echo {{ .Values.master.containerPorts.redis }}
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo $port
|
||||
fi
|
||||
}
|
||||
|
||||
get_full_hostname() {
|
||||
hostname="$1"
|
||||
|
||||
{{- if .Values.useExternalDNS.enabled }}
|
||||
echo "${hostname}.{{- include "redis.externalDNS.suffix" . }}"
|
||||
{{- else if eq .Values.sentinel.service.type "NodePort" }}
|
||||
echo "${hostname}.{{- .Release.Namespace }}"
|
||||
{{- else }}
|
||||
echo "${hostname}.${HEADLESS_SERVICE}"
|
||||
{{- end }}
|
||||
}
|
||||
|
||||
SERVPORT=$(get_port "$HOSTNAME" "SENTINEL")
|
||||
REDISPORT=$(get_port "$HOSTNAME" "REDIS")
|
||||
SENTINEL_SERVICE_PORT=$(get_port "{{ include "common.names.fullname" . }}" "TCP_SENTINEL")
|
||||
|
||||
sentinel_conf_set() {
|
||||
local -r key="${1:?missing key}"
|
||||
local value="${2:-}"
|
||||
|
||||
# Sanitize inputs
|
||||
value="${value//\\/\\\\}"
|
||||
value="${value//&/\\&}"
|
||||
value="${value//\?/\\?}"
|
||||
[[ "$value" = "" ]] && value="\"$value\""
|
||||
|
||||
replace_in_file "/opt/bitnami/redis-sentinel/etc/sentinel.conf" "^#*\s*${key} .*" "${key} ${value}" false
|
||||
}
|
||||
sentinel_conf_add() {
|
||||
echo $'\n'"$@" >> "/opt/bitnami/redis-sentinel/etc/sentinel.conf"
|
||||
}
|
||||
host_id() {
|
||||
echo "$1" | openssl sha1 | awk '{print $2}'
|
||||
}
|
||||
get_sentinel_master_info() {
|
||||
if is_boolean_yes "$REDIS_SENTINEL_TLS_ENABLED"; then
|
||||
sentinel_info_command="{{- if and .Values.auth.enabled .Values.auth.sentinel }}REDISCLI_AUTH="\$REDIS_PASSWORD" {{ end }}timeout {{ .Values.sentinel.getMasterTimeout }} redis-cli -h $REDIS_SERVICE -p $SENTINEL_SERVICE_PORT --tls --cert ${REDIS_SENTINEL_TLS_CERT_FILE} --key ${REDIS_SENTINEL_TLS_KEY_FILE} --cacert ${REDIS_SENTINEL_TLS_CA_FILE} sentinel get-master-addr-by-name {{ .Values.sentinel.masterSet }}"
|
||||
else
|
||||
sentinel_info_command="{{- if and .Values.auth.enabled .Values.auth.sentinel }}REDISCLI_AUTH="\$REDIS_PASSWORD" {{ end }}timeout {{ .Values.sentinel.getMasterTimeout }} redis-cli -h $REDIS_SERVICE -p $SENTINEL_SERVICE_PORT sentinel get-master-addr-by-name {{ .Values.sentinel.masterSet }}"
|
||||
fi
|
||||
info "about to run the command: $sentinel_info_command"
|
||||
eval $sentinel_info_command
|
||||
}
|
||||
|
||||
[[ -f $REDIS_PASSWORD_FILE ]] && export REDIS_PASSWORD="$(< "${REDIS_PASSWORD_FILE}")"
|
||||
|
||||
master_in_persisted_conf="$(get_full_hostname "$HOSTNAME")"
|
||||
|
||||
{{- if .Values.sentinel.persistence.enabled }}
|
||||
if [[ -f /opt/bitnami/redis-sentinel/etc/sentinel.conf ]]; then
|
||||
check_lock_file() {
|
||||
[[ -f /opt/bitnami/redis-sentinel/etc/.node_read ]]
|
||||
}
|
||||
retry_while "check_lock_file"
|
||||
rm -f /opt/bitnami/redis-sentinel/etc/.node_read
|
||||
master_in_persisted_conf="$(awk '/monitor/ {print $4}' /opt/bitnami/redis-sentinel/etc/sentinel.conf)"
|
||||
info "Found previous master $master_in_persisted_conf in /opt/bitnami/redis-sentinel/etc/sentinel.conf"
|
||||
debug "$(cat /opt/bitnami/redis-sentinel/etc/sentinel.conf | grep monitor)"
|
||||
fi
|
||||
{{- end }}
|
||||
if ! get_sentinel_master_info && [[ "$master_in_persisted_conf" == "$(get_full_hostname "$HOSTNAME")" ]]; then
|
||||
# No master found, lets create a master node
|
||||
export REDIS_REPLICATION_MODE="master"
|
||||
|
||||
REDIS_MASTER_HOST=$(get_full_hostname "$HOSTNAME")
|
||||
REDIS_MASTER_PORT_NUMBER="$REDISPORT"
|
||||
else
|
||||
export REDIS_REPLICATION_MODE="slave"
|
||||
|
||||
# Fetches current master's host and port
|
||||
REDIS_SENTINEL_INFO=($(get_sentinel_master_info))
|
||||
info "printing REDIS_SENTINEL_INFO=(${REDIS_SENTINEL_INFO[0]},${REDIS_SENTINEL_INFO[1]})"
|
||||
REDIS_MASTER_HOST=${REDIS_SENTINEL_INFO[0]}
|
||||
REDIS_MASTER_PORT_NUMBER=${REDIS_SENTINEL_INFO[1]}
|
||||
fi
|
||||
|
||||
if [[ -n "$REDIS_EXTERNAL_MASTER_HOST" ]]; then
|
||||
REDIS_MASTER_HOST="$REDIS_EXTERNAL_MASTER_HOST"
|
||||
REDIS_MASTER_PORT_NUMBER="${REDIS_EXTERNAL_MASTER_PORT}"
|
||||
fi
|
||||
|
||||
cp /opt/bitnami/redis-sentinel/mounted-etc/sentinel.conf /opt/bitnami/redis-sentinel/etc/sentinel.conf
|
||||
{{- if .Values.auth.enabled }}
|
||||
printf "\nsentinel auth-pass %s %s" "{{ .Values.sentinel.masterSet }}" "$REDIS_PASSWORD" >> /opt/bitnami/redis-sentinel/etc/sentinel.conf
|
||||
{{- if and .Values.auth.enabled .Values.auth.sentinel }}
|
||||
printf "\nrequirepass %s" "$REDIS_PASSWORD" >> /opt/bitnami/redis-sentinel/etc/sentinel.conf
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
printf "\nsentinel myid %s" "$(host_id "$HOSTNAME")" >> /opt/bitnami/redis-sentinel/etc/sentinel.conf
|
||||
|
||||
sentinel_conf_set "sentinel monitor" "{{ .Values.sentinel.masterSet }} "$REDIS_MASTER_HOST" "$REDIS_MASTER_PORT_NUMBER" {{ .Values.sentinel.quorum }}"
|
||||
|
||||
add_known_sentinel() {
|
||||
hostname="$1"
|
||||
ip="$2"
|
||||
|
||||
if [[ -n "$hostname" && -n "$ip" && "$hostname" != "$HOSTNAME" ]]; then
|
||||
sentinel_conf_add "sentinel known-sentinel {{ .Values.sentinel.masterSet }} $(get_full_hostname "$hostname") $(get_port "$hostname" "SENTINEL") $(host_id "$hostname")"
|
||||
fi
|
||||
}
|
||||
add_known_replica() {
|
||||
hostname="$1"
|
||||
ip="$2"
|
||||
|
||||
if [[ -n "$ip" && "$(get_full_hostname "$hostname")" != "$REDIS_MASTER_HOST" ]]; then
|
||||
sentinel_conf_add "sentinel known-replica {{ .Values.sentinel.masterSet }} $(get_full_hostname "$hostname") $(get_port "$hostname" "REDIS")"
|
||||
fi
|
||||
}
|
||||
|
||||
# Add available hosts on the network as known replicas & sentinels
|
||||
for node in $(seq 0 $(({{ .Values.replica.replicaCount }}-1))); do
|
||||
hostname="{{ template "common.names.fullname" . }}-node-$node"
|
||||
ip="$(getent hosts "$hostname.$HEADLESS_SERVICE" | awk '{ print $1 }')"
|
||||
add_known_sentinel "$hostname" "$ip"
|
||||
add_known_replica "$hostname" "$ip"
|
||||
done
|
||||
|
||||
echo "" >> /opt/bitnami/redis-sentinel/etc/sentinel.conf
|
||||
echo "sentinel announce-hostnames yes" >> /opt/bitnami/redis-sentinel/etc/sentinel.conf
|
||||
echo "sentinel resolve-hostnames yes" >> /opt/bitnami/redis-sentinel/etc/sentinel.conf
|
||||
echo "sentinel announce-port $SERVPORT" >> /opt/bitnami/redis-sentinel/etc/sentinel.conf
|
||||
echo "sentinel announce-ip $(get_full_hostname "$HOSTNAME")" >> /opt/bitnami/redis-sentinel/etc/sentinel.conf
|
||||
|
||||
{{- if .Values.tls.enabled }}
|
||||
ARGS=("--port" "0")
|
||||
ARGS+=("--tls-port" "${REDIS_SENTINEL_TLS_PORT_NUMBER}")
|
||||
ARGS+=("--tls-cert-file" "${REDIS_SENTINEL_TLS_CERT_FILE}")
|
||||
ARGS+=("--tls-key-file" "${REDIS_SENTINEL_TLS_KEY_FILE}")
|
||||
ARGS+=("--tls-ca-cert-file" "${REDIS_SENTINEL_TLS_CA_FILE}")
|
||||
ARGS+=("--tls-replication" "yes")
|
||||
ARGS+=("--tls-auth-clients" "${REDIS_SENTINEL_TLS_AUTH_CLIENTS}")
|
||||
{{- if .Values.tls.dhParamsFilename }}
|
||||
ARGS+=("--tls-dh-params-file" "${REDIS_SENTINEL_TLS_DH_PARAMS_FILE}")
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.sentinel.preExecCmds }}
|
||||
{{ .Values.sentinel.preExecCmds | nindent 4 }}
|
||||
{{- end }}
|
||||
exec redis-server /opt/bitnami/redis-sentinel/etc/sentinel.conf --sentinel {{- if .Values.tls.enabled }} "${ARGS[@]}" {{- end }}
|
||||
prestop-sentinel.sh: |
|
||||
#!/bin/bash
|
||||
|
||||
. /opt/bitnami/scripts/libvalidations.sh
|
||||
. /opt/bitnami/scripts/libos.sh
|
||||
|
||||
HEADLESS_SERVICE="{{ template "common.names.fullname" . }}-headless.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}"
|
||||
SENTINEL_SERVICE_ENV_NAME={{ printf "%s%s" (upper (include "common.names.fullname" .)| replace "-" "_") "_SERVICE_PORT_TCP_SENTINEL" }}
|
||||
SENTINEL_SERVICE_PORT=${!SENTINEL_SERVICE_ENV_NAME}
|
||||
|
||||
get_full_hostname() {
|
||||
hostname="$1"
|
||||
|
||||
{{- if .Values.useExternalDNS.enabled }}
|
||||
echo "${hostname}.{{- include "redis.externalDNS.suffix" . }}"
|
||||
{{- else if eq .Values.sentinel.service.type "NodePort" }}
|
||||
echo "${hostname}.{{- .Release.Namespace }}"
|
||||
{{- else }}
|
||||
echo "${hostname}.${HEADLESS_SERVICE}"
|
||||
{{- end }}
|
||||
}
|
||||
run_sentinel_command() {
|
||||
if is_boolean_yes "$REDIS_SENTINEL_TLS_ENABLED"; then
|
||||
redis-cli -h "$REDIS_SERVICE" -p "$SENTINEL_SERVICE_PORT" --tls --cert "$REDIS_SENTINEL_TLS_CERT_FILE" --key "$REDIS_SENTINEL_TLS_KEY_FILE" --cacert "$REDIS_SENTINEL_TLS_CA_FILE" sentinel "$@"
|
||||
else
|
||||
redis-cli -h "$REDIS_SERVICE" -p "$SENTINEL_SERVICE_PORT" sentinel "$@"
|
||||
fi
|
||||
}
|
||||
failover_finished() {
|
||||
REDIS_SENTINEL_INFO=($(run_sentinel_command get-master-addr-by-name "{{ .Values.sentinel.masterSet }}"))
|
||||
REDIS_MASTER_HOST="${REDIS_SENTINEL_INFO[0]}"
|
||||
[[ "$REDIS_MASTER_HOST" != "$(get_full_hostname $HOSTNAME)" ]]
|
||||
}
|
||||
|
||||
REDIS_SERVICE="{{ include "common.names.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}"
|
||||
|
||||
{{ if .Values.auth.sentinel -}}
|
||||
# redis-cli automatically consumes credentials from the REDISCLI_AUTH variable
|
||||
[[ -n "$REDIS_PASSWORD" ]] && export REDISCLI_AUTH="$REDIS_PASSWORD"
|
||||
[[ -f "$REDIS_PASSWORD_FILE" ]] && export REDISCLI_AUTH="$(< "${REDIS_PASSWORD_FILE}")"
|
||||
{{- end }}
|
||||
|
||||
if ! failover_finished; then
|
||||
echo "I am the master pod and you are stopping me. Starting sentinel failover"
|
||||
# if I am the master, issue a command to failover once and then wait for the failover to finish
|
||||
run_sentinel_command failover "{{ .Values.sentinel.masterSet }}"
|
||||
if retry_while "failover_finished" "{{ sub .Values.sentinel.terminationGracePeriodSeconds 10 }}" 1; then
|
||||
echo "Master has been successfuly failed over to a different pod."
|
||||
exit 0
|
||||
else
|
||||
echo "Master failover failed"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
prestop-redis.sh: |
|
||||
#!/bin/bash
|
||||
|
||||
. /opt/bitnami/scripts/libvalidations.sh
|
||||
. /opt/bitnami/scripts/libos.sh
|
||||
|
||||
run_redis_command() {
|
||||
if is_boolean_yes "$REDIS_TLS_ENABLED"; then
|
||||
redis-cli -h 127.0.0.1 -p "$REDIS_TLS_PORT" --tls --cert "$REDIS_TLS_CERT_FILE" --key "$REDIS_TLS_KEY_FILE" --cacert "$REDIS_TLS_CA_FILE" "$@"
|
||||
else
|
||||
redis-cli -h 127.0.0.1 -p ${REDIS_PORT} "$@"
|
||||
fi
|
||||
}
|
||||
failover_finished() {
|
||||
REDIS_ROLE=$(run_redis_command role | head -1)
|
||||
[[ "$REDIS_ROLE" != "master" ]]
|
||||
}
|
||||
|
||||
# redis-cli automatically consumes credentials from the REDISCLI_AUTH variable
|
||||
[[ -n "$REDIS_PASSWORD" ]] && export REDISCLI_AUTH="$REDIS_PASSWORD"
|
||||
[[ -f "$REDIS_PASSWORD_FILE" ]] && export REDISCLI_AUTH="$(< "${REDIS_PASSWORD_FILE}")"
|
||||
|
||||
if ! failover_finished; then
|
||||
echo "Waiting for sentinel to run failover for up to {{ sub .Values.sentinel.terminationGracePeriodSeconds 10 }}s"
|
||||
retry_while "failover_finished" "{{ sub .Values.sentinel.terminationGracePeriodSeconds 10 }}" 1
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
|
||||
{{- else }}
|
||||
start-master.sh: |
|
||||
#!/bin/bash
|
||||
|
||||
[[ -f $REDIS_PASSWORD_FILE ]] && export REDIS_PASSWORD="$(< "${REDIS_PASSWORD_FILE}")"
|
||||
{{- if and .Values.master.containerSecurityContext.runAsUser (eq (.Values.master.containerSecurityContext.runAsUser | int) 0) }}
|
||||
useradd redis
|
||||
chown -R redis {{ .Values.master.persistence.path }}
|
||||
{{- end }}
|
||||
if [[ ! -f /opt/bitnami/redis/etc/master.conf ]];then
|
||||
cp /opt/bitnami/redis/mounted-etc/master.conf /opt/bitnami/redis/etc/master.conf
|
||||
fi
|
||||
if [[ ! -f /opt/bitnami/redis/etc/redis.conf ]];then
|
||||
cp /opt/bitnami/redis/mounted-etc/redis.conf /opt/bitnami/redis/etc/redis.conf
|
||||
fi
|
||||
{{- if .Values.tls.enabled }}
|
||||
ARGS=("--port" "0")
|
||||
ARGS+=("--tls-port" "${REDIS_TLS_PORT}")
|
||||
ARGS+=("--tls-cert-file" "${REDIS_TLS_CERT_FILE}")
|
||||
ARGS+=("--tls-key-file" "${REDIS_TLS_KEY_FILE}")
|
||||
ARGS+=("--tls-ca-cert-file" "${REDIS_TLS_CA_FILE}")
|
||||
ARGS+=("--tls-auth-clients" "${REDIS_TLS_AUTH_CLIENTS}")
|
||||
{{- if .Values.tls.dhParamsFilename }}
|
||||
ARGS+=("--tls-dh-params-file" "${REDIS_TLS_DH_PARAMS_FILE}")
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
ARGS=("--port" "${REDIS_PORT}")
|
||||
{{- end }}
|
||||
{{- if .Values.auth.enabled }}
|
||||
ARGS+=("--requirepass" "${REDIS_PASSWORD}")
|
||||
ARGS+=("--masterauth" "${REDIS_PASSWORD}")
|
||||
{{- else }}
|
||||
ARGS+=("--protected-mode" "no")
|
||||
{{- end }}
|
||||
ARGS+=("--include" "/opt/bitnami/redis/etc/redis.conf")
|
||||
ARGS+=("--include" "/opt/bitnami/redis/etc/master.conf")
|
||||
{{- if .Values.master.extraFlags }}
|
||||
{{- range .Values.master.extraFlags }}
|
||||
ARGS+=({{ . | quote }})
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.master.preExecCmds }}
|
||||
{{ .Values.master.preExecCmds | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.master.command }}
|
||||
exec {{ .Values.master.command }} "${ARGS[@]}"
|
||||
{{- else }}
|
||||
exec redis-server "${ARGS[@]}"
|
||||
{{- end }}
|
||||
{{- if eq .Values.architecture "replication" }}
|
||||
start-replica.sh: |
|
||||
#!/bin/bash
|
||||
|
||||
get_port() {
|
||||
hostname="$1"
|
||||
type="$2"
|
||||
|
||||
port_var=$(echo "${hostname^^}_SERVICE_PORT_$type" | sed "s/-/_/g")
|
||||
port=${!port_var}
|
||||
|
||||
if [ -z "$port" ]; then
|
||||
case $type in
|
||||
"SENTINEL")
|
||||
echo {{ .Values.sentinel.containerPorts.sentinel }}
|
||||
;;
|
||||
"REDIS")
|
||||
echo {{ .Values.master.containerPorts.redis }}
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo $port
|
||||
fi
|
||||
}
|
||||
|
||||
get_full_hostname() {
|
||||
hostname="$1"
|
||||
|
||||
{{- if .Values.useExternalDNS.enabled }}
|
||||
echo "${hostname}.{{- include "redis.externalDNS.suffix" . }}"
|
||||
{{- else if eq .Values.sentinel.service.type "NodePort" }}
|
||||
echo "${hostname}.{{- .Release.Namespace }}"
|
||||
{{- else }}
|
||||
echo "${hostname}.${HEADLESS_SERVICE}"
|
||||
{{- end }}
|
||||
}
|
||||
|
||||
REDISPORT=$(get_port "$HOSTNAME" "REDIS")
|
||||
|
||||
[[ -f $REDIS_PASSWORD_FILE ]] && export REDIS_PASSWORD="$(< "${REDIS_PASSWORD_FILE}")"
|
||||
[[ -f $REDIS_MASTER_PASSWORD_FILE ]] && export REDIS_MASTER_PASSWORD="$(< "${REDIS_MASTER_PASSWORD_FILE}")"
|
||||
{{- if and .Values.replica.containerSecurityContext.runAsUser (eq (.Values.replica.containerSecurityContext.runAsUser | int) 0) }}
|
||||
useradd redis
|
||||
chown -R redis {{ .Values.replica.persistence.path }}
|
||||
{{- end }}
|
||||
if [[ ! -f /opt/bitnami/redis/etc/replica.conf ]];then
|
||||
cp /opt/bitnami/redis/mounted-etc/replica.conf /opt/bitnami/redis/etc/replica.conf
|
||||
fi
|
||||
if [[ ! -f /opt/bitnami/redis/etc/redis.conf ]];then
|
||||
cp /opt/bitnami/redis/mounted-etc/redis.conf /opt/bitnami/redis/etc/redis.conf
|
||||
fi
|
||||
|
||||
echo "" >> /opt/bitnami/redis/etc/replica.conf
|
||||
echo "replica-announce-port $REDISPORT" >> /opt/bitnami/redis/etc/replica.conf
|
||||
echo "replica-announce-ip $(get_full_hostname "$HOSTNAME")" >> /opt/bitnami/redis/etc/replica.conf
|
||||
|
||||
{{- if .Values.tls.enabled }}
|
||||
ARGS=("--port" "0")
|
||||
ARGS+=("--tls-port" "${REDIS_TLS_PORT}")
|
||||
ARGS+=("--tls-cert-file" "${REDIS_TLS_CERT_FILE}")
|
||||
ARGS+=("--tls-key-file" "${REDIS_TLS_KEY_FILE}")
|
||||
ARGS+=("--tls-ca-cert-file" "${REDIS_TLS_CA_FILE}")
|
||||
ARGS+=("--tls-auth-clients" "${REDIS_TLS_AUTH_CLIENTS}")
|
||||
ARGS+=("--tls-replication" "yes")
|
||||
{{- if .Values.tls.dhParamsFilename }}
|
||||
ARGS+=("--tls-dh-params-file" "${REDIS_TLS_DH_PARAMS_FILE}")
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
ARGS=("--port" "${REDIS_PORT}")
|
||||
{{- end }}
|
||||
ARGS+=("--replicaof" "${REDIS_MASTER_HOST}" "${REDIS_MASTER_PORT_NUMBER}")
|
||||
{{- if .Values.auth.enabled }}
|
||||
ARGS+=("--requirepass" "${REDIS_PASSWORD}")
|
||||
ARGS+=("--masterauth" "${REDIS_MASTER_PASSWORD}")
|
||||
{{- else }}
|
||||
ARGS+=("--protected-mode" "no")
|
||||
{{- end }}
|
||||
ARGS+=("--include" "/opt/bitnami/redis/etc/redis.conf")
|
||||
ARGS+=("--include" "/opt/bitnami/redis/etc/replica.conf")
|
||||
{{- if .Values.replica.extraFlags }}
|
||||
{{- range .Values.replica.extraFlags }}
|
||||
ARGS+=({{ . | quote }})
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.preExecCmds }}
|
||||
{{ .Values.replica.preExecCmds | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.command }}
|
||||
exec {{ .Values.replica.command }} "${ARGS[@]}"
|
||||
{{- else }}
|
||||
exec redis-server "${ARGS[@]}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
23
pomerium/charts/redis/templates/secret.yaml
Normal file
23
pomerium/charts/redis/templates/secret.yaml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{{- if and .Values.auth.enabled (not .Values.auth.existingSecret) -}}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ template "common.names.fullname" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.secretAnnotations .Values.commonAnnotations }}
|
||||
annotations:
|
||||
{{- if .Values.secretAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.secretAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
type: Opaque
|
||||
data:
|
||||
redis-password: {{ include "redis.password" . | b64enc | quote }}
|
||||
{{- end -}}
|
||||
47
pomerium/charts/redis/templates/sentinel/hpa.yaml
Normal file
47
pomerium/charts/redis/templates/sentinel/hpa.yaml
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
{{- if and .Values.replica.autoscaling.enabled .Values.sentinel.enabled }}
|
||||
apiVersion: {{ include "common.capabilities.hpa.apiVersion" ( dict "context" $ ) }}
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ printf "%s-node" (include "common.names.fullname" .) }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/component: replica
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
|
||||
kind: StatefulSet
|
||||
name: {{ printf "%s-node" (include "common.names.fullname" .) }}
|
||||
minReplicas: {{ .Values.replica.autoscaling.minReplicas }}
|
||||
maxReplicas: {{ .Values.replica.autoscaling.maxReplicas }}
|
||||
metrics:
|
||||
{{- if .Values.replica.autoscaling.targetMemory }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: memory
|
||||
{{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
|
||||
targetAverageUtilization: {{ .Values.replica.autoscaling.targetMemory }}
|
||||
{{- else }}
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ .Values.replica.autoscaling.targetMemory }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.autoscaling.targetCPU }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
{{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
|
||||
targetAverageUtilization: {{ .Values.replica.autoscaling.targetCPU }}
|
||||
{{- else }}
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ .Values.replica.autoscaling.targetCPU }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
70
pomerium/charts/redis/templates/sentinel/node-services.yaml
Normal file
70
pomerium/charts/redis/templates/sentinel/node-services.yaml
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
{{- if and (eq .Values.architecture "replication") .Values.sentinel.enabled (eq .Values.sentinel.service.type "NodePort") (or .Release.IsUpgrade .Values.sentinel.service.nodePorts.redis ) }}
|
||||
|
||||
{{- range $i := until (int .Values.replica.replicaCount) }}
|
||||
|
||||
{{ $portsmap := (lookup "v1" "ConfigMap" $.Release.Namespace (printf "%s-%s" ( include "common.names.fullname" $ ) "ports-configmap")).data }}
|
||||
|
||||
{{ $sentinelport := 0}}
|
||||
{{ $redisport := 0}}
|
||||
{{- if $portsmap }}
|
||||
{{ $sentinelport = index $portsmap (printf "%s-node-%s-%s" (include "common.names.fullname" $) (toString $i) "sentinel") }}
|
||||
{{ $redisport = index $portsmap (printf "%s-node-%s-%s" (include "common.names.fullname" $) (toString $i) "redis") }}
|
||||
{{- else }}
|
||||
{{- end }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "common.names.fullname" $ }}-node-{{ $i }}
|
||||
namespace: {{ $.Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" $ | nindent 4 }}
|
||||
app.kubernetes.io/component: node
|
||||
{{- if $.Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or $.Values.sentinel.service.annotations $.Values.commonAnnotations }}
|
||||
annotations:
|
||||
{{- if $.Values.sentinel.service.annotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.sentinel.service.annotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.commonAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: NodePort
|
||||
ports:
|
||||
- name: sentinel
|
||||
{{- if $.Values.sentinel.service.nodePorts.sentinel }}
|
||||
nodePort: {{ (add $.Values.sentinel.service.nodePorts.sentinel $i 1) }}
|
||||
port: {{ (add $.Values.sentinel.service.nodePorts.sentinel $i 1) }}
|
||||
{{- else }}
|
||||
nodePort: {{ $sentinelport }}
|
||||
port: {{ $sentinelport }}
|
||||
{{- end }}
|
||||
protocol: TCP
|
||||
targetPort: {{ $.Values.sentinel.containerPorts.sentinel }}
|
||||
- name: redis
|
||||
{{- if $.Values.sentinel.service.nodePorts.redis }}
|
||||
nodePort: {{ (add $.Values.sentinel.service.nodePorts.redis $i 1) }}
|
||||
port: {{ (add $.Values.sentinel.service.nodePorts.redis $i 1) }}
|
||||
{{- else }}
|
||||
nodePort: {{ $redisport }}
|
||||
port: {{ $redisport }}
|
||||
{{- end }}
|
||||
protocol: TCP
|
||||
targetPort: {{ $.Values.replica.containerPorts.redis }}
|
||||
- name: sentinel-internal
|
||||
nodePort: null
|
||||
port: {{ $.Values.sentinel.containerPorts.sentinel }}
|
||||
protocol: TCP
|
||||
targetPort: {{ $.Values.sentinel.containerPorts.sentinel }}
|
||||
- name: redis-internal
|
||||
nodePort: null
|
||||
port: {{ $.Values.replica.containerPorts.redis }}
|
||||
protocol: TCP
|
||||
targetPort: {{ $.Values.replica.containerPorts.redis }}
|
||||
selector:
|
||||
statefulset.kubernetes.io/pod-name: {{ template "common.names.fullname" $ }}-node-{{ $i }}
|
||||
---
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
100
pomerium/charts/redis/templates/sentinel/ports-configmap.yaml
Normal file
100
pomerium/charts/redis/templates/sentinel/ports-configmap.yaml
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
{{- if and (eq .Values.architecture "replication") .Values.sentinel.enabled (eq .Values.sentinel.service.type "NodePort") (not .Values.sentinel.service.nodePorts.redis ) }}
|
||||
{{- /* create a list to keep track of ports we choose to use */}}
|
||||
{{ $chosenports := (list ) }}
|
||||
|
||||
{{- /* Get list of all used nodeports */}}
|
||||
{{ $usedports := (list ) }}
|
||||
{{- range $index, $service := (lookup "v1" "Service" "" "").items }}
|
||||
{{- range.spec.ports }}
|
||||
{{- if .nodePort }}
|
||||
{{- $usedports = (append $usedports .nodePort) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- /*
|
||||
comments that start with # are rendered in the output when you debug, so you can less and search for them
|
||||
Vars in the comment will be rendered out, so you can check their value this way.
|
||||
https://helm.sh/docs/chart_best_practices/templates/#comments-yaml-comments-vs-template-comments
|
||||
|
||||
remove the template comments and leave the yaml comments to help debug
|
||||
*/}}
|
||||
|
||||
{{- /* Sort the list */}}
|
||||
{{ $usedports = $usedports | sortAlpha }}
|
||||
#usedports {{ $usedports }}
|
||||
|
||||
{{- /* How many nodeports per service do we want to create, except for the main service which is always two */}}
|
||||
{{ $numberofPortsPerNodeService := 2 }}
|
||||
|
||||
{{- /* for every nodeport we want, loop though the used ports to get an unused port */}}
|
||||
{{- range $j := until (int (add (mul (int .Values.replica.replicaCount) $numberofPortsPerNodeService) 2)) }}
|
||||
{{- /* #j={{ $j }} */}}
|
||||
{{- $nodeport := (add $j 30000) }}
|
||||
{{- $nodeportfound := false }}
|
||||
{{- range $i := $usedports }}
|
||||
{{- /* #i={{ $i }}
|
||||
#nodeport={{ $nodeport }}
|
||||
#usedports={{ $usedports }} */}}
|
||||
{{- if and (has (toString $nodeport) $usedports) (eq $nodeportfound false) }}
|
||||
{{- /* nodeport conflicts with in use */}}
|
||||
{{- $nodeport = (add $nodeport 1) }}
|
||||
{{- else if and ( has $nodeport $chosenports) (eq $nodeportfound false) }}
|
||||
{{- /* nodeport already chosen, try another */}}
|
||||
{{- $nodeport = (add $nodeport 1) }}
|
||||
{{- else if (eq $nodeportfound false) }}
|
||||
{{- /* nodeport free to use: not already claimed and not in use */}}
|
||||
{{- /* select nodeport, and place into usedports */}}
|
||||
{{- $chosenports = (append $chosenports $nodeport) }}
|
||||
{{- $nodeportfound = true }}
|
||||
{{- else }}
|
||||
{{- /* nodeport has already been chosen and locked in, just work through the rest of the list to get to the next nodeport selection */}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if (eq $nodeportfound false) }}
|
||||
{{- $chosenports = (append $chosenports $nodeport) }}
|
||||
{{- end }}
|
||||
|
||||
{{- end }}
|
||||
|
||||
{{- /* print the usedports and chosenports for debugging */}}
|
||||
#usedports {{ $usedports }}
|
||||
#chosenports {{ $chosenports }}}}
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ template "common.names.fullname" . }}-ports-configmap
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations:
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
data:
|
||||
{{ $portsmap := (lookup "v1" "ConfigMap" $.Release.Namespace (printf "%s-%s" ( include "common.names.fullname" . ) "ports-configmap")).data }}
|
||||
{{- if $portsmap }}
|
||||
{{- /* configmap already exists, do not install again */ -}}
|
||||
{{- range $name, $value := $portsmap }}
|
||||
"{{ $name }}": "{{ $value }}"
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- /* configmap being set for first time */ -}}
|
||||
{{- range $index, $port := $chosenports }}
|
||||
{{- $nodenumber := (floor (div $index 2)) }}
|
||||
{{- if (eq $index 0) }}
|
||||
"{{ template "common.names.fullname" $ }}-sentinel": "{{ $port }}"
|
||||
{{- else if (eq $index 1) }}
|
||||
"{{ template "common.names.fullname" $ }}-redis": "{{ $port }}"
|
||||
{{- else if (eq (mod $index 2) 0) }}
|
||||
"{{ template "common.names.fullname" $ }}-node-{{ (sub $nodenumber 1) }}-sentinel": "{{ $port }}"
|
||||
{{- else if (eq (mod $index 2) 1) }}
|
||||
"{{ template "common.names.fullname" $ }}-node-{{ (sub $nodenumber 1) }}-redis": "{{ $port }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
103
pomerium/charts/redis/templates/sentinel/service.yaml
Normal file
103
pomerium/charts/redis/templates/sentinel/service.yaml
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
{{- if or .Release.IsUpgrade (ne .Values.sentinel.service.type "NodePort") .Values.sentinel.service.nodePorts.redis -}}
|
||||
{{- if and (eq .Values.architecture "replication") .Values.sentinel.enabled }}
|
||||
{{ $portsmap := (lookup "v1" "ConfigMap" $.Release.Namespace (printf "%s-%s" ( include "common.names.fullname" . ) "ports-configmap")).data }}
|
||||
|
||||
{{ $sentinelport := 0}}
|
||||
{{ $redisport := 0}}
|
||||
{{- if $portsmap }}
|
||||
{{ $sentinelport = index $portsmap (printf "%s-%s" (include "common.names.fullname" $) "sentinel") }}
|
||||
{{ $redisport = index $portsmap (printf "%s-%s" (include "common.names.fullname" $) "redis") }}
|
||||
{{- else }}
|
||||
{{- end }}
|
||||
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "common.names.fullname" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/component: node
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.sentinel.service.annotations .Values.commonAnnotations }}
|
||||
annotations:
|
||||
{{- if .Values.sentinel.service.annotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.sentinel.service.annotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.sentinel.service.type }}
|
||||
{{- if or (eq .Values.sentinel.service.type "LoadBalancer") (eq .Values.sentinel.service.type "NodePort") }}
|
||||
externalTrafficPolicy: {{ .Values.sentinel.service.externalTrafficPolicy | quote }}
|
||||
{{- end }}
|
||||
{{- if and (eq .Values.sentinel.service.type "LoadBalancer") (not (empty .Values.sentinel.service.loadBalancerIP)) }}
|
||||
loadBalancerIP: {{ .Values.sentinel.service.loadBalancerIP }}
|
||||
{{- end }}
|
||||
{{- if and (eq .Values.sentinel.service.type "LoadBalancer") (not (empty .Values.sentinel.service.loadBalancerSourceRanges)) }}
|
||||
loadBalancerSourceRanges: {{ .Values.sentinel.service.loadBalancerSourceRanges }}
|
||||
{{- end }}
|
||||
{{- if and .Values.sentinel.service.clusterIP (eq .Values.sentinel.service.type "ClusterIP") }}
|
||||
clusterIP: {{ .Values.sentinel.service.clusterIP }}
|
||||
{{- end }}
|
||||
{{- if .Values.sentinel.service.sessionAffinity }}
|
||||
sessionAffinity: {{ .Values.sentinel.service.sessionAffinity }}
|
||||
{{- end }}
|
||||
{{- if .Values.sentinel.service.sessionAffinityConfig }}
|
||||
sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.sentinel.service.sessionAffinityConfig "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: tcp-redis
|
||||
{{- if and (or (eq .Values.sentinel.service.type "NodePort") (eq .Values.sentinel.service.type "LoadBalancer")) .Values.sentinel.service.nodePorts.redis }}
|
||||
port: {{ .Values.sentinel.service.nodePorts.redis }}
|
||||
{{- else if eq .Values.sentinel.service.type "NodePort" }}
|
||||
port: {{ $redisport }}
|
||||
{{- else}}
|
||||
port: {{ .Values.sentinel.service.ports.redis }}
|
||||
{{- end }}
|
||||
targetPort: {{ .Values.replica.containerPorts.redis }}
|
||||
{{- if and (or (eq .Values.sentinel.service.type "NodePort") (eq .Values.sentinel.service.type "LoadBalancer")) .Values.sentinel.service.nodePorts.redis }}
|
||||
nodePort: {{ .Values.sentinel.service.nodePorts.redis }}
|
||||
{{- else if eq .Values.sentinel.service.type "ClusterIP" }}
|
||||
nodePort: null
|
||||
{{- else if eq .Values.sentinel.service.type "NodePort" }}
|
||||
nodePort: {{ $redisport }}
|
||||
{{- end }}
|
||||
- name: tcp-sentinel
|
||||
{{- if and (or (eq .Values.sentinel.service.type "NodePort") (eq .Values.sentinel.service.type "LoadBalancer")) .Values.sentinel.service.nodePorts.sentinel }}
|
||||
port: {{ .Values.sentinel.service.nodePorts.sentinel }}
|
||||
{{- else if eq .Values.sentinel.service.type "NodePort" }}
|
||||
port: {{ $sentinelport }}
|
||||
{{- else }}
|
||||
port: {{ .Values.sentinel.service.ports.sentinel }}
|
||||
{{- end }}
|
||||
targetPort: {{ .Values.sentinel.containerPorts.sentinel }}
|
||||
{{- if and (or (eq .Values.sentinel.service.type "NodePort") (eq .Values.sentinel.service.type "LoadBalancer")) .Values.sentinel.service.nodePorts.sentinel }}
|
||||
nodePort: {{ .Values.sentinel.service.nodePorts.sentinel }}
|
||||
{{- else if eq .Values.sentinel.service.type "ClusterIP" }}
|
||||
nodePort: null
|
||||
{{- else if eq .Values.sentinel.service.type "NodePort" }}
|
||||
nodePort: {{ $sentinelport }}
|
||||
{{- end }}
|
||||
{{- if eq .Values.sentinel.service.type "NodePort" }}
|
||||
- name: sentinel-internal
|
||||
nodePort: null
|
||||
port: {{ .Values.sentinel.containerPorts.sentinel }}
|
||||
protocol: TCP
|
||||
targetPort: {{ .Values.sentinel.containerPorts.sentinel }}
|
||||
- name: redis-internal
|
||||
nodePort: null
|
||||
port: {{ .Values.replica.containerPorts.redis }}
|
||||
protocol: TCP
|
||||
targetPort: {{ .Values.replica.containerPorts.redis }}
|
||||
{{- end }}
|
||||
{{- if .Values.sentinel.service.extraPorts }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.sentinel.service.extraPorts "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: node
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
688
pomerium/charts/redis/templates/sentinel/statefulset.yaml
Normal file
688
pomerium/charts/redis/templates/sentinel/statefulset.yaml
Normal file
|
|
@ -0,0 +1,688 @@
|
|||
{{- if or .Release.IsUpgrade (ne .Values.sentinel.service.type "NodePort") .Values.sentinel.service.nodePorts.redis -}}
|
||||
{{- if and (eq .Values.architecture "replication") .Values.sentinel.enabled }}
|
||||
apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ printf "%s-node" (include "common.names.fullname" .) }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/component: node
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
replicas: {{ .Values.replica.replicaCount }}
|
||||
selector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: node
|
||||
serviceName: {{ printf "%s-headless" (include "common.names.fullname" .) }}
|
||||
{{- if .Values.replica.updateStrategy }}
|
||||
updateStrategy: {{- toYaml .Values.replica.updateStrategy | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.podManagementPolicy }}
|
||||
podManagementPolicy: {{ .Values.replica.podManagementPolicy | quote }}
|
||||
{{- end }}
|
||||
template:
|
||||
metadata:
|
||||
labels: {{- include "common.labels.standard" . | nindent 8 }}
|
||||
app.kubernetes.io/component: node
|
||||
{{- if .Values.replica.podLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.replica.podLabels "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if and .Values.metrics.enabled .Values.metrics.podLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.metrics.podLabels "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
annotations:
|
||||
{{- if (include "redis.createConfigmap" .) }}
|
||||
checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
||||
{{- end }}
|
||||
checksum/health: {{ include (print $.Template.BasePath "/health-configmap.yaml") . | sha256sum }}
|
||||
checksum/scripts: {{ include (print $.Template.BasePath "/scripts-configmap.yaml") . | sha256sum }}
|
||||
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
|
||||
{{- if .Values.replica.podAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.replica.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if and .Values.metrics.enabled .Values.metrics.podAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.metrics.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- include "redis.imagePullSecrets" . | nindent 6 }}
|
||||
{{- if .Values.replica.hostAliases }}
|
||||
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.replica.hostAliases "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.podSecurityContext.enabled }}
|
||||
securityContext: {{- omit .Values.replica.podSecurityContext "enabled" | toYaml | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ template "redis.serviceAccountName" . }}
|
||||
{{- if .Values.replica.priorityClassName }}
|
||||
priorityClassName: {{ .Values.replica.priorityClassName | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.affinity }}
|
||||
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.replica.affinity "context" $) | nindent 8 }}
|
||||
{{- else }}
|
||||
affinity:
|
||||
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.replica.podAffinityPreset "component" "node" "context" $) | nindent 10 }}
|
||||
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.replica.podAntiAffinityPreset "component" "node" "context" $) | nindent 10 }}
|
||||
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.replica.nodeAffinityPreset.type "key" .Values.replica.nodeAffinityPreset.key "values" .Values.replica.nodeAffinityPreset.values) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.nodeSelector }}
|
||||
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.replica.nodeSelector "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.tolerations }}
|
||||
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.replica.tolerations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.topologySpreadConstraints }}
|
||||
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.replica.topologySpreadConstraints "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.shareProcessNamespace }}
|
||||
shareProcessNamespace: {{ .Values.replica.shareProcessNamespace }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.schedulerName }}
|
||||
schedulerName: {{ .Values.replica.schedulerName | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.dnsPolicy }}
|
||||
dnsPolicy: {{ .Values.replica.dnsPolicy }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.dnsConfig }}
|
||||
dnsConfig: {{- include "common.tplvalues.render" (dict "value" .Values.replica.dnsConfig "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
terminationGracePeriodSeconds: {{ .Values.sentinel.terminationGracePeriodSeconds }}
|
||||
containers:
|
||||
- name: redis
|
||||
image: {{ template "redis.image" . }}
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
||||
{{- if not .Values.diagnosticMode.enabled }}
|
||||
{{- if .Values.replica.lifecycleHooks }}
|
||||
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.replica.lifecycleHooks "context" $) | nindent 12 }}
|
||||
{{- else }}
|
||||
lifecycle:
|
||||
preStop:
|
||||
exec:
|
||||
command:
|
||||
- /bin/bash
|
||||
- -c
|
||||
- /opt/bitnami/scripts/start-scripts/prestop-redis.sh
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.containerSecurityContext.enabled }}
|
||||
securityContext: {{- omit .Values.replica.containerSecurityContext "enabled" | toYaml | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.diagnosticMode.enabled }}
|
||||
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
|
||||
{{- else if .Values.replica.command }}
|
||||
command: {{- include "common.tplvalues.render" (dict "value" .Values.replica.command "context" $) | nindent 12 }}
|
||||
{{- else }}
|
||||
command:
|
||||
- /bin/bash
|
||||
{{- end }}
|
||||
{{- if .Values.diagnosticMode.enabled }}
|
||||
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
|
||||
{{- else if .Values.replica.args }}
|
||||
args: {{- include "common.tplvalues.render" (dict "value" .Values.replica.args "context" $) | nindent 12 }}
|
||||
{{- else }}
|
||||
args:
|
||||
- -c
|
||||
- /opt/bitnami/scripts/start-scripts/start-node.sh
|
||||
{{- end }}
|
||||
env:
|
||||
- name: BITNAMI_DEBUG
|
||||
value: {{ ternary "true" "false" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }}
|
||||
- name: REDIS_MASTER_PORT_NUMBER
|
||||
value: {{ .Values.replica.containerPorts.redis | quote }}
|
||||
- name: ALLOW_EMPTY_PASSWORD
|
||||
value: {{ ternary "no" "yes" .Values.auth.enabled | quote }}
|
||||
{{- if .Values.auth.enabled }}
|
||||
{{- if .Values.auth.usePasswordFiles }}
|
||||
- name: REDIS_PASSWORD_FILE
|
||||
value: "/opt/bitnami/redis/secrets/redis-password"
|
||||
- name: REDIS_MASTER_PASSWORD_FILE
|
||||
value: "/opt/bitnami/redis/secrets/redis-password"
|
||||
{{- else }}
|
||||
- name: REDIS_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "redis.secretName" . }}
|
||||
key: {{ template "redis.secretPasswordKey" . }}
|
||||
- name: REDIS_MASTER_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "redis.secretName" . }}
|
||||
key: {{ template "redis.secretPasswordKey" . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
- name: REDIS_TLS_ENABLED
|
||||
value: {{ ternary "yes" "no" .Values.tls.enabled | quote }}
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: REDIS_TLS_PORT
|
||||
value: {{ .Values.replica.containerPorts.redis | quote }}
|
||||
- name: REDIS_TLS_AUTH_CLIENTS
|
||||
value: {{ ternary "yes" "no" .Values.tls.authClients | quote }}
|
||||
- name: REDIS_TLS_CERT_FILE
|
||||
value: {{ template "redis.tlsCert" . }}
|
||||
- name: REDIS_TLS_KEY_FILE
|
||||
value: {{ template "redis.tlsCertKey" . }}
|
||||
- name: REDIS_TLS_CA_FILE
|
||||
value: {{ template "redis.tlsCACert" . }}
|
||||
{{- if .Values.tls.dhParamsFilename }}
|
||||
- name: REDIS_TLS_DH_PARAMS_FILE
|
||||
value: {{ template "redis.tlsDHParams" . }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
- name: REDIS_PORT
|
||||
value: {{ .Values.replica.containerPorts.redis | quote }}
|
||||
{{- end }}
|
||||
- name: REDIS_DATA_DIR
|
||||
value: {{ .Values.replica.persistence.path }}
|
||||
{{- if .Values.replica.externalMaster.enabled }}
|
||||
- name: REDIS_EXTERNAL_MASTER_HOST
|
||||
value: {{ .Values.replica.externalMaster.host | quote }}
|
||||
- name: REDIS_EXTERNAL_MASTER_PORT
|
||||
value: {{ .Values.replica.externalMaster.port | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.extraEnvVars }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.replica.extraEnvVars "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.replica.extraEnvVarsCM .Values.replica.extraEnvVarsSecret }}
|
||||
envFrom:
|
||||
{{- if .Values.replica.extraEnvVarsCM }}
|
||||
- configMapRef:
|
||||
name: {{ .Values.replica.extraEnvVarsCM }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.extraEnvVarsSecret }}
|
||||
- secretRef:
|
||||
name: {{ .Values.replica.extraEnvVarsSecret }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: redis
|
||||
containerPort: {{ .Values.replica.containerPorts.redis }}
|
||||
{{- if not .Values.diagnosticMode.enabled }}
|
||||
{{- if .Values.replica.startupProbe.enabled }}
|
||||
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.replica.startupProbe "enabled") "context" $) | nindent 12 }}
|
||||
tcpSocket:
|
||||
port: redis
|
||||
{{- else if .Values.replica.customStartupProbe }}
|
||||
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.replica.customStartupProbe "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.livenessProbe.enabled }}
|
||||
livenessProbe:
|
||||
initialDelaySeconds: {{ .Values.replica.livenessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.replica.livenessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.replica.livenessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ .Values.replica.livenessProbe.successThreshold }}
|
||||
failureThreshold: {{ .Values.replica.livenessProbe.failureThreshold }}
|
||||
exec:
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- /health/ping_liveness_local.sh {{ .Values.replica.livenessProbe.timeoutSeconds }}
|
||||
{{- else if .Values.replica.customLivenessProbe }}
|
||||
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.replica.customLivenessProbe "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.readinessProbe.enabled }}
|
||||
readinessProbe:
|
||||
initialDelaySeconds: {{ .Values.replica.readinessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.replica.readinessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.replica.readinessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ .Values.replica.readinessProbe.successThreshold }}
|
||||
failureThreshold: {{ .Values.replica.readinessProbe.failureThreshold }}
|
||||
exec:
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- /health/ping_readiness_local.sh {{ .Values.replica.readinessProbe.timeoutSeconds }}
|
||||
{{- else if .Values.replica.customReadinessProbe }}
|
||||
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.replica.customReadinessProbe "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.resources }}
|
||||
resources: {{- toYaml .Values.replica.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: start-scripts
|
||||
mountPath: /opt/bitnami/scripts/start-scripts
|
||||
- name: health
|
||||
mountPath: /health
|
||||
{{- if .Values.sentinel.persistence.enabled }}
|
||||
- name: sentinel-data
|
||||
mountPath: /opt/bitnami/redis-sentinel/etc
|
||||
{{- end }}
|
||||
{{- if .Values.auth.usePasswordFiles }}
|
||||
- name: redis-password
|
||||
mountPath: /opt/bitnami/redis/secrets/
|
||||
{{- end }}
|
||||
- name: redis-data
|
||||
mountPath: {{ .Values.replica.persistence.path }}
|
||||
subPath: {{ .Values.replica.persistence.subPath }}
|
||||
- name: config
|
||||
mountPath: /opt/bitnami/redis/mounted-etc
|
||||
- name: redis-tmp-conf
|
||||
mountPath: /opt/bitnami/redis/etc
|
||||
- name: tmp
|
||||
mountPath: /tmp
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: redis-certificates
|
||||
mountPath: /opt/bitnami/redis/certs
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
{{- if .Values.replica.extraVolumeMounts }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.replica.extraVolumeMounts "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
- name: sentinel
|
||||
image: {{ template "redis.sentinel.image" . }}
|
||||
imagePullPolicy: {{ .Values.sentinel.image.pullPolicy | quote }}
|
||||
{{- if not .Values.diagnosticMode.enabled }}
|
||||
{{- if .Values.sentinel.lifecycleHooks }}
|
||||
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.sentinel.lifecycleHooks "context" $) | nindent 12 }}
|
||||
{{- else }}
|
||||
lifecycle:
|
||||
preStop:
|
||||
exec:
|
||||
command:
|
||||
- /bin/bash
|
||||
- -c
|
||||
- /opt/bitnami/scripts/start-scripts/prestop-sentinel.sh
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.sentinel.containerSecurityContext.enabled }}
|
||||
securityContext: {{- omit .Values.sentinel.containerSecurityContext "enabled" | toYaml | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.diagnosticMode.enabled }}
|
||||
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
|
||||
{{- else if .Values.sentinel.command }}
|
||||
command: {{- include "common.tplvalues.render" (dict "value" .Values.sentinel.command "context" $) | nindent 12 }}
|
||||
{{- else }}
|
||||
command:
|
||||
- /bin/bash
|
||||
{{- end }}
|
||||
{{- if .Values.diagnosticMode.enabled }}
|
||||
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
|
||||
{{- else if .Values.sentinel.args }}
|
||||
args: {{- include "common.tplvalues.render" (dict "value" .Values.sentinel.args "context" $) | nindent 12 }}
|
||||
{{- else }}
|
||||
args:
|
||||
- -c
|
||||
- /opt/bitnami/scripts/start-scripts/start-sentinel.sh
|
||||
{{- end }}
|
||||
env:
|
||||
- name: BITNAMI_DEBUG
|
||||
value: {{ ternary "true" "false" (or .Values.sentinel.image.debug .Values.diagnosticMode.enabled) | quote }}
|
||||
{{- if .Values.auth.enabled }}
|
||||
{{- if .Values.auth.usePasswordFiles }}
|
||||
- name: REDIS_PASSWORD_FILE
|
||||
value: "/opt/bitnami/redis/secrets/redis-password"
|
||||
{{- else }}
|
||||
- name: REDIS_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "redis.secretName" . }}
|
||||
key: {{ template "redis.secretPasswordKey" . }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
- name: ALLOW_EMPTY_PASSWORD
|
||||
value: "yes"
|
||||
{{- end }}
|
||||
- name: REDIS_SENTINEL_TLS_ENABLED
|
||||
value: {{ ternary "yes" "no" .Values.tls.enabled | quote }}
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: REDIS_SENTINEL_TLS_PORT_NUMBER
|
||||
value: {{ .Values.sentinel.containerPorts.sentinel | quote }}
|
||||
- name: REDIS_SENTINEL_TLS_AUTH_CLIENTS
|
||||
value: {{ ternary "yes" "no" .Values.tls.authClients | quote }}
|
||||
- name: REDIS_SENTINEL_TLS_CERT_FILE
|
||||
value: {{ template "redis.tlsCert" . }}
|
||||
- name: REDIS_SENTINEL_TLS_KEY_FILE
|
||||
value: {{ template "redis.tlsCertKey" . }}
|
||||
- name: REDIS_SENTINEL_TLS_CA_FILE
|
||||
value: {{ template "redis.tlsCACert" . }}
|
||||
{{- if .Values.tls.dhParamsFilename }}
|
||||
- name: REDIS_SENTINEL_TLS_DH_PARAMS_FILE
|
||||
value: {{ template "redis.tls.dhParamsFilename" . }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
- name: REDIS_SENTINEL_PORT
|
||||
value: {{ .Values.sentinel.containerPorts.sentinel | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.sentinel.externalMaster.enabled }}
|
||||
- name: REDIS_EXTERNAL_MASTER_HOST
|
||||
value: {{ .Values.sentinel.externalMaster.host | quote }}
|
||||
- name: REDIS_EXTERNAL_MASTER_PORT
|
||||
value: {{ .Values.sentinel.externalMaster.port | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.sentinel.extraEnvVars }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.sentinel.extraEnvVars "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.sentinel.extraEnvVarsCM .Values.sentinel.extraEnvVarsSecret }}
|
||||
envFrom:
|
||||
{{- if .Values.sentinel.extraEnvVarsCM }}
|
||||
- configMapRef:
|
||||
name: {{ .Values.sentinel.extraEnvVarsCM }}
|
||||
{{- end }}
|
||||
{{- if .Values.sentinel.extraEnvVarsSecret }}
|
||||
- secretRef:
|
||||
name: {{ .Values.sentinel.extraEnvVarsSecret }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: redis-sentinel
|
||||
containerPort: {{ .Values.sentinel.containerPorts.sentinel }}
|
||||
{{- if not .Values.diagnosticMode.enabled }}
|
||||
{{- if .Values.sentinel.startupProbe.enabled }}
|
||||
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.sentinel.startupProbe "enabled") "context" $) | nindent 12 }}
|
||||
tcpSocket:
|
||||
port: redis-sentinel
|
||||
{{- else if .Values.sentinel.customStartupProbe }}
|
||||
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.sentinel.customStartupProbe "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.sentinel.livenessProbe.enabled }}
|
||||
livenessProbe:
|
||||
initialDelaySeconds: {{ .Values.sentinel.livenessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.sentinel.livenessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.sentinel.livenessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ .Values.sentinel.livenessProbe.successThreshold }}
|
||||
failureThreshold: {{ .Values.sentinel.livenessProbe.failureThreshold }}
|
||||
exec:
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- /health/ping_sentinel.sh {{ .Values.sentinel.livenessProbe.timeoutSeconds }}
|
||||
{{- else if .Values.sentinel.customLivenessProbe }}
|
||||
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.sentinel.customLivenessProbe "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if not .Values.diagnosticMode.enabled }}
|
||||
{{- if .Values.sentinel.readinessProbe.enabled }}
|
||||
readinessProbe:
|
||||
initialDelaySeconds: {{ .Values.sentinel.readinessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.sentinel.readinessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.sentinel.readinessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ .Values.sentinel.readinessProbe.successThreshold }}
|
||||
failureThreshold: {{ .Values.sentinel.readinessProbe.failureThreshold }}
|
||||
exec:
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- /health/ping_sentinel.sh {{ .Values.sentinel.livenessProbe.timeoutSeconds }}
|
||||
{{- else if .Values.sentinel.customReadinessProbe }}
|
||||
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.sentinel.customReadinessProbe "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.sentinel.resources }}
|
||||
resources: {{- toYaml .Values.sentinel.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: start-scripts
|
||||
mountPath: /opt/bitnami/scripts/start-scripts
|
||||
- name: health
|
||||
mountPath: /health
|
||||
- name: sentinel-data
|
||||
mountPath: /opt/bitnami/redis-sentinel/etc
|
||||
{{- if .Values.auth.usePasswordFiles }}
|
||||
- name: redis-password
|
||||
mountPath: /opt/bitnami/redis/secrets/
|
||||
{{- end }}
|
||||
- name: redis-data
|
||||
mountPath: {{ .Values.replica.persistence.path }}
|
||||
subPath: {{ .Values.replica.persistence.subPath }}
|
||||
- name: config
|
||||
mountPath: /opt/bitnami/redis-sentinel/mounted-etc
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: redis-certificates
|
||||
mountPath: /opt/bitnami/redis/certs
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
{{- if .Values.sentinel.extraVolumeMounts }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.sentinel.extraVolumeMounts "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.enabled }}
|
||||
- name: metrics
|
||||
image: {{ template "redis.metrics.image" . }}
|
||||
imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }}
|
||||
{{- if .Values.metrics.containerSecurityContext.enabled }}
|
||||
securityContext: {{- omit .Values.metrics.containerSecurityContext "enabled" | toYaml | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.diagnosticMode.enabled }}
|
||||
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
|
||||
{{- else }}
|
||||
command:
|
||||
- /bin/bash
|
||||
- -c
|
||||
- |
|
||||
if [[ -f '/secrets/redis-password' ]]; then
|
||||
export REDIS_PASSWORD=$(cat /secrets/redis-password)
|
||||
fi
|
||||
redis_exporter{{- range $key, $value := .Values.metrics.extraArgs }} --{{ $key }}={{ $value }}{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.diagnosticMode.enabled }}
|
||||
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
env:
|
||||
- name: REDIS_ALIAS
|
||||
value: {{ template "common.names.fullname" . }}
|
||||
{{- if .Values.auth.enabled }}
|
||||
- name: REDIS_USER
|
||||
value: default
|
||||
{{- if (not .Values.auth.usePasswordFiles) }}
|
||||
- name: REDIS_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "redis.secretName" . }}
|
||||
key: {{ template "redis.secretPasswordKey" . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: REDIS_ADDR
|
||||
value: rediss://{{ .Values.metrics.redisTargetHost }}:{{ .Values.replica.containerPorts.redis }}
|
||||
{{- if .Values.tls.authClients }}
|
||||
- name: REDIS_EXPORTER_TLS_CLIENT_KEY_FILE
|
||||
value: {{ template "redis.tlsCertKey" . }}
|
||||
- name: REDIS_EXPORTER_TLS_CLIENT_CERT_FILE
|
||||
value: {{ template "redis.tlsCert" . }}
|
||||
{{- end }}
|
||||
- name: REDIS_EXPORTER_TLS_CA_CERT_FILE
|
||||
value: {{ template "redis.tlsCACert" . }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.extraEnvVars }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.metrics.extraEnvVars "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: metrics
|
||||
containerPort: 9121
|
||||
{{- if .Values.metrics.resources }}
|
||||
resources: {{- toYaml .Values.metrics.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
{{- if .Values.auth.usePasswordFiles }}
|
||||
- name: redis-password
|
||||
mountPath: /secrets/
|
||||
{{- end }}
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: redis-certificates
|
||||
mountPath: /opt/bitnami/redis/certs
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.extraVolumeMounts }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.metrics.extraVolumeMounts "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.sidecars }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.replica.sidecars "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- $needsVolumePermissions := and .Values.volumePermissions.enabled .Values.replica.persistence.enabled .Values.replica.podSecurityContext.enabled .Values.replica.containerSecurityContext.enabled }}
|
||||
{{- if or .Values.replica.initContainers $needsVolumePermissions .Values.sysctl.enabled }}
|
||||
initContainers:
|
||||
{{- if .Values.replica.initContainers }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.replica.initContainers "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $needsVolumePermissions }}
|
||||
- name: volume-permissions
|
||||
image: {{ include "redis.volumePermissions.image" . }}
|
||||
imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }}
|
||||
command:
|
||||
- /bin/bash
|
||||
- -ec
|
||||
- |
|
||||
{{- if eq ( toString ( .Values.volumePermissions.containerSecurityContext.runAsUser )) "auto" }}
|
||||
chown -R `id -u`:`id -G | cut -d " " -f2` {{ .Values.replica.persistence.path }}
|
||||
{{- else }}
|
||||
chown -R {{ .Values.replica.containerSecurityContext.runAsUser }}:{{ .Values.replica.podSecurityContext.fsGroup }} {{ .Values.replica.persistence.path }}
|
||||
{{- end }}
|
||||
{{- if eq ( toString ( .Values.volumePermissions.containerSecurityContext.runAsUser )) "auto" }}
|
||||
securityContext: {{- omit .Values.volumePermissions.containerSecurityContext "runAsUser" | toYaml | nindent 12 }}
|
||||
{{- else }}
|
||||
securityContext: {{- .Values.volumePermissions.containerSecurityContext | toYaml | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.volumePermissions.resources }}
|
||||
resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: redis-data
|
||||
mountPath: {{ .Values.replica.persistence.path }}
|
||||
subPath: {{ .Values.replica.persistence.subPath }}
|
||||
{{- end }}
|
||||
{{- if .Values.sysctl.enabled }}
|
||||
- name: init-sysctl
|
||||
image: {{ include "redis.sysctl.image" . }}
|
||||
imagePullPolicy: {{ default "" .Values.sysctl.image.pullPolicy | quote }}
|
||||
securityContext:
|
||||
privileged: true
|
||||
runAsUser: 0
|
||||
{{- if .Values.sysctl.command }}
|
||||
command: {{- include "common.tplvalues.render" (dict "value" .Values.sysctl.command "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.sysctl.resources }}
|
||||
resources: {{- toYaml .Values.sysctl.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.sysctl.mountHostSys }}
|
||||
volumeMounts:
|
||||
- name: host-sys
|
||||
mountPath: /host-sys
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: start-scripts
|
||||
configMap:
|
||||
name: {{ printf "%s-scripts" (include "common.names.fullname" .) }}
|
||||
defaultMode: 0755
|
||||
- name: health
|
||||
configMap:
|
||||
name: {{ printf "%s-health" (include "common.names.fullname" .) }}
|
||||
defaultMode: 0755
|
||||
{{- if .Values.auth.usePasswordFiles }}
|
||||
- name: redis-password
|
||||
secret:
|
||||
secretName: {{ template "redis.secretName" . }}
|
||||
items:
|
||||
- key: {{ template "redis.secretPasswordKey" . }}
|
||||
path: redis-password
|
||||
{{- end }}
|
||||
- name: config
|
||||
configMap:
|
||||
name: {{ include "redis.configmapName" . }}
|
||||
{{- if .Values.sysctl.mountHostSys }}
|
||||
- name: host-sys
|
||||
hostPath:
|
||||
path: /sys
|
||||
{{- end }}
|
||||
{{- if not .Values.sentinel.persistence.enabled }}
|
||||
- name: sentinel-data
|
||||
{{- if .Values.sentinel.persistence.medium }}
|
||||
emptyDir: {
|
||||
medium: {{ .Values.sentinel.persistence.medium | quote }}
|
||||
}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
- name: redis-tmp-conf
|
||||
{{- if .Values.replica.persistence.medium }}
|
||||
emptyDir: {
|
||||
medium: {{ .Values.replica.persistence.medium | quote }}
|
||||
}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
- name: tmp
|
||||
{{- if .Values.replica.persistence.medium }}
|
||||
emptyDir: {
|
||||
medium: {{ .Values.replica.persistence.medium | quote }}
|
||||
}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- if .Values.replica.extraVolumes }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.replica.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.extraVolumes }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.metrics.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.sentinel.extraVolumes }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.sentinel.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: redis-certificates
|
||||
secret:
|
||||
secretName: {{ include "redis.tlsSecretName" . }}
|
||||
defaultMode: 256
|
||||
{{- end }}
|
||||
{{- if not .Values.replica.persistence.enabled }}
|
||||
- name: redis-data
|
||||
{{- if .Values.replica.persistence.medium }}
|
||||
emptyDir: {
|
||||
medium: {{ .Values.replica.persistence.medium | quote }}
|
||||
}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: redis-data
|
||||
labels: {{- include "common.labels.matchLabels" . | nindent 10 }}
|
||||
app.kubernetes.io/component: node
|
||||
{{- if .Values.replica.persistence.annotations }}
|
||||
annotations: {{- toYaml .Values.replica.persistence.annotations | nindent 10 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
{{- range .Values.replica.persistence.accessModes }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.replica.persistence.size | quote }}
|
||||
{{- if .Values.replica.persistence.selector }}
|
||||
selector: {{- include "common.tplvalues.render" ( dict "value" .Values.replica.persistence.selector "context" $) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- include "common.storage.class" (dict "persistence" .Values.replica.persistence "global" .Values.global) | nindent 8 }}
|
||||
{{- if .Values.sentinel.persistence.enabled }}
|
||||
- metadata:
|
||||
name: sentinel-data
|
||||
labels: {{- include "common.labels.matchLabels" . | nindent 10 }}
|
||||
app.kubernetes.io/component: node
|
||||
{{- if .Values.sentinel.persistence.annotations }}
|
||||
annotations: {{- toYaml .Values.sentinel.persistence.annotations | nindent 10 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
{{- range .Values.sentinel.persistence.accessModes }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.sentinel.persistence.size | quote }}
|
||||
{{- if .Values.sentinel.persistence.selector }}
|
||||
selector: {{- include "common.tplvalues.render" ( dict "value" .Values.sentinel.persistence.selector "context" $) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if .Values.sentinel.persistence.dataSource }}
|
||||
dataSource: {{- include "common.tplvalues.render" (dict "value" .Values.sentinel.persistence.dataSource "context" $) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- include "common.storage.class" (dict "persistence" .Values.sentinel.persistence "global" .Values.global) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
21
pomerium/charts/redis/templates/serviceaccount.yaml
Normal file
21
pomerium/charts/redis/templates/serviceaccount.yaml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{{- if .Values.serviceAccount.create }}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
|
||||
metadata:
|
||||
name: {{ template "redis.serviceAccountName" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.commonAnnotations .Values.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- if or .Values.commonAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.serviceAccount.annotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.serviceAccount.annotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
41
pomerium/charts/redis/templates/servicemonitor.yaml
Normal file
41
pomerium/charts/redis/templates/servicemonitor.yaml
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: {{ template "common.names.fullname" . }}
|
||||
namespace: {{ default .Release.Namespace .Values.metrics.serviceMonitor.namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.metrics.serviceMonitor.additionalLabels }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.additionalLabels "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
endpoints:
|
||||
- port: http-metrics
|
||||
{{- if .Values.metrics.serviceMonitor.interval }}
|
||||
interval: {{ .Values.metrics.serviceMonitor.interval }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.serviceMonitor.honorLabels }}
|
||||
honorLabels: {{ .Values.metrics.serviceMonitor.honorLabels }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.serviceMonitor.relabellings }}
|
||||
relabelings: {{- toYaml .Values.metrics.serviceMonitor.relabellings | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.serviceMonitor.metricRelabelings }}
|
||||
metricRelabelings: {{- toYaml .Values.metrics.serviceMonitor.metricRelabelings | nindent 6 }}
|
||||
{{- end }}
|
||||
namespaceSelector:
|
||||
matchNames:
|
||||
- {{ .Release.Namespace }}
|
||||
selector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: metrics
|
||||
{{- end }}
|
||||
29
pomerium/charts/redis/templates/tls-secret.yaml
Normal file
29
pomerium/charts/redis/templates/tls-secret.yaml
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{{- if (include "redis.createTlsSecret" .) }}
|
||||
{{- $secretName := printf "%s-crt" (include "common.names.fullname" .) }}
|
||||
{{- $existingCerts := (lookup "v1" "Secret" .Release.Namespace $secretName).data | default dict }}
|
||||
{{- $ca := genCA "redis-ca" 365 }}
|
||||
{{- $releaseNamespace := .Release.Namespace }}
|
||||
{{- $clusterDomain := .Values.clusterDomain }}
|
||||
{{- $fullname := include "common.names.fullname" . }}
|
||||
{{- $serviceName := include "common.names.fullname" . }}
|
||||
{{- $headlessServiceName := printf "%s-headless" (include "common.names.fullname" .) }}
|
||||
{{- $altNames := list (printf "*.%s.%s.svc.%s" $serviceName $releaseNamespace $clusterDomain) (printf "%s.%s.svc.%s" $serviceName $releaseNamespace $clusterDomain) (printf "*.%s.%s.svc.%s" $headlessServiceName $releaseNamespace $clusterDomain) (printf "%s.%s.svc.%s" $headlessServiceName $releaseNamespace $clusterDomain) "127.0.0.1" "localhost" $fullname }}
|
||||
{{- $crt := genSignedCert $fullname nil $altNames 365 $ca }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ $secretName }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
type: kubernetes.io/tls
|
||||
data:
|
||||
ca.crt: {{ (get $existingCerts "ca.crt") | default ($ca.Cert | b64enc | quote ) }}
|
||||
tls.crt: {{ (get $existingCerts "tls.crt") | default ($crt.Cert | b64enc | quote) }}
|
||||
tls.key: {{ (get $existingCerts "tls.key") | default ($crt.Key | b64enc | quote) }}
|
||||
{{- end }}
|
||||
156
pomerium/charts/redis/values.schema.json
Normal file
156
pomerium/charts/redis/values.schema.json
Normal file
|
|
@ -0,0 +1,156 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/schema#",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"architecture": {
|
||||
"type": "string",
|
||||
"title": "Redis architecture",
|
||||
"form": true,
|
||||
"description": "Allowed values: `standalone` or `replication`",
|
||||
"enum": ["standalone", "replication"]
|
||||
},
|
||||
"auth": {
|
||||
"type": "object",
|
||||
"title": "Authentication configuration",
|
||||
"form": true,
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"form": true,
|
||||
"title": "Use password authentication"
|
||||
},
|
||||
"password": {
|
||||
"type": "string",
|
||||
"title": "Redis password",
|
||||
"form": true,
|
||||
"description": "Defaults to a random 10-character alphanumeric string if not set",
|
||||
"hidden": {
|
||||
"value": false,
|
||||
"path": "auth/enabled"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"master": {
|
||||
"type": "object",
|
||||
"title": "Master replicas settings",
|
||||
"form": true,
|
||||
"properties": {
|
||||
"kind": {
|
||||
"type": "string",
|
||||
"title": "Workload Kind",
|
||||
"form": true,
|
||||
"description": "Allowed values: `Deployment` or `StatefulSet`",
|
||||
"enum": ["Deployment", "StatefulSet"]
|
||||
},
|
||||
"persistence": {
|
||||
"type": "object",
|
||||
"title": "Persistence for master replicas",
|
||||
"form": true,
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"form": true,
|
||||
"title": "Enable persistence",
|
||||
"description": "Enable persistence using Persistent Volume Claims"
|
||||
},
|
||||
"size": {
|
||||
"type": "string",
|
||||
"title": "Persistent Volume Size",
|
||||
"form": true,
|
||||
"render": "slider",
|
||||
"sliderMin": 1,
|
||||
"sliderMax": 100,
|
||||
"sliderUnit": "Gi",
|
||||
"hidden": {
|
||||
"value": false,
|
||||
"path": "master/persistence/enabled"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"replica": {
|
||||
"type": "object",
|
||||
"title": "Redis replicas settings",
|
||||
"form": true,
|
||||
"hidden": {
|
||||
"value": "standalone",
|
||||
"path": "architecture"
|
||||
},
|
||||
"properties": {
|
||||
"replicaCount": {
|
||||
"type": "integer",
|
||||
"form": true,
|
||||
"title": "Number of Redis replicas"
|
||||
},
|
||||
"persistence": {
|
||||
"type": "object",
|
||||
"title": "Persistence for Redis replicas",
|
||||
"form": true,
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"form": true,
|
||||
"title": "Enable persistence",
|
||||
"description": "Enable persistence using Persistent Volume Claims"
|
||||
},
|
||||
"size": {
|
||||
"type": "string",
|
||||
"title": "Persistent Volume Size",
|
||||
"form": true,
|
||||
"render": "slider",
|
||||
"sliderMin": 1,
|
||||
"sliderMax": 100,
|
||||
"sliderUnit": "Gi",
|
||||
"hidden": {
|
||||
"value": false,
|
||||
"path": "replica/persistence/enabled"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"volumePermissions": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"form": true,
|
||||
"title": "Enable Init Containers",
|
||||
"description": "Use an init container to set required folder permissions on the data volume before mounting it in the final destination"
|
||||
}
|
||||
}
|
||||
},
|
||||
"metrics": {
|
||||
"type": "object",
|
||||
"form": true,
|
||||
"title": "Prometheus metrics details",
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"title": "Create Prometheus metrics exporter",
|
||||
"description": "Create a side-car container to expose Prometheus metrics",
|
||||
"form": true
|
||||
},
|
||||
"serviceMonitor": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"title": "Create Prometheus Operator ServiceMonitor",
|
||||
"description": "Create a ServiceMonitor to track metrics using Prometheus Operator",
|
||||
"form": true,
|
||||
"hidden": {
|
||||
"value": false,
|
||||
"path": "metrics/enabled"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1621
pomerium/charts/redis/values.yaml
Normal file
1621
pomerium/charts/redis/values.yaml
Normal file
File diff suppressed because it is too large
Load diff
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue