sigs.k8s.io/cluster-api-provider-aws@v1.5.5/test/e2e/data/infrastructure-aws/e2e_test_templates/cluster-template-efs-support.yaml (about)

     1  apiVersion: cluster.x-k8s.io/v1beta1
     2  kind: Cluster
     3  metadata:
     4    labels:
     5      cni: ${CLUSTER_NAME}-crs-0
     6      csi: external
     7    name: ${CLUSTER_NAME}
     8  spec:
     9    clusterNetwork:
    10      pods:
    11        cidrBlocks:
    12        - 192.168.0.0/16
    13    controlPlaneRef:
    14      apiVersion: controlplane.cluster.x-k8s.io/v1beta1
    15      kind: KubeadmControlPlane
    16      name: ${CLUSTER_NAME}-control-plane
    17    infrastructureRef:
    18      apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    19      kind: AWSCluster
    20      name: ${CLUSTER_NAME}
    21  ---
    22  apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    23  kind: AWSCluster
    24  metadata:
    25    name: ${CLUSTER_NAME}
    26  spec:
    27    network:
    28      vpc:
    29        availabilityZoneUsageLimit: 1
    30    region: ${AWS_REGION}
    31    sshKeyName: ${AWS_SSH_KEY_NAME}
    32  ---
    33  apiVersion: controlplane.cluster.x-k8s.io/v1beta1
    34  kind: KubeadmControlPlane
    35  metadata:
    36    name: ${CLUSTER_NAME}-control-plane
    37  spec:
    38    kubeadmConfigSpec:
    39      clusterConfiguration:
    40        apiServer:
    41          extraArgs:
    42            cloud-provider: aws
    43        controllerManager:
    44          extraArgs:
    45            cloud-provider: aws
    46      initConfiguration:
    47        nodeRegistration:
    48          kubeletExtraArgs:
    49            cloud-provider: aws
    50          name: '{{ ds.meta_data.local_hostname }}'
    51      joinConfiguration:
    52        nodeRegistration:
    53          kubeletExtraArgs:
    54            cloud-provider: aws
    55          name: '{{ ds.meta_data.local_hostname }}'
    56    machineTemplate:
    57      infrastructureRef:
    58        apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    59        kind: AWSMachineTemplate
    60        name: ${CLUSTER_NAME}-control-plane
    61    replicas: ${CONTROL_PLANE_MACHINE_COUNT}
    62    version: ${KUBERNETES_VERSION}
    63  ---
    64  apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    65  kind: AWSMachineTemplate
    66  metadata:
    67    name: ${CLUSTER_NAME}-control-plane
    68  spec:
    69    template:
    70      spec:
    71        iamInstanceProfile: control-plane.cluster-api-provider-aws.sigs.k8s.io
    72        instanceType: ${AWS_CONTROL_PLANE_MACHINE_TYPE}
    73        sshKeyName: ${AWS_SSH_KEY_NAME}
    74  ---
    75  apiVersion: cluster.x-k8s.io/v1beta1
    76  kind: MachineDeployment
    77  metadata:
    78    name: ${CLUSTER_NAME}-md-0
    79  spec:
    80    clusterName: ${CLUSTER_NAME}
    81    replicas: ${WORKER_MACHINE_COUNT}
    82    selector:
    83      matchLabels: null
    84    template:
    85      spec:
    86        bootstrap:
    87          configRef:
    88            apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
    89            kind: KubeadmConfigTemplate
    90            name: ${CLUSTER_NAME}-md-0
    91        clusterName: ${CLUSTER_NAME}
    92        infrastructureRef:
    93          apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    94          kind: AWSMachineTemplate
    95          name: ${CLUSTER_NAME}-md-0
    96        version: ${KUBERNETES_VERSION}
    97  ---
    98  apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    99  kind: AWSMachineTemplate
   100  metadata:
   101    name: ${CLUSTER_NAME}-md-0
   102  spec:
   103    template:
   104      spec:
   105        iamInstanceProfile: nodes.cluster-api-provider-aws.sigs.k8s.io
   106        instanceType: ${AWS_NODE_MACHINE_TYPE}
   107        rootVolume:
   108          size: 16
   109        sshKeyName: ${AWS_SSH_KEY_NAME}
   110  ---
   111  apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
   112  kind: KubeadmConfigTemplate
   113  metadata:
   114    name: ${CLUSTER_NAME}-md-0
   115  spec:
   116    template:
   117      spec:
   118        joinConfiguration:
   119          nodeRegistration:
   120            kubeletExtraArgs:
   121              cloud-provider: aws
   122            name: '{{ ds.meta_data.local_hostname }}'
   123  ---
   124  apiVersion: v1
   125  data: ${CNI_RESOURCES}
   126  kind: ConfigMap
   127  metadata:
   128    name: cni-${CLUSTER_NAME}-crs-0
   129  ---
   130  apiVersion: addons.cluster.x-k8s.io/v1beta1
   131  kind: ClusterResourceSet
   132  metadata:
   133    name: ${CLUSTER_NAME}-crs-0
   134  spec:
   135    clusterSelector:
   136      matchLabels:
   137        cni: ${CLUSTER_NAME}-crs-0
   138    resources:
   139    - kind: ConfigMap
   140      name: cni-${CLUSTER_NAME}-crs-0
   141    strategy: ApplyOnce
   142  ---
   143  apiVersion: addons.cluster.x-k8s.io/v1beta1
   144  kind: ClusterResourceSet
   145  metadata:
   146    name: crs-csi
   147  spec:
   148    clusterSelector:
   149      matchLabels:
   150        csi: external
   151    resources:
   152    - kind: ConfigMap
   153      name: aws-efs-csi-driver-addon
   154    strategy: ApplyOnce
   155  ---
   156  apiVersion: v1
   157  data:
   158    aws-efs-csi-external.yaml: |-
   159      apiVersion: v1
   160      kind: ServiceAccount
   161      metadata:
   162        labels:
   163          app.kubernetes.io/name: aws-efs-csi-driver
   164        name: efs-csi-controller-sa
   165        namespace: kube-system
   166      ---
   167      apiVersion: v1
   168      kind: ServiceAccount
   169      metadata:
   170        labels:
   171          app.kubernetes.io/name: aws-efs-csi-driver
   172        name: efs-csi-node-sa
   173        namespace: kube-system
   174      ---
   175      apiVersion: rbac.authorization.k8s.io/v1
   176      kind: ClusterRole
   177      metadata:
   178        labels:
   179          app.kubernetes.io/name: aws-efs-csi-driver
   180        name: efs-csi-external-provisioner-role
   181      rules:
   182        - apiGroups:
   183            - ""
   184          resources:
   185            - persistentvolumes
   186          verbs:
   187            - get
   188            - list
   189            - watch
   190            - create
   191            - delete
   192        - apiGroups:
   193            - ""
   194          resources:
   195            - persistentvolumeclaims
   196          verbs:
   197            - get
   198            - list
   199            - watch
   200            - update
   201        - apiGroups:
   202            - storage.k8s.io
   203          resources:
   204            - storageclasses
   205          verbs:
   206            - get
   207            - list
   208            - watch
   209        - apiGroups:
   210            - ""
   211          resources:
   212            - events
   213          verbs:
   214            - list
   215            - watch
   216            - create
   217            - patch
   218        - apiGroups:
   219            - storage.k8s.io
   220          resources:
   221            - csinodes
   222          verbs:
   223            - get
   224            - list
   225            - watch
   226        - apiGroups:
   227            - ""
   228          resources:
   229            - nodes
   230          verbs:
   231            - get
   232            - list
   233            - watch
   234        - apiGroups:
   235            - coordination.k8s.io
   236          resources:
   237            - leases
   238          verbs:
   239            - get
   240            - watch
   241            - list
   242            - delete
   243            - update
   244            - create
   245        - apiGroups:
   246            - ""
   247          resources:
   248            - secrets
   249          verbs:
   250            - get
   251            - watch
   252            - list
   253      ---
   254      apiVersion: rbac.authorization.k8s.io/v1
   255      kind: ClusterRoleBinding
   256      metadata:
   257        labels:
   258          app.kubernetes.io/name: aws-efs-csi-driver
   259        name: efs-csi-provisioner-binding
   260      roleRef:
   261        apiGroup: rbac.authorization.k8s.io
   262        kind: ClusterRole
   263        name: efs-csi-external-provisioner-role
   264      subjects:
   265        - kind: ServiceAccount
   266          name: efs-csi-controller-sa
   267          namespace: kube-system
   268      ---
   269      apiVersion: apps/v1
   270      kind: Deployment
   271      metadata:
   272        labels:
   273          app.kubernetes.io/name: aws-efs-csi-driver
   274        name: efs-csi-controller
   275        namespace: kube-system
   276      spec:
   277        replicas: 2
   278        selector:
   279          matchLabels:
   280            app: efs-csi-controller
   281            app.kubernetes.io/instance: kustomize
   282            app.kubernetes.io/name: aws-efs-csi-driver
   283        template:
   284          metadata:
   285            labels:
   286              app: efs-csi-controller
   287              app.kubernetes.io/instance: kustomize
   288              app.kubernetes.io/name: aws-efs-csi-driver
   289          spec:
   290            containers:
   291              - args:
   292                  - --endpoint=$(CSI_ENDPOINT)
   293                  - --logtostderr
   294                  - --v=2
   295                  - --delete-access-point-root-dir=false
   296                env:
   297                  - name: CSI_ENDPOINT
   298                    value: unix:///var/lib/csi/sockets/pluginproxy/csi.sock
   299                image: amazon/aws-efs-csi-driver:v1.3.6
   300                imagePullPolicy: IfNotPresent
   301                livenessProbe:
   302                  failureThreshold: 5
   303                  httpGet:
   304                    path: /healthz
   305                    port: healthz
   306                  initialDelaySeconds: 10
   307                  periodSeconds: 10
   308                  timeoutSeconds: 3
   309                name: efs-plugin
   310                ports:
   311                  - containerPort: 9909
   312                    name: healthz
   313                    protocol: TCP
   314                securityContext:
   315                  privileged: true
   316                volumeMounts:
   317                  - mountPath: /var/lib/csi/sockets/pluginproxy/
   318                    name: socket-dir
   319              - args:
   320                  - --csi-address=$(ADDRESS)
   321                  - --v=2
   322                  - --feature-gates=Topology=true
   323                  - --extra-create-metadata
   324                  - --leader-election
   325                env:
   326                  - name: ADDRESS
   327                    value: /var/lib/csi/sockets/pluginproxy/csi.sock
   328                image: public.ecr.aws/eks-distro/kubernetes-csi/external-provisioner:v2.1.1-eks-1-18-2
   329                imagePullPolicy: IfNotPresent
   330                name: csi-provisioner
   331                volumeMounts:
   332                  - mountPath: /var/lib/csi/sockets/pluginproxy/
   333                    name: socket-dir
   334              - args:
   335                  - --csi-address=/csi/csi.sock
   336                  - --health-port=9909
   337                image: public.ecr.aws/eks-distro/kubernetes-csi/livenessprobe:v2.2.0-eks-1-18-2
   338                imagePullPolicy: IfNotPresent
   339                name: liveness-probe
   340                volumeMounts:
   341                  - mountPath: /csi
   342                    name: socket-dir
   343            hostNetwork: true
   344            nodeSelector:
   345              kubernetes.io/os: linux
   346            priorityClassName: system-cluster-critical
   347            serviceAccountName: efs-csi-controller-sa
   348            volumes:
   349              - emptyDir: {}
   350                name: socket-dir
   351      ---
   352      apiVersion: apps/v1
   353      kind: DaemonSet
   354      metadata:
   355        labels:
   356          app.kubernetes.io/name: aws-efs-csi-driver
   357        name: efs-csi-node
   358        namespace: kube-system
   359      spec:
   360        selector:
   361          matchLabels:
   362            app: efs-csi-node
   363            app.kubernetes.io/instance: kustomize
   364            app.kubernetes.io/name: aws-efs-csi-driver
   365        template:
   366          metadata:
   367            labels:
   368              app: efs-csi-node
   369              app.kubernetes.io/instance: kustomize
   370              app.kubernetes.io/name: aws-efs-csi-driver
   371          spec:
   372            affinity:
   373              nodeAffinity:
   374                requiredDuringSchedulingIgnoredDuringExecution:
   375                  nodeSelectorTerms:
   376                    - matchExpressions:
   377                        - key: eks.amazonaws.com/compute-type
   378                          operator: NotIn
   379                          values:
   380                            - fargate
   381            containers:
   382              - args:
   383                  - --endpoint=$(CSI_ENDPOINT)
   384                  - --logtostderr
   385                  - --v=2
   386                env:
   387                  - name: CSI_ENDPOINT
   388                    value: unix:/csi/csi.sock
   389                image: amazon/aws-efs-csi-driver:v1.3.6
   390                imagePullPolicy: IfNotPresent
   391                livenessProbe:
   392                  failureThreshold: 5
   393                  httpGet:
   394                    path: /healthz
   395                    port: healthz
   396                  initialDelaySeconds: 10
   397                  periodSeconds: 2
   398                  timeoutSeconds: 3
   399                name: efs-plugin
   400                ports:
   401                  - containerPort: 9809
   402                    name: healthz
   403                    protocol: TCP
   404                securityContext:
   405                  privileged: true
   406                volumeMounts:
   407                  - mountPath: /var/lib/kubelet
   408                    mountPropagation: Bidirectional
   409                    name: kubelet-dir
   410                  - mountPath: /csi
   411                    name: plugin-dir
   412                  - mountPath: /var/run/efs
   413                    name: efs-state-dir
   414                  - mountPath: /var/amazon/efs
   415                    name: efs-utils-config
   416                  - mountPath: /etc/amazon/efs-legacy
   417                    name: efs-utils-config-legacy
   418              - args:
   419                  - --csi-address=$(ADDRESS)
   420                  - --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)
   421                  - --v=2
   422                env:
   423                  - name: ADDRESS
   424                    value: /csi/csi.sock
   425                  - name: DRIVER_REG_SOCK_PATH
   426                    value: /var/lib/kubelet/plugins/efs.csi.aws.com/csi.sock
   427                  - name: KUBE_NODE_NAME
   428                    valueFrom:
   429                      fieldRef:
   430                        fieldPath: spec.nodeName
   431                image: public.ecr.aws/eks-distro/kubernetes-csi/node-driver-registrar:v2.1.0-eks-1-18-2
   432                imagePullPolicy: IfNotPresent
   433                name: csi-driver-registrar
   434                volumeMounts:
   435                  - mountPath: /csi
   436                    name: plugin-dir
   437                  - mountPath: /registration
   438                    name: registration-dir
   439              - args:
   440                  - --csi-address=/csi/csi.sock
   441                  - --health-port=9809
   442                  - --v=2
   443                image: public.ecr.aws/eks-distro/kubernetes-csi/livenessprobe:v2.2.0-eks-1-18-2
   444                imagePullPolicy: IfNotPresent
   445                name: liveness-probe
   446                volumeMounts:
   447                  - mountPath: /csi
   448                    name: plugin-dir
   449            dnsPolicy: ClusterFirst
   450            hostNetwork: true
   451            nodeSelector:
   452              beta.kubernetes.io/os: linux
   453            priorityClassName: system-node-critical
   454            serviceAccountName: efs-csi-node-sa
   455            tolerations:
   456              - operator: Exists
   457            volumes:
   458              - hostPath:
   459                  path: /var/lib/kubelet
   460                  type: Directory
   461                name: kubelet-dir
   462              - hostPath:
   463                  path: /var/lib/kubelet/plugins/efs.csi.aws.com/
   464                  type: DirectoryOrCreate
   465                name: plugin-dir
   466              - hostPath:
   467                  path: /var/lib/kubelet/plugins_registry/
   468                  type: Directory
   469                name: registration-dir
   470              - hostPath:
   471                  path: /var/run/efs
   472                  type: DirectoryOrCreate
   473                name: efs-state-dir
   474              - hostPath:
   475                  path: /var/amazon/efs
   476                  type: DirectoryOrCreate
   477                name: efs-utils-config
   478              - hostPath:
   479                  path: /etc/amazon/efs
   480                  type: DirectoryOrCreate
   481                name: efs-utils-config-legacy
   482      ---
   483      apiVersion: storage.k8s.io/v1
   484      kind: CSIDriver
   485      metadata:
   486        annotations:
   487          helm.sh/hook: pre-install, pre-upgrade
   488          helm.sh/hook-delete-policy: before-hook-creation
   489          helm.sh/resource-policy: keep
   490        name: efs.csi.aws.com
   491      spec:
   492        attachRequired: false
   493  kind: ConfigMap
   494  metadata:
   495    annotations:
   496      note: generated
   497    labels:
   498      type: generated
   499    name: aws-efs-csi-driver-addon