AWSTemplateFormatVersion: 2010-09-09 Description: Deploy an example workload into an existing kubernetes cluster. Metadata: cfn-lint: { config: { ignore_checks: [W9002, W9003, W9004, W9006, E9008] } } Parameters: KubeClusterName: Type: String Resources: # This resource creates a ConfigMap in the target cluster. It retrieves and decrypts a kms encrypted # kubernetes config file, which is automatically created when customers deploy an EKS cluster with the Quick Start. # For bring-your-own-cluster, the customer must encrypt and upload a config file prior to launching the stack. # # The "URL" property is an exact representation of a regular kubernetes resource manifest, available by link. KubeManifestURLExample: Type: AWSQS::Kubernetes::Resource Properties: ClusterName: !Ref KubeClusterName Namespace: my-ns # Kubernetes manifest URL Url: https://k8s.io/examples/controllers/nginx-deployment.yaml # This resource creates a ConfigMap in the target cluster. It retrieves and decrypts a kms encrypted # kubernetes config file, which is automatically created when customers deploy an EKS cluster with the quickstart, # for bring-your-own-cluster the customer must encrypt and upload a config file prior to launching the stack. # # The "Manifest" property is an exact representation of a regular kubernetes resource manifest, on stack create # `kubectl create --save-config` is called, on stack update `kubectl apply` and on stack delete `kubectl delete` # # The following elements are available to be used in other cloudformation resources using !GetAtt: # ResourceVersion, SelfLink, Uid KubeManifestExample: Type: AWSQS::Kubernetes::Resource Properties: ClusterName: !Ref KubeClusterName Namespace: kube-system # Kubernetes manifest Manifest: !Sub | apiVersion: v1 kind: ConfigMap metadata: name: test data: # examples of consuming outputs of the HelmExample resource below's output. Creates an implicit dependency, so # this resource will only launch once the HelmExample resource has completed successfully GrafanaId: ${HelmExample} # This resource deploys the kubernetes service catalog from it's helm chart. # # using !GetAtt you can fetch Name (release name) and Namespace, as well as all of the created resources, who's keys # are the resource type + an index for the case where a chart creates more than 1 of a Kind (eg. ConfigMap0 fetches # the 1st ConfigMap created) HelmExample: Type: AWSQS::Kubernetes::Helm Properties: ClusterID: !Ref KubeClusterName # Namespace is optional. In most cases it's best to leave this out so # that a namespace is dynamically generated. If namespace does not exist # it will be created. # # Namespace: example-ns # Chart: grafana/grafana Repository: https://grafana.github.io/helm-charts # # Name can be specified, if not helm will generate one. # Name: myRelease # If Version isn't specified, latest will be used. # Version: 1.0.1 # Custom values can optionally be specified. Values: testFramework.enabled: true imagePullPolicy: Always # If there are a lot of values, or they contain ambiguous types (eg, enable: "true" or count: "1") then values can # be passed as yaml enclosed in a string literal # ValueYaml: | # deep: # nested: # list: # - "true" # - "1" Outputs: # Examples for using the outputs of the KubeManifestExample resource ExampleResourceVersion: Value: !GetAtt KubeManifestExample.ResourceVersion ExampleReference: Value: !Ref KubeManifestExample ExampleResourceSelfLink: Value: !GetAtt KubeManifestExample.SelfLink ExampleUid: Value: !GetAtt KubeManifestExample.Uid HelmExampleReference: Value: !Ref HelmExample HelmExampleID: Value: !GetAtt HelmExample.ID