2021-12-01 12:33:11 +00:00
|
|
|
{{- if .Values.api.awsIamAuth.enabled }}
|
2021-01-04 14:56:41 +00:00
|
|
|
kind: ClusterRole
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
metadata:
|
|
|
|
name: aws-iam-authenticator
|
|
|
|
rules:
|
|
|
|
- apiGroups:
|
|
|
|
- iamauthenticator.k8s.aws
|
|
|
|
resources:
|
|
|
|
- iamidentitymappings
|
|
|
|
verbs:
|
|
|
|
- get
|
|
|
|
- list
|
|
|
|
- watch
|
|
|
|
- apiGroups:
|
|
|
|
- iamauthenticator.k8s.aws
|
|
|
|
resources:
|
|
|
|
- iamidentitymappings/status
|
|
|
|
verbs:
|
|
|
|
- patch
|
|
|
|
- update
|
|
|
|
- apiGroups:
|
|
|
|
- ""
|
|
|
|
resources:
|
|
|
|
- events
|
|
|
|
verbs:
|
|
|
|
- create
|
|
|
|
- update
|
|
|
|
- patch
|
|
|
|
- apiGroups:
|
|
|
|
- ""
|
|
|
|
resources:
|
|
|
|
- configmaps
|
|
|
|
verbs:
|
|
|
|
- list
|
|
|
|
- watch
|
|
|
|
- apiGroups:
|
|
|
|
- ""
|
|
|
|
resources:
|
|
|
|
- configmaps
|
|
|
|
resourceNames:
|
|
|
|
- aws-auth
|
|
|
|
verbs:
|
|
|
|
- get
|
|
|
|
|
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: ServiceAccount
|
|
|
|
metadata:
|
|
|
|
name: aws-iam-authenticator
|
|
|
|
namespace: kube-system
|
|
|
|
|
|
|
|
---
|
|
|
|
kind: ClusterRoleBinding
|
2021-02-12 11:04:16 +00:00
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
2021-01-04 14:56:41 +00:00
|
|
|
metadata:
|
|
|
|
name: aws-iam-authenticator
|
|
|
|
namespace: kube-system
|
|
|
|
roleRef:
|
|
|
|
apiGroup: rbac.authorization.k8s.io
|
|
|
|
kind: ClusterRole
|
|
|
|
name: aws-iam-authenticator
|
|
|
|
subjects:
|
|
|
|
- kind: ServiceAccount
|
|
|
|
name: aws-iam-authenticator
|
|
|
|
namespace: kube-system
|
|
|
|
|
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: ConfigMap
|
|
|
|
metadata:
|
|
|
|
namespace: kube-system
|
|
|
|
name: aws-iam-authenticator
|
|
|
|
labels:
|
|
|
|
k8s-app: aws-iam-authenticator
|
|
|
|
data:
|
|
|
|
config.yaml: |
|
2022-09-11 11:54:56 +00:00
|
|
|
clusterID: {{ .Values.global.clusterName }}
|
2021-01-04 14:56:41 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: DaemonSet
|
|
|
|
metadata:
|
|
|
|
namespace: kube-system
|
|
|
|
name: aws-iam-authenticator
|
|
|
|
labels:
|
|
|
|
k8s-app: aws-iam-authenticator
|
|
|
|
annotations:
|
|
|
|
seccomp.security.alpha.kubernetes.io/pod: runtime/default
|
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
k8s-app: aws-iam-authenticator
|
|
|
|
updateStrategy:
|
|
|
|
type: RollingUpdate
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
k8s-app: aws-iam-authenticator
|
|
|
|
spec:
|
2022-07-14 14:59:06 +00:00
|
|
|
priorityClassName: system-cluster-critical
|
|
|
|
|
2021-01-04 14:56:41 +00:00
|
|
|
# use service account with access to
|
|
|
|
serviceAccountName: aws-iam-authenticator
|
|
|
|
|
|
|
|
# run on the host network (don't depend on CNI)
|
|
|
|
hostNetwork: true
|
|
|
|
|
2021-12-01 12:33:11 +00:00
|
|
|
# run on each controller
|
2021-01-04 14:56:41 +00:00
|
|
|
nodeSelector:
|
2021-12-01 12:33:11 +00:00
|
|
|
node-role.kubernetes.io/control-plane: ""
|
2021-01-04 14:56:41 +00:00
|
|
|
tolerations:
|
|
|
|
- effect: NoSchedule
|
|
|
|
key: node-role.kubernetes.io/master
|
|
|
|
|
|
|
|
containers:
|
|
|
|
- name: aws-iam-authenticator
|
2022-07-12 15:00:37 +00:00
|
|
|
image: public.ecr.aws/zero-downtime/aws-iam-authenticator:v0.5.9
|
2021-01-04 14:56:41 +00:00
|
|
|
args:
|
|
|
|
- server
|
|
|
|
- --backend-mode=CRD,MountedFile
|
|
|
|
- --config=/etc/aws-iam-authenticator/config.yaml
|
|
|
|
- --state-dir=/var/aws-iam-authenticator
|
|
|
|
- --kubeconfig-pregenerated=true
|
|
|
|
|
|
|
|
securityContext:
|
|
|
|
allowPrivilegeEscalation: false
|
|
|
|
capabilities:
|
|
|
|
drop:
|
|
|
|
- ALL
|
|
|
|
|
|
|
|
resources:
|
|
|
|
requests:
|
|
|
|
memory: 20Mi
|
|
|
|
cpu: 10m
|
|
|
|
limits:
|
2022-05-04 14:59:17 +00:00
|
|
|
memory: 64Mi
|
2021-03-05 13:00:00 +00:00
|
|
|
#cpu: 100m
|
2021-01-04 14:56:41 +00:00
|
|
|
|
|
|
|
volumeMounts:
|
|
|
|
- name: config
|
|
|
|
mountPath: /etc/aws-iam-authenticator/
|
|
|
|
- name: state
|
|
|
|
mountPath: /var/aws-iam-authenticator/
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
- name: config
|
|
|
|
configMap:
|
|
|
|
name: aws-iam-authenticator
|
|
|
|
- name: state
|
2021-11-27 13:02:23 +00:00
|
|
|
secret:
|
|
|
|
secretName: aws-iam-certs
|
2021-02-22 13:41:32 +00:00
|
|
|
{{- end }}
|