Fortinet black logo

Online Help

AWS Kubernetes Service Account Creation

Copy Link
Copy Doc ID 4a6f3c4b-8d0f-11eb-a7dc-00505692583a:102704

AWS Kubernetes Service Account Creation

  1. Log into the Kubernetes cluster using CLI command line.
  2. Create a service account yaml file. (e.g. serviceaccount.yaml)
  3. Copy and paste the following configurations to the yaml file:
  4. apiVersion: v1

    apiVersion: v1

    kind: ServiceAccount

    metadata:

    name: auto-deployment-sa

    namespace: default

    ---

    apiVersion: rbac.authorization.k8s.io/v1

    kind: ClusterRole

    metadata:

    name: auto-deployment-role

    rules:

    - apiGroups:

    - '*'

    resources:

    - '*'

    verbs:

    - '*'

    ---

    apiVersion: rbac.authorization.k8s.io/v1

    kind: ClusterRoleBinding

    metadata:

    name: auto-deployment-rolebinding

    subjects:

    - kind: ServiceAccount

    name: auto-deployment-sa

    namespace: default

    roleRef:

    apiGroup: rbac.authorization.k8s.io

    kind: ClusterRole

    name: auto-deployment-role

  5. Save the yaml file.
  6. Apply the service account yaml file with the following command:

kubectl apply -f "service account file name"

AWS Kubernetes Service Account Creation

  1. Log into the Kubernetes cluster using CLI command line.
  2. Create a service account yaml file. (e.g. serviceaccount.yaml)
  3. Copy and paste the following configurations to the yaml file:
  4. apiVersion: v1

    apiVersion: v1

    kind: ServiceAccount

    metadata:

    name: auto-deployment-sa

    namespace: default

    ---

    apiVersion: rbac.authorization.k8s.io/v1

    kind: ClusterRole

    metadata:

    name: auto-deployment-role

    rules:

    - apiGroups:

    - '*'

    resources:

    - '*'

    verbs:

    - '*'

    ---

    apiVersion: rbac.authorization.k8s.io/v1

    kind: ClusterRoleBinding

    metadata:

    name: auto-deployment-rolebinding

    subjects:

    - kind: ServiceAccount

    name: auto-deployment-sa

    namespace: default

    roleRef:

    apiGroup: rbac.authorization.k8s.io

    kind: ClusterRole

    name: auto-deployment-role

  5. Save the yaml file.
  6. Apply the service account yaml file with the following command:

kubectl apply -f "service account file name"