-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kubeadm doesn't support ABAC correctly #60844
Comments
It seems that maybe the apiServerExtraVolumes:
- name: <value|string>
hostPath: <value|string>
mountPath: <value|string> If I try mounting a directory containing the two files and specify the new locations in the config it still looks for them in the default location! See the generated apiVersion: v1
kind: Pod
metadata:
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ""
creationTimestamp: null
labels:
component: kube-apiserver
tier: control-plane
name: kube-apiserver
namespace: kube-system
spec:
containers:
- command:
- kube-apiserver
- --authorization-policy-file=/etc/kubernetes/users/abac_policy.json
- --basic-auth-file=/etc/kubernetes/users/basic_auth.csv
- --service-account-key-file=/etc/kubernetes/pki/sa.pub
- --tls-private-key-file=/etc/kubernetes/pki/apiserver.key
- --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key
- --admission-control=Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,ResourceQuota
- --enable-bootstrap-token-auth=true
- --allow-privileged=true
- --requestheader-group-headers=X-Remote-Group
- --advertise-address=#######
- --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt
- --insecure-port=0
- --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname
- --requestheader-extra-headers-prefix=X-Remote-Extra-
- --tls-cert-file=/etc/kubernetes/pki/apiserver.crt
- --secure-port=6443
- --requestheader-username-headers=X-Remote-User
- --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt
- --requestheader-allowed-names=front-proxy-client
- --service-cluster-ip-range=10.96.0.0/12
- --client-ca-file=/etc/kubernetes/pki/ca.crt
- --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt
- --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key
- --authorization-policy-file=/etc/kubernetes/abac_policy.json
- --authorization-mode=Node,RBAC,ABAC
- --etcd-servers=http://127.0.0.1:2379
image: gcr.io/google_containers/kube-apiserver-amd64:v1.9.3
livenessProbe:
failureThreshold: 8
httpGet:
host: #######
path: /healthz
port: 6443
scheme: HTTPS
initialDelaySeconds: 15
timeoutSeconds: 15
name: kube-apiserver
resources:
requests:
cpu: 250m
volumeMounts:
- mountPath: /etc/kubernetes/pki
name: k8s-certs
readOnly: true
- mountPath: /etc/ssl/certs
name: ca-certs
readOnly: true
- mountPath: /etc/kubernetes/users
name: users
readOnly: true
hostNetwork: true
volumes:
- hostPath:
path: /etc/kubernetes/pki
type: DirectoryOrCreate
name: k8s-certs
- hostPath:
path: /etc/ssl/certs
type: DirectoryOrCreate
name: ca-certs
- hostPath:
path: /etc/kubernetes/users
type: DirectoryOrCreate
name: users
status: {} |
@msnelling - We generally discourage ABAC enablement, but it does look like an over-ride issue. Where possible please open issues against the https://github.com/kubernetes/kubeadm repo. |
Is this a BUG REPORT or FEATURE REQUEST?:
/kind bug
What happened:
I attempted to create a cluster using the
kubeadm
tool with ABAC authorisation enabled using the below configuration files.~/config.yaml
~/basic_auth.csv
~/abac_policy.json
The
kubeadm
command hangs with the following output...It looks like the
kube-apiserver
container is constantly restarted.The log output from the
kube-apiserver
container givesWhat you expected to happen:
I expected the
kube-apiserver
to start.How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
Environment:
kubectl version
): v1.9.3uname -a
): Linux k8s-master 4.4.0-116-generic PreStart and PostStop event hooks #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/LinuxThe text was updated successfully, but these errors were encountered: