samples/todolist/src/config/45-redis.k8s.yaml
##
# Copyright © 2020, The Gust Framework Authors. All rights reserved.
#
# The Gust/Elide framework and tools, and all associated source or object computer code, except where otherwise noted,
# are licensed under the Zero Prosperity license, which is enclosed in this repository, in the file LICENSE.txt. Use of
# this code in object or source form requires and implies consent and agreement to that license in principle and
# practice. Source or object code not listing this header, or unless specified otherwise, remain the property of
# Elide LLC and its suppliers, if any. The intellectual and technical concepts contained herein are proprietary to
# Elide LLC and its suppliers and may be covered by U.S. and Foreign Patents, or patents in process, and are protected
# by trade secret and copyright law. Dissemination of this information, or reproduction of this material, in any form,
# is strictly forbidden except in adherence with assigned license requirements.
##
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: redis-hpa
namespace: todolist
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: redis
minReplicas: 1
maxReplicas: 3
targetCPUUtilizationPercentage: 50
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis
namespace: todolist
labels:
app: todolist
role: cache
environment: production
spec:
# -- Replication ----------------------------------------------------------- #
replicas: 1
revisionHistoryLimit: 2
selector:
matchLabels:
app: todolist
role: cache
environment: production
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 3
maxUnavailable: "30%"
# -- Timeouts -------------------------------------------------------------- #
minReadySeconds: 10
progressDeadlineSeconds: 300
template:
metadata:
labels:
app: todolist
role: cache
environment: production
spec:
# -- Scheduling -------------------------------------------------------- #
tolerations:
- key: role
operator: Equal
value: app
- key: sandbox.gke.io/runtime
operator: Equal
value: gvisor
# -- Networking --------------------------------------------------------- #
dnsPolicy: ClusterFirst
# -- Placement ---------------------------------------------------------- #
affinity:
# Don't schedule near other fcache pods.
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: name
operator: In
values:
- fcache
topologyKey: kubernetes.io/hostname
# -- Containers --------------------------------------------------------- #
containers:
# Fcache: Redis
- name: redis
image: redis:5.0.5-alpine3.10
ports:
- containerPort: 6379
name: tcp-fcache
resources:
requests:
cpu: "0.2"
memory: "256Mi"
limits:
cpu: "0.4"
memory: "1G"
env:
- name: K9_NAMESPACE
value: production
readinessProbe:
initialDelaySeconds: 10
successThreshold: 1
timeoutSeconds: 2
tcpSocket:
port: 6379
livenessProbe:
initialDelaySeconds: 30
periodSeconds: 5
timeoutSeconds: 1
tcpSocket:
port: 6379