Skip to content

Latest commit

 

History

History
161 lines (143 loc) · 4.92 KB

05-deploy-with-helm.md

File metadata and controls

161 lines (143 loc) · 4.92 KB

Time for Helm

From this point on, you could follow the Getting started guide with some considerations:

  1. Add the Flyte chart repo to Helm:
helm repo add flyteorg https://flyteorg.github.io/flyte
  1. Download the eks-starter values file:
curl -sL https://raw.githubusercontent.com/flyteorg/flyte/master/charts/flyte-binary/eks-starter.yaml > eks-starter.yaml
  1. Edit the eks-starter.yaml file replacing the values obtained during the previous steps in this tutorial

  2. If not present, add the username: flyteadmin field under the database section. Your eks-starter.yaml should ressemble the following:

configuration:
  database:
    username: flyteadmin
    password: <database-password>
    host: <RDS-writer-endpoint-name>
    dbname: flyteadmin  
  storage:
    metadataContainer: <s3-bucket-for-metadata>
    userDataContainer: <s3-user-data-bucket>
    provider: s3
    providerConfig:
      s3:
        region: "<aws-region-code>"
        authType: "iam"
  inline:
    cluster_resources:
      customData:
      - production:
        - defaultIamRole:
            value: arn:aws:iam::<AWS-ACCOUNT-ID>:role/flyte-workers-role
      - staging:
        - defaultIamRole:
            value: arn:aws:iam::<AWS-ACCOUNT-ID>:role/flyte-workers-role
      - development:
        - defaultIamRole:
            value: arn:aws:iam::<AWS-ACCOUNT-ID>:role/flyte-workers-role
    task_resources:
      defaults:
        cpu: 500m
        memory: 500Mi
        storage: 500Mi
    plugins:
      k8s:
        inject-finalizer: true
        default-env-vars:
          - AWS_METADATA_SERVICE_TIMEOUT: 5
          - AWS_METADATA_SERVICE_NUM_ATTEMPTS: 20
    storage:
      cache:
        max_size_mbs: 100
        target_gc_percent: 100
clusterResourceTemplates:
  inline:
    001_namespace.yaml: |
      apiVersion: v1
      kind: Namespace
      metadata:
        name: '{{ namespace }}'
    002_serviceaccount.yaml: |
      apiVersion: v1
      kind: ServiceAccount
      metadata:
        name: default
        namespace: '{{ namespace }}'
        annotations:
          eks.amazonaws.com/role-arn: '{{ defaultIamRole }}'
serviceAccount:
  create: enable
  annotations:
    eks.amazonaws.com/role-arn: "arn:aws:iam::<aws-account-id>:role/flyte-system-role"
  1. Install the Helm chart:
helm install flyte-backend flyteorg/flyte-binary --namespace flyte --values eks-starter.yaml --create-namespace
  1. Example output of the Helm install command:
NAME: flyte-backend
LAST DEPLOYED: Wed Mar 22 17:46:21 2023
NAMESPACE: flyte
STATUS: deployed
REVISION: 1
TEST SUITE: None
  1. Wait a couple of minutes and check the status of the Flyte Pod (it should be Running):
$ kubectl get pods -n flyte

k get pods -n flyte

NAME                   READY       STATUS    RESTARTS             AGE
flyte-backend-flyte-binary-... 1/1  Running  0  8s
  1. Verify the IAM annotation is set in the Service Account:
kubectl describe sa flyte-backend-flyte-binary  -n flyte

Name:                flyte-backend-flyte-binary
Namespace:           flyte
Labels:              app.kubernetes.io/instance=flyte-backend
                     app.kubernetes.io/managed-by=Helm
                     app.kubernetes.io/name=flyte-binary
                     app.kubernetes.io/version=1.16.0
                     helm.sh/chart=flyte-binary-v1.3.0
Annotations:         eks.amazonaws.com/role-arn: arn:aws:iam::<account-id>:role/flyte-system-role
                     meta.helm.sh/release-name: flyte-backend
                     meta.helm.sh/release-namespace: flyte
Image pull secrets:  <none>
Mountable secrets:   <none>
Tokens:              <none>
Events:              <none>
  1. Verify the insecure: parameter is set to true in your $HOME/.flyte/config.yaml file to turn off SSL:
admin:
  # For GRPC endpoints you might want to use dns:///flyte.myexample.com
  endpoint: dns:///localhost:8089
  authType: Pkce
  insecure: true
logger:
  show-source: true
  level: 0

NOTE: this configuration is used for the flytectl/pyflyte tools. The console (UI) connection is not controlled by the settings on this file.

  1. Start the port-forward session:
kubectl -n flyte port-forward service/flyte-backend-flyte-binary 8088:8088 8089:8089
  1. Run your first workflow

Uninstalling Flyte

  1. Uninstall the Helm release:
helm uninstall flyte-backend flyteorg/flyte-binary --namespace flyte
  1. Delete the flyte namespace:
kubectl delete ns flyte

If you experience issues, review the Troubleshooting guide or ask help in the #flyte-deployment channel


Next: productionize your deployment with Ingress and SSL