---
apiVersion: v1
kind: Config
clusters:
  - name: kubernetes
    cluster:
      certificate-authority: {{.CaCertPath}}
      server: {{.APIServerEndpoint}}
current-context: kubelet
contexts:
  - name: kubelet
    context:
      cluster: kubernetes
      user: kubelet
users:
  - name: kubelet
    user:
      exec:
        apiVersion: client.authentication.k8s.io/v1beta1
        command: "{{.AwsIamAuthenticatorPath}}"
{{- if .AwsConfigPath}}
        env:
          - name: "AWS_PROFILE"
            value: "hybrid"
          - name: "AWS_CONFIG_FILE"
            value: "{{.AwsConfigPath}}"
{{- end}}
        args:
          - "token"
          - "--cluster-id"
          - "{{.Cluster}}"
          - "--region"
          - "{{.Region}}"
