gke-autoneg-controller
gke-autoneg-controller copied to clipboard
deploy/autoneg.yaml referring incorrect kubernetes service account
Hi Team,
I was using kubectl
to install the gke controller using the manifest provide in the repo here https://github.com/GoogleCloudPlatform/gke-autoneg-controller/blob/master/deploy/autoneg.yaml, found that you are creating a new service account with autoneg
and referencing that service account name in the Deployment in the later part of the file; but then I found that you are using the default
service account in the rolebinding and the clusterrolebinding, which is incorrect. I spend lot of time investigating and found this issue. Please update the autoneg.yaml file attached as a reference.
Regards, Sreenivas
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# this contains fixes ---- sreenivas-ps
apiVersion: v1
kind: Namespace
metadata:
labels:
app: autoneg
control-plane: controller-manager
name: autoneg-system
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: autoneg
namespace: autoneg-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
labels:
app: autoneg
name: autoneg-leader-election-role
namespace: autoneg-system
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- configmaps/status
verbs:
- get
- update
- patch
- apiGroups:
- ""
resources:
- events
verbs:
- create
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
labels:
app: autoneg
name: autoneg-manager-role
rules:
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- ""
resources:
- services
verbs:
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- services/status
verbs:
- get
- patch
- update
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app: autoneg
name: autoneg-proxy-role
rules:
- apiGroups:
- authentication.k8s.io
resources:
- tokenreviews
verbs:
- create
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
labels:
app: autoneg
name: autoneg-leader-election-rolebinding
namespace: autoneg-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: autoneg-leader-election-role
subjects:
- kind: ServiceAccount
name: autoneg
namespace: autoneg-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app: autoneg
name: autoneg-manager-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: autoneg-manager-role
subjects:
- kind: ServiceAccount
name: autoneg
namespace: autoneg-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app: autoneg
name: autoneg-proxy-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: autoneg-proxy-role
subjects:
- kind: ServiceAccount
name: autoneg
namespace: autoneg-system
---
apiVersion: v1
kind: Service
metadata:
annotations:
prometheus.io/port: "8443"
prometheus.io/scheme: https
prometheus.io/scrape: "true"
labels:
app: autoneg
control-plane: controller-manager
name: autoneg-controller-manager-metrics-service
namespace: autoneg-system
spec:
ports:
- name: https
port: 8443
targetPort: https
selector:
app: autoneg
control-plane: controller-manager
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: autoneg
control-plane: controller-manager
name: autoneg-controller-manager
namespace: autoneg-system
spec:
replicas: 1
selector:
matchLabels:
app: autoneg
control-plane: controller-manager
template:
metadata:
labels:
app: autoneg
control-plane: controller-manager
spec:
containers:
- args:
- --metrics-addr=127.0.0.1:8080
- --enable-leader-election
command:
- /manager
image: ghcr.io/googlecloudplatform/gke-autoneg-controller/gke-autoneg-controller:v0.9.6
name: manager
resources:
limits:
cpu: 100m
memory: 30Mi
requests:
cpu: 100m
memory: 20Mi
securityContext:
allowPrivilegeEscalation: false
privileged: false
- args:
- --secure-listen-address=0.0.0.0:8443
- --upstream=http://127.0.0.1:8080/
- --logtostderr=true
- --v=10
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0
name: kube-rbac-proxy
ports:
- containerPort: 8443
name: https
securityContext:
allowPrivilegeEscalation: false
privileged: false
securityContext:
runAsNonRoot: true
serviceAccountName: autoneg
terminationGracePeriodSeconds: 10
I don't see that in the current deploy.yaml, are you sure you don't have an old one?
@rosmo : hmmm, I do not remember but it had references to default service account. Thanks.