From 062c7153c6883bd8f8175a082e937c66deff1979 Mon Sep 17 00:00:00 2001 From: Seth Foster Date: Thu, 5 Oct 2023 14:20:10 -0400 Subject: [PATCH] Use deployment instead of statefulset When pod loses connection with k8s api server, a statefulset can take a while (5 minutes) before it is rescheduled. Deployments quicker turnaround in this situation, which should help mesh stability. Signed-off-by: Seth Foster --- roles/mesh_ingress/tasks/main.yml | 2 +- .../templates/{statefulset.yml.j2 => deployment.yml.j2} | 2 +- roles/mesh_ingress/templates/service.yml.j2 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename roles/mesh_ingress/templates/{statefulset.yml.j2 => deployment.yml.j2} (99%) diff --git a/roles/mesh_ingress/tasks/main.yml b/roles/mesh_ingress/tasks/main.yml index 43b3e532..c7f26e5b 100644 --- a/roles/mesh_ingress/tasks/main.yml +++ b/roles/mesh_ingress/tasks/main.yml @@ -64,7 +64,7 @@ - service_account - receptor_conf.configmap - service - - statefulset + - deployment - name: Get the current resource task pod information. k8s_info: diff --git a/roles/mesh_ingress/templates/statefulset.yml.j2 b/roles/mesh_ingress/templates/deployment.yml.j2 similarity index 99% rename from roles/mesh_ingress/templates/statefulset.yml.j2 rename to roles/mesh_ingress/templates/deployment.yml.j2 index 98bf02bc..e98c4ff7 100644 --- a/roles/mesh_ingress/templates/statefulset.yml.j2 +++ b/roles/mesh_ingress/templates/deployment.yml.j2 @@ -1,5 +1,5 @@ apiVersion: apps/v1 -kind: StatefulSet +kind: Deployment metadata: name: {{ ansible_operator_meta.name }} namespace: {{ ansible_operator_meta.namespace }} diff --git a/roles/mesh_ingress/templates/service.yml.j2 b/roles/mesh_ingress/templates/service.yml.j2 index f658308f..4b432568 100644 --- a/roles/mesh_ingress/templates/service.yml.j2 +++ b/roles/mesh_ingress/templates/service.yml.j2 @@ -11,4 +11,4 @@ spec: port: 27199 targetPort: 27199 selector: - statefulset.kubernetes.io/pod-name: {{ ansible_operator_meta.name }}-0 + app.kubernetes.io/name: {{ ansible_operator_meta.name }}