diff --git a/config/all.yaml b/config/all.yaml index 33ba664..b14ccbf 100644 --- a/config/all.yaml +++ b/config/all.yaml @@ -63,7 +63,7 @@ spec: apiVersion: v1 kind: ServiceAccount metadata: - name: webhook + name: kcl-webhook namespace: default --- apiVersion: rbac.authorization.k8s.io/v1 @@ -113,14 +113,14 @@ rules: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: webhook-rolebinding + name: kcl-webhook-rolebinding roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: webhook-role + name: kcl-webhook-role subjects: - kind: ServiceAccount - name: webhook + name: kcl-webhook namespace: default --- apiVersion: v1 @@ -181,6 +181,7 @@ spec: volumeMounts: - mountPath: /etc/webhook/certs name: webhook-certs + serviceAccountName: kcl-webhook volumes: - emptyDir: {} name: webhook-certs diff --git a/config/rbac/role_binding.yaml b/config/rbac/role_binding.yaml index d4ca7af..a0df8cf 100644 --- a/config/rbac/role_binding.yaml +++ b/config/rbac/role_binding.yaml @@ -1,12 +1,12 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: webhook-rolebinding + name: kcl-webhook-rolebinding roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: webhook-role + name: kcl-webhook-role subjects: - kind: ServiceAccount - name: webhook + name: kcl-webhook namespace: default diff --git a/config/rbac/service_account.yaml b/config/rbac/service_account.yaml index 3619d08..77980b9 100644 --- a/config/rbac/service_account.yaml +++ b/config/rbac/service_account.yaml @@ -1,5 +1,5 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: webhook + name: kcl-webhook namespace: default diff --git a/config/webhook/webhook.yaml b/config/webhook/webhook.yaml index dda55b3..14b2ffa 100644 --- a/config/webhook/webhook.yaml +++ b/config/webhook/webhook.yaml @@ -14,6 +14,7 @@ spec: labels: app: kcl-webhook-server spec: + serviceAccountName: kcl-webhook initContainers: - name: kcl-webhook-init image: kcllang/webhook-init diff --git a/scripts/deploy_test.sh b/scripts/deploy_test.sh index a5b44e1..6922908 100755 --- a/scripts/deploy_test.sh +++ b/scripts/deploy_test.sh @@ -28,8 +28,9 @@ if [ $ROLLOUT_STATUS -ne 0 ]; then for pod in $PODS; do echo -e "${YELLOW}Pod: $pod${NC}" kubectl describe pod/$pod - echo -e "${YELLOW}Pod logs:${NC}" + echo -e "${YELLOW}Pod init container logs:${NC}" kubectl logs $pod -c kcl-webhook-init + echo -e "${YELLOW}Pod main container logs:${NC}" kubectl logs $pod -c kcl-webhook-server done else