当我尝试在AWS EKS中应用新的服务部署yaml时,它不会从以前的构建/部署中删除旧的负载平衡器
apiVersion: v1
kind: Service
metadata:
# The name must be equal to KubernetesConnectionConfiguration.serviceName
name: ignite-service
# The name must be equal to KubernetesConnectionConfiguration.namespace
namespace: ignite
annotations:
service.beta.kubernetes.io/aws-load-balancer-internal: "true"
service.beta.kubernetes.io/aws-load-balancer-type: nlb
labels:
app: ignite
spec:
type: LoadBalancer
ports:
- name: rest
port: 8080
targetPort: 8080
- name: thinclients
port: 10800
targetPort: 10800
# Optional - remove 'sessionAffinity' property if the cluster
# and applications are deployed within Kubernetes
# sessionAffinity: ClientIP
selector:
# Must be equal to the label set for pods.
app: ignite
status:
loadBalancer: {}
我有一种情况,我部署了一个ELB,但这次是一个NLB,但它不会破坏之前的ELB。
是否有办法在应用k8s清单时,删除AWS上的旧负载平衡器?
不确定使用什么来创建资源helm资源,或kubectl但是考虑kubectl截至目前
你可以使用
kubectl replace --force -f <service-filename>.yaml