-
Notifications
You must be signed in to change notification settings - Fork 674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GKE single cluster configuration archetype #12
Closed
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
550596a
GKE single cluster configuration archetype
e6a907e
adding a base generate script and generated yaml
92bbc0a
Remove unnecessary filler values from flyteadmin sandbox config
katrogan 81dd598
delete more
katrogan 10ead01
Merge remote-tracking branch 'origin/noop-config' into gcp
530d44b
bumping some other admin uses to the same 0.1.4 version, make kustomize
f9d0dd4
remove domain domain
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
################################### | ||
# WORK IN PROGRESS still | ||
################################### | ||
|
||
SQL Database | ||
------------ | ||
Create a SQL database (Postgres) | ||
https://cloud.google.com/sql/docs/postgres/create-instance | ||
|
||
Enable the the SQL server to be accessed from the GKE cluster that will host the FlyteAdmin service. This can be done using private networking mode and associating the shared network | ||
|
||
Create a database called "flyte" in this DB instance | ||
|
||
Configuring Flyte to access DB | ||
------------------------------ | ||
|
||
In this sample we pass the username and password directly in the config file. | ||
TODO: Example of how to use kube secrets to pass the username and password. | ||
|
||
Auth / IAM | ||
---------- | ||
|
||
On GKE you can follow instructions listed here | ||
https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity | ||
to setup WorkloadIdentity and serviceAccounts. | ||
|
||
Important commands | ||
kubectl create serviceaccount --namespace flytekit-development flyte-sandbox | ||
gcloud iam service-accounts add-iam-policy-binding --role roles/iam.workloadIdentityUser --member "serviceAccount:flyte-sandbox.svc.id.goog[flytekit-development/flyte-sandbox]" [email protected] | ||
kubectl annotate serviceaccount --namespace flytekit-development flyte-sandbox iam.gke.io/gcp-service-account=flyte-sandbox@flyte-sandbox.iam.gserviceaccount.com | ||
|
||
|
||
IAM For FLyte components | ||
------------------------ | ||
Create the right service accounts in GKE cluster's flyte namespace and then add the serviceaccountname to propeller and flyteadmin deployments. You may also want to add it to the various plugin | ||
deployments. | ||
|
||
gcloud iam service-accounts add-iam-policy-binding --role roles/iam.workloadIdentityUser --member "serviceAccount:flyte-sandbox.svc.id.goog[flyte/flyteadmin]" [email protected] | ||
kubectl annotate serviceaccount --namespace flyte flyteadmin iam.gke.io/gcp-service-account=flyte-sandbox@flyte-sandbox.iam.gserviceaccount.com | ||
gcloud iam service-accounts add-iam-policy-binding --role roles/iam.workloadIdentityUser --member "serviceAccount:flyte-sandbox.svc.id.goog[flyte/flytepropeller]" [email protected] | ||
kubectl annotate serviceaccount --namespace flyte flytepropeller iam.gke.io/gcp-service-account=flyte-sandbox@flyte-sandbox.iam.gserviceaccount.com | ||
|
||
IAM for workflows | ||
----------------- | ||
As a platform admin, you will need to associate service accounts with the target namespaces (project-domain) combination. Flyte allows launching workflows with serviceAccounts. Thus when the end user | ||
requests a workflow launch or declares a workflow the right account should be associated within the right namespace. | ||
|
||
TODO: Future plans to automate this creation and association |
62 changes: 62 additions & 0 deletions
62
kustomize/overlays/gke-single-cluster/admindeployment/admindeployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: flyteadmin | ||
namespace: flyte | ||
spec: | ||
template: | ||
spec: | ||
volumes: | ||
- name: resource-templates | ||
configMap: | ||
name: clusterresource-template | ||
initContainers: | ||
- name: check-db-ready | ||
image: postgres:10.1 | ||
command: ['sh', '-c', | ||
'until pg_isready -h postgres -p 5432; | ||
do echo waiting for database; sleep 2; done;'] | ||
- name: run-migrations | ||
image: docker.io/lyft/flyteadmin:v0.1.1 | ||
imagePullPolicy: IfNotPresent | ||
command: ["flyteadmin", "--logtostderr", "--config", "/etc/flyte/config/flyteadmin_config.yaml", | ||
"migrate", "run"] | ||
volumeMounts: | ||
- name: config-volume | ||
mountPath: /etc/flyte/config | ||
- name: seed-projects | ||
image: docker.io/lyft/flyteadmin:v0.1.1 | ||
imagePullPolicy: IfNotPresent | ||
command: ["flyteadmin", "--logtostderr", "--config", "/etc/flyte/config/flyteadmin_config.yaml", | ||
"migrate", "seed-projects", "flytesnacks", "flytetester"] | ||
volumeMounts: | ||
- name: config-volume | ||
mountPath: /etc/flyte/config | ||
- name: sync-cluster-resources | ||
image: docker.io/lyft/flyteadmin:v0.1.1 | ||
imagePullPolicy: IfNotPresent | ||
command: ["flyteadmin", "--logtostderr", "--config", "/etc/flyte/config/flyteadmin_config.yaml", "clusterresource", "sync"] | ||
volumeMounts: | ||
- name: resource-templates | ||
mountPath: /etc/flyte/clusterresource/templates | ||
- name: config-volume | ||
mountPath: /etc/flyte/config | ||
containers: | ||
- name: flyteadmin | ||
resources: | ||
limits: | ||
memory: "200Mi" | ||
cpu: "0.1" | ||
ephemeral-storage: "100Mi" | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: flyteadmin | ||
namespace: flyte | ||
spec: | ||
ports: | ||
- name: redoc | ||
protocol: TCP | ||
port: 87 | ||
targetPort: 8087 |
7 changes: 7 additions & 0 deletions
7
...e/overlays/gke-single-cluster/admindeployment/clusterresource-templates/aa_namespace.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: {{ namespace }} | ||
spec: | ||
finalizers: | ||
- kubernetes |
30 changes: 30 additions & 0 deletions
30
kustomize/overlays/gke-single-cluster/admindeployment/cron.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
apiVersion: batch/v1beta1 | ||
kind: CronJob | ||
metadata: | ||
name: syncresources | ||
namespace: flyte | ||
spec: | ||
schedule: "*/1 * * * *" | ||
jobTemplate: | ||
spec: | ||
template: | ||
spec: | ||
serviceAccountName: flyteadmin | ||
containers: | ||
- name: sync-cluster-resources | ||
image: docker.io/lyft/flyteadmin:v0.1.1 | ||
imagePullPolicy: IfNotPresent | ||
command: ["flyteadmin", "--logtostderr", "--config", "/etc/flyte/config/flyteadmin_config.yaml", "clusterresource", "sync"] | ||
volumeMounts: | ||
- name: resource-templates | ||
mountPath: /etc/flyte/clusterresource/templates | ||
- name: config-volume | ||
mountPath: /etc/flyte/config | ||
volumes: | ||
- name: resource-templates | ||
configMap: | ||
name: clusterresource-template | ||
- name: config-volume | ||
configMap: | ||
name: flyte-admin-config | ||
restartPolicy: OnFailure |
86 changes: 86 additions & 0 deletions
86
kustomize/overlays/gke-single-cluster/admindeployment/flyteadmin_config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
logger: | ||
show-source: true | ||
level: 5 | ||
application: | ||
httpPort: 8088 | ||
grpcPort: 8089 | ||
flyteadmin: | ||
roleNameKey: "iam.amazonaws.com/role" | ||
profilerPort: 10254 | ||
metricsScope: "flyte:" | ||
metadataStoragePrefix: | ||
- "metadata" | ||
- "admin" | ||
testing: | ||
host: http://flyteadmin | ||
database: | ||
# Create a database like postgres and override these values | ||
port: 5432 | ||
username: postgres | ||
password: awesomesauce | ||
# Recommended to use passwordPath and mount it using kubescrets or the like | ||
# passwordPath: "/var/run/CREDENTIALS_DB_PASSWORD" | ||
# host here is the ip address of the CloudSQL Db in private mode | ||
host: 10.23.0.3 | ||
dbname: flyte | ||
options: sslmode=disable | ||
storage: | ||
type: stow | ||
stow: | ||
kind: google | ||
config: | ||
scopes: "" | ||
project_id: flyte-sandbox | ||
json: "" | ||
container: "flyte-sandbox" | ||
task_resources: | ||
defaults: | ||
cpu: 200m | ||
gpu: 0 | ||
memory: 500Mi | ||
storage: 100Mi | ||
limits: | ||
cpu: 62 | ||
gpu: 8 | ||
memory: 256Gi | ||
storage: 5Gi | ||
domains: | ||
- id: development | ||
name: development | ||
- id: staging | ||
name: staging | ||
- id: production | ||
name: production | ||
- id: domain | ||
name: domain | ||
registration: | ||
maxWorkflowNodes: 100 | ||
scheduler: | ||
eventScheduler: | ||
scheme: local | ||
region: "us-east-1" | ||
scheduleRole: "arn:aws:iam::173840052742:role/mbadmin-development-scheduler" | ||
targetName: "arn:aws:sqs:us-east-1:173840052742:flyteadmin-development-scheduler" | ||
workflowExecutor: | ||
scheme: local | ||
region: "us-east-1" | ||
scheduleQueueName: "won't-work-locally" | ||
accountId: "173840052742" | ||
notifications: | ||
type: local | ||
region: "us-east-1" | ||
publisher: | ||
topicName: "foo" | ||
processor: | ||
queueName: "queue" | ||
accountId: "bar" | ||
emailer: | ||
subject: "Notice: Execution \"{{ name }}\" has {{ phase }} in \"{{ domain }}\"." | ||
sender: "[email protected]" | ||
body: > | ||
Execution \"{{ name }}\" has {{ phase }} in \"{{ domain }}\". View details at | ||
<a href=\http://flyte.lyft.net/projects/{{ project }}/domains/{{ domain }}/executions/{{ name }}> | ||
http://flyte.lyft.net/projects/{{ project }}/domains/{{ domain }}/executions/{{ name }}</a>. {{ error }} | ||
cluster_resources: | ||
templatePath: "/etc/flyte/clusterresource/templates" | ||
refresh: 5m |
22 changes: 22 additions & 0 deletions
22
kustomize/overlays/gke-single-cluster/admindeployment/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
bases: | ||
- ../../../base/admindeployment | ||
|
||
namespace: flyte | ||
|
||
resources: | ||
- cron.yaml | ||
- service.yaml | ||
|
||
configMapGenerator: | ||
# the main admin configmap | ||
- name: flyte-admin-config | ||
files: | ||
- flyteadmin_config.yaml | ||
# cluster resource templates | ||
- name: clusterresource-template | ||
files: | ||
# Files are read in alphabetical order. To ensure that we create the namespace first, prefix the file name with "aa". | ||
- clusterresource-templates/aa_namespace.yaml | ||
|
||
patches: | ||
- admindeployment.yaml |
8 changes: 8 additions & 0 deletions
8
kustomize/overlays/gke-single-cluster/admindeployment/service.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: flyteadmin | ||
annotations: | ||
cloud.google.com/load-balancer-type: "Internal" | ||
spec: | ||
type: LoadBalancer |
15 changes: 15 additions & 0 deletions
15
kustomize/overlays/gke-single-cluster/console/console.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: flyteconsole | ||
namespace: flyte | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: flyteconsole | ||
resources: | ||
limits: | ||
memory: "150Mi" | ||
cpu: "0.1" | ||
ephemeral-storage: "100Mi" |
8 changes: 8 additions & 0 deletions
8
kustomize/overlays/gke-single-cluster/console/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
bases: | ||
- ../../../base/console | ||
|
||
patches: | ||
- console.yaml | ||
|
||
resources: | ||
- service.yaml |
11 changes: 11 additions & 0 deletions
11
kustomize/overlays/gke-single-cluster/console/service.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
# Service | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: flyteconsole | ||
namespace: flyte | ||
annotations: | ||
cloud.google.com/load-balancer-type: "Internal" | ||
spec: | ||
type: LoadBalancer |
30 changes: 30 additions & 0 deletions
30
kustomize/overlays/gke-single-cluster/datacatalog/datacatalog.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: datacatalog | ||
namespace: flyte | ||
spec: | ||
template: | ||
spec: | ||
initContainers: | ||
- name: check-db-ready | ||
image: postgres:10.1 | ||
command: ['sh', '-c', | ||
'until pg_isready -h postgres -p 5432; | ||
do echo waiting for database; sleep 2; done;'] | ||
volumeMounts: | ||
- name: config-volume | ||
mountPath: /etc/datacatalog/config | ||
containers: | ||
- name: datacatalog | ||
resources: | ||
limits: | ||
memory: "200Mi" | ||
cpu: "0.1" | ||
ephemeral-storage: "100Mi" | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: datacatalog | ||
namespace: flyte |
28 changes: 28 additions & 0 deletions
28
kustomize/overlays/gke-single-cluster/datacatalog/datacatalog_config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
logger: | ||
show-source: true | ||
level: 5 | ||
datacatalog: | ||
storage-prefix: metadata/datacatalog | ||
metrics-scope: "datacatalog" | ||
profiler-port: 10254 | ||
application: | ||
grpcPort: 8089 | ||
storage: | ||
connection: | ||
access-key: minio | ||
auth-type: accesskey | ||
disable-ssl: true | ||
endpoint: http://minio.flyte.svc.cluster.local:9000 | ||
region: us-east-1 | ||
secret-key: miniostorage | ||
cache: | ||
max_size_mbs: 10 | ||
target_gc_percent: 100 | ||
container: my-container | ||
type: minio | ||
database: | ||
port: 5432 | ||
username: postgres | ||
host: postgres | ||
dbname: datacatalog | ||
options: sslmode=disable |
12 changes: 12 additions & 0 deletions
12
kustomize/overlays/gke-single-cluster/datacatalog/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
bases: | ||
- ../../../base/datacatalog | ||
|
||
namespace: flyte | ||
|
||
configMapGenerator: | ||
- name: datacatalog-config | ||
files: | ||
- datacatalog_config.yaml | ||
|
||
patches: | ||
- datacatalog.yaml |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's nix this.