text stringlengths 0 37.6k |
|---|
# HorizontalPodAutoscaler v2 — CPU + Memory metrics |
apiVersion: autoscaling/v2 |
kind: HorizontalPodAutoscaler |
metadata: |
name: php-apache-hpa |
namespace: default |
spec: |
scaleTargetRef: |
apiVersion: apps/v1 |
kind: Deployment |
name: php-apache |
minReplicas: 1 |
maxReplicas: 10 |
metrics: |
- type: Resource |
resource: |
name: cpu |
target: |
type: Utilization |
averageUtilization: 50 |
- type: Resource |
resource: |
name: memory |
target: |
type: AverageValue |
averageValue: 200Mi |
behavior: |
scaleDown: |
stabilizationWindowSeconds: 300 |
policies: |
- type: Percent |
value: 100 |
periodSeconds: 15 |
scaleUp: |
stabilizationWindowSeconds: 0 |
policies: |
- type: Percent |
value: 100 |
periodSeconds: 15 |
- type: Pods |
value: 4 |
periodSeconds: 15 |
selectPolicy: Max |
<|endoftext|> |
# StatefulSet — Kafka cluster com PVC e headless service |
apiVersion: apps/v1 |
kind: StatefulSet |
metadata: |
name: kafka |
namespace: kafka |
spec: |
serviceName: kafka-headless |
replicas: 3 |
selector: |
matchLabels: |
app: kafka |
template: |
metadata: |
labels: |
app: kafka |
spec: |
terminationGracePeriodSeconds: 30 |
containers: |
- name: kafka |
image: confluentinc/cp-kafka:7.4.0 |
ports: |
- containerPort: 9092 |
name: kafka |
- containerPort: 9093 |
name: controller |
env: |
- name: KAFKA_BROKER_ID |
valueFrom: |
fieldRef: |
fieldPath: metadata.name |
- name: KAFKA_ZOOKEEPER_CONNECT |
value: "zookeeper:2181" |
resources: |
requests: |
memory: "512Mi" |
cpu: "250m" |
limits: |
memory: "1Gi" |
cpu: "500m" |
volumeMounts: |
- name: kafka-data |
mountPath: /var/lib/kafka/data |
volumeClaimTemplates: |
- metadata: |
name: kafka-data |
spec: |
accessModes: ["ReadWriteOnce"] |
storageClassName: standard |
resources: |
requests: |
storage: 10Gi |
<|endoftext|> |
# StatefulSet — PostgreSQL com PVC |
apiVersion: apps/v1 |
kind: StatefulSet |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.