Skip to content

Commit

Permalink
修复无法 watch configmaps 和 patch 失败问题 (#516)
Browse files Browse the repository at this point in the history
Co-authored-by: Gitlayzer <18037803502@163.com>
  • Loading branch information
caoyingjunz and gitlayzer authored Dec 5, 2024
1 parent fc81235 commit cf71640
Showing 1 changed file with 52 additions and 23 deletions.
75 changes: 52 additions & 23 deletions ansible/roles/kubernetes/templates/pixiu-autoscaler.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,23 @@ kind: ClusterRole
metadata:
name: pixiu-autoscaler
rules:
- apiGroups:
- "*"
resources:
- horizontalpodautoscalers
- deployments
- events
- endpoints
- leases
verbs:
- get
- watch
- create
- delete
- update
- list
- apiGroups:
- "*"
resources:
- horizontalpodautoscalers
- deployments
- events
- endpoints
- leases
- configmaps
verbs:
- get
- watch
- create
- delete
- update
- list
- patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand All @@ -42,10 +44,10 @@ subjects:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
pixiu.hpa.controller: pixiu-autoscaler
name: pixiu-autoscaler-controller
namespace: pixiu-system
labels:
pixiu.hpa.controller: pixiu-autoscaler
spec:
replicas: 1
selector:
Expand All @@ -56,10 +58,37 @@ spec:
labels:
pixiu.hpa.controller: pixiu-autoscaler
spec:
containers:
- image: harbor.cloud.pixiuio.com/pixiuio/pixiu-autoscaler-controller:latest
command:
- pixiu-autoscaler-controller
imagePullPolicy: IfNotPresent
name: pixiu-autoscaler-controller
serviceAccountName: pixiu-autoscaler
affinity:
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
topologyKey: "kubernetes.io/hostname"
labelSelector:
matchExpressions:
- key: pixiu.hpa.controller
operator: In
values:
- pixiu-autoscaler
containers:
- name: pixiu-autoscaler-controller
image: harbor.cloud.pixiuio.com/pixiuio/pixiu-autoscaler-controller:latest
imagePullPolicy: IfNotPresent
command:
- pixiu-autoscaler-controller
resources:
requests:
cpu: 100m
memory: 90Mi
livenessProbe:
failureThreshold: 8
httpGet:
host: 127.0.0.1
path: /healthz
port: 10256
scheme: HTTP
initialDelaySeconds: 15
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 15

0 comments on commit cf71640

Please sign in to comment.