kubernetes/unified/autoscaler-pkg/scaler/scaler.yaml (52 lines of code) (raw):
# Copyright 2024 Google LLC
#
# 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.
apiVersion: batch/v1
kind: CronJob
metadata:
name: scaler
namespace: memorystore-cluster-autoscaler # kpt-set: ${namespace}
spec:
concurrencyPolicy: Forbid
schedule: "*/2 * * * *"
jobTemplate:
spec:
template:
metadata:
labels:
app: scaler
otel-submitter: "true"
spec:
containers:
- name: scaler
image: scaler-image # kpt-set: ${scaler_image}
resources:
requests:
memory: "256Mi"
cpu: "250m"
limits:
memory: "256Mi"
env:
- name: K8S_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: OTEL_COLLECTOR_URL
value: "http://otel-collector:4317/"
- name: OTEL_IS_LONG_RUNNING_PROCESS
value: "false"
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
capabilities:
drop:
- all
volumeMounts:
- name: config-volume
mountPath: /etc/autoscaler-config
volumes:
- name: config-volume
configMap:
name: autoscaler-config
nodeSelector:
iam.gke.io/gke-metadata-server-enabled: "true"
restartPolicy: Never
serviceAccountName: scaler-sa