In gke environment I have a cluster with three pods on which a docker image with ubuntu and wordpress is scaled. In the infrastructure, the CPU usage is regular while the memory constantly increases until it becomes saturated in a week, around 10gb. I have 64 gigabytes of ram available and I tuned the os (cache management, logrotation management, various php.ini checks) and verified anomalous consumption by the application, but there seems to be no remedy. I don’t know where to turn my head anymore. Can you help me? Thank you
Cluster information:
Kubernetes version: 1.20.8-gke.900
Cloud being used: Google Cloud
Installation method: GKE
Host OS: ?
CNI and version: ?
CRI and version: ?
YAML
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: “8”
kubectl.kubernetes.io/last-applied-configuration: |
{“apiVersion”:“apps/v1”,“kind”:“Deployment”,“metadata”:{“annotations”:{},“labels”:{“run”:“appprod”},“name”:“appprod”,“namespace”:“default”},“spec”:{“replicas”:3,“selector”:{“matchLabels”:{“run”:“appprod”}},“template”:{“metadata”:{“labels”:{“run”:“appprod”}},“spec”:{“containers”:[{“env”:[{“name”:“APP_ENGINE_DEV_DBHOSTNAME”,“value”:“12.50.50.2:3356”},{“name”:“APP_ENGINE_DEV_DBPASSWORD”,“valueFrom”:{“secretKeyRef”:{“key”:“password”,“name”:“no-secret”}}},{“name”:“APP_ENGINE_DEV_DBUSER”,“valueFrom”:{“secretKeyRef”:{“key”:“username”,“name”:“no-secret”}}},{“name”:“APP_ENGINE_DEV_MODE”,“value”:“true”},{“name”:“APP_ENGINE_DEV_URL”,“value”:“https:/test.com”},{“name”:“GIT_BRANCH”,“value”:“app_m2_ril_33_08-04-2021”},{“name”:“TIPO_INSTALLAZIONE”,“value”:“2”}],“image”:“eu.gcr.io/project1/tw_prod:1.0.8_gke_secured",“livenessProbe”:{“failureThreshold”:20,“httpGet”:{“path”:"/servizi/",“port”:80,“scheme”:“HTTP”},“initialDelaySeconds”:60,“periodSeconds”:20,“successThreshold”:1,“timeoutSeconds”:5},“name”:“appprod”,“readinessProbe”:{“failureThreshold”:20,“httpGet”:{“path”:"/servizi/",“port”:80,“scheme”:“HTTP”},“initialDelaySeconds”:60,“periodSeconds”:20,“successThreshold”:1,“timeoutSeconds”:5},“volumeMounts”:[{“mountPath”:"/app/wp-content/uploads",“name”:“mypvc”}]}],“volumes”:[{“name”:“mypvc”,“persistentVolumeClaim”:{“claimName”:"nfs-server-application”}}]}}}}
creationTimestamp: “2021-03-30T19:18:27Z”
generation: 38
labels:
run: appprod
managedFields:
- apiVersion: apps/v1
fieldsType: FieldsV1
fieldsV1:
f:metadata:
f:annotations:
.: {}
f:kubectl.kubernetes.io/last-applied-configuration: {}
f:labels:
.: {}
f:run: {}
f:spec:
f:progressDeadlineSeconds: {}
f:revisionHistoryLimit: {}
f:selector: {}
f:strategy:
f:rollingUpdate:
.: {}
f:maxSurge: {}
f:maxUnavailable: {}
f:type: {}
f:template:
f:metadata:
f:labels:
.: {}
f:run: {}
f:spec:
f:containers:
k:{“name”:“appprod”}:
.: {}
f:env:
.: {}
k:{“name”:“APP_ENGINE_DEV_DBHOSTNAME”}:
.: {}
f:name: {}
f:value: {}
k:{“name”:“APP_ENGINE_DEV_DBPASSWORD”}:
.: {}
f:name: {}
f:valueFrom:
.: {}
f:secretKeyRef:
.: {}
f:key: {}
f:name: {}
k:{“name”:“APP_ENGINE_DEV_DBUSER”}:
.: {}
f:name: {}
f:valueFrom:
.: {}
f:secretKeyRef:
.: {}
f:key: {}
f:name: {}
k:{“name”:“APP_ENGINE_DEV_MODE”}:
.: {}
f:name: {}
f:value: {}
k:{“name”:“APP_ENGINE_DEV_URL”}:
.: {}
f:name: {}
f:value: {}
k:{“name”:“GIT_BRANCH”}:
.: {}
f:name: {}
k:{“name”:“TIPO_INSTALLAZIONE”}:
.: {}
f:name: {}
f:value: {}
f:imagePullPolicy: {}
f:livenessProbe:
.: {}
f:failureThreshold: {}
f:httpGet:
.: {}
f:path: {}
f:port: {}
f:scheme: {}
f:initialDelaySeconds: {}
f:periodSeconds: {}
f:successThreshold: {}
f:timeoutSeconds: {}
f:name: {}
f:readinessProbe:
.: {}
f:failureThreshold: {}
f:httpGet:
.: {}
f:path: {}
f:port: {}
f:scheme: {}
f:initialDelaySeconds: {}
f:periodSeconds: {}
f:successThreshold: {}
f:timeoutSeconds: {}
f:resources: {}
f:terminationMessagePath: {}
f:terminationMessagePolicy: {}
f:volumeMounts:
.: {}
k:{“mountPath”:"/app/wp-content/uploads"}:
.: {}
f:mountPath: {}
f:name: {}
f:dnsPolicy: {}
f:restartPolicy: {}
f:schedulerName: {}
f:securityContext: {}
f:terminationGracePeriodSeconds: {}
f:volumes:
.: {}
k:{“name”:“mypvc”}:
.: {}
f:name: {}
f:persistentVolumeClaim:
.: {}
f:claimName: {}
manager: kubectl-client-side-apply
operation: Update
time: “2021-04-08T18:50:28Z” - apiVersion: apps/v1
fieldsType: FieldsV1
fieldsV1:
f:spec:
f:replicas: {}
f:template:
f:spec:
f:containers:
k:{“name”:“appprod”}:
f:env:
k:{“name”:“GIT_BRANCH”}:
f:value: {}
f:image: {}
manager: GoogleCloudConsole
operation: Update
time: “2021-05-11T18:32:51Z” - apiVersion: apps/v1
fieldsType: FieldsV1
fieldsV1:
f:metadata:
f:annotations:
f:deployment.kubernetes.io/revision: {}
f:status:
f:availableReplicas: {}
f:conditions:
.: {}
k:{“type”:“Available”}:
.: {}
f:lastTransitionTime: {}
f:lastUpdateTime: {}
f:message: {}
f:reason: {}
f:status: {}
f:type: {}
k:{“type”:“Progressing”}:
.: {}
f:lastTransitionTime: {}
f:lastUpdateTime: {}
f:message: {}
f:reason: {}
f:status: {}
f:type: {}
f:observedGeneration: {}
f:readyReplicas: {}
f:replicas: {}
f:updatedReplicas: {}
manager: kube-controller-manager
operation: Update
time: “2021-08-05T04:56:15Z”
name: appprod
namespace: default
resourceVersion: “140885760”
uid: 108aebfc-2964-46f0-85ad-5cdde5651c4f
spec:
progressDeadlineSeconds: 600
replicas: 3
revisionHistoryLimit: 10
selector:
matchLabels:
run: appprod
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
creationTimestamp: null
labels:
run: appprod
spec:
containers:- env:
- name: APP_ENGINE_DEV_DBHOSTNAME
value: 10.62.161.10:3306 - name: APP_ENGINE_DEV_DBPASSWORD
valueFrom:
secretKeyRef:
key: password
name: no-secret - name: APP_ENGINE_DEV_DBUSER
valueFrom:
secretKeyRef:
key: username
name: no-secret - name: APP_ENGINE_DEV_MODE
value: “true” - name: APP_ENGINE_DEV_URL
value: https:/test.com - name: GIT_BRANCH
value: feature/fix_error_logs_05_2021 - name: TIPO_INSTALLAZIONE
value: “2”
image: eu.gcr.io/project1/tw_prod:1.0.9_gke_secured_hardening_log
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 20
httpGet:
path: /servizi/
port: 80
scheme: HTTP
initialDelaySeconds: 60
periodSeconds: 20
successThreshold: 1
timeoutSeconds: 5
name: appprod
readinessProbe:
failureThreshold: 20
httpGet:
path: /servizi/
port: 80
scheme: HTTP
initialDelaySeconds: 60
periodSeconds: 20
successThreshold: 1
timeoutSeconds: 5
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts: - mountPath: /app/wp-content/uploads
name: mypvc
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- name: APP_ENGINE_DEV_DBHOSTNAME
- name: mypvc
persistentVolumeClaim:
claimName: nfs-server-application
status:
availableReplicas: 3
conditions:
- env:
- lastTransitionTime: “2021-05-11T18:46:04Z”
lastUpdateTime: “2021-07-15T17:02:39Z”
message: ReplicaSet “app-6c8864897c” has successfully progressed.
reason: NewReplicaSetAvailable
status: “True”
type: Progressing - lastTransitionTime: “2021-08-05T04:56:15Z”
lastUpdateTime: “2021-08-05T04:56:15Z”
message: Deployment has minimum availability.
reason: MinimumReplicasAvailable
status: “True”
type: Available
observedGeneration: 38
readyReplicas: 3
replicas: 3
updatedReplicas: 3