Skip to content

Commit

Permalink
indent 1
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiezieziula committed Sep 7, 2023
1 parent 2e4c1b5 commit 2b744f3
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 127 deletions.
126 changes: 63 additions & 63 deletions charts/prefect-worker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,107 +12,107 @@ Prefect Worker application bundle

1. Add the Prefect Helm repository to your Helm client:

```bash
helm repo add prefect https://prefecthq.github.io/prefect-helm
helm repo update
```
```bash
helm repo add prefect https://prefecthq.github.io/prefect-helm
helm repo update
```

2. Create a new namespace in your Kubernetes cluster to deploy the Prefect worker in:

```bash
kubectl create namespace prefect
```
```bash
kubectl create namespace prefect
```

### Configuring a Worker for Prefect Cloud:

1. Create a Kubernetes secret for a Prefect Cloud API key

First create a file named `api-key.yaml` with the following contents:
First create a file named `api-key.yaml` with the following contents:

```yaml
apiVersion: v1
kind: Secret
metadata:
name: prefect-api-key
namespace: prefect
type: Opaque
data:
key: <base64-encoded-api-key>
```
```yaml
apiVersion: v1
kind: Secret
metadata:
name: prefect-api-key
namespace: prefect
type: Opaque
data:
key: <base64-encoded-api-key>
```

Replace `<base64-encoded-api-key>` with your Prefect Cloud API key encoded in base64. The helm chart looks for a secret of this name and schema, this can be overridden in the `values.yaml`.
Replace `<base64-encoded-api-key>` with your Prefect Cloud API key encoded in base64. The helm chart looks for a secret of this name and schema, this can be overridden in the `values.yaml`.

You can use the following command to generate the base64-encoded value:
You can use the following command to generate the base64-encoded value:

```bash
echo -n "your-prefect-cloud-api-key" | base64
```
```bash
echo -n "your-prefect-cloud-api-key" | base64
```

Then apply the `api-key.yaml` file to create the Kubernetes secret:
Then apply the `api-key.yaml` file to create the Kubernetes secret:

```bash
kubectl apply -f api-key.yaml
```
```bash
kubectl apply -f api-key.yaml
```

Alternatively, you can create the Kubernetes secret via the cli with the following command. In this case, Kubernetes will take care of base64 encoding the value on your behalf:
Alternatively, you can create the Kubernetes secret via the cli with the following command. In this case, Kubernetes will take care of base64 encoding the value on your behalf:

```bash
kubectl create secret generic prefect-api-key --from-literal=key=pnu_xxxx
```
```bash
kubectl create secret generic prefect-api-key --from-literal=key=pnu_xxxx
```

2. Configure the Prefect worker values

Create a `values.yaml` file to customize the Prefect worker configuration. Add the following contents to the file:
Create a `values.yaml` file to customize the Prefect worker configuration. Add the following contents to the file:

```yaml
worker:
cloudApiConfig:
accountId: <target account ID>
workspaceId: <target workspace ID>
config:
workPool: <target work pool name>
```
```yaml
worker:
cloudApiConfig:
accountId: <target account ID>
workspaceId: <target workspace ID>
config:
workPool: <target work pool name>
```

These settings will ensure that the worker connects to the proper account, workspace, and work pool
View your Account ID and Workspace ID in your browser URL when logged into Prefect Cloud. For example: `https://app.prefect.cloud/account/abc-my-account-id-is-here/workspaces/123-my-workspace-id-is-here`
These settings will ensure that the worker connects to the proper account, workspace, and work pool
View your Account ID and Workspace ID in your browser URL when logged into Prefect Cloud. For example: `https://app.prefect.cloud/account/abc-my-account-id-is-here/workspaces/123-my-workspace-id-is-here`

### Configuring a Worker for Prefect Server:

1. Configure the Prefect worker values

Create a `values.yaml` file to customize the Prefect worker configuration. Add the following contents to the file:
Create a `values.yaml` file to customize the Prefect worker configuration. Add the following contents to the file:

```yaml
worker:
apiConfig: server
config:
workPool: <target work pool name>
serverApiConfig:
apiUrl: <dns or ip address of the prefect-server pod here>
```
```yaml
worker:
apiConfig: server
config:
workPool: <target work pool name>
serverApiConfig:
apiUrl: <dns or ip address of the prefect-server pod here>
```

### Installing & Verifying Deployment of the Prefect Worker

1. Install the Prefect worker using Helm

```bash
helm install prefect-worker prefect/prefect-worker \
--namespace=prefect \
-f values.yaml
```
```bash
helm install prefect-worker prefect/prefect-worker \
--namespace=prefect \
-f values.yaml
```

2. Verify the deployment

Check the status of your Prefect worker deployment:
Check the status of your Prefect worker deployment:

```bash
kubectl get pods -n prefect
```bash
kubectl get pods -n prefect
NAME READY STATUS RESTARTS AGE
prefect-worker-658f89bc49-jglvt 1/1 Running 0 25m
```
NAME READY STATUS RESTARTS AGE
prefect-worker-658f89bc49-jglvt 1/1 Running 0 25m
```

You should see the Prefect worker pod running
You should see the Prefect worker pod running

## Maintainers

Expand Down
127 changes: 63 additions & 64 deletions charts/prefect-worker/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,108 +12,107 @@

1. Add the Prefect Helm repository to your Helm client:

```bash
helm repo add prefect https://prefecthq.github.io/prefect-helm
helm repo update
```
```bash
helm repo add prefect https://prefecthq.github.io/prefect-helm
helm repo update
```

2. Create a new namespace in your Kubernetes cluster to deploy the Prefect worker in:

```bash
kubectl create namespace prefect
```
```bash
kubectl create namespace prefect
```

### Configuring a Worker for Prefect Cloud:

1. Create a Kubernetes secret for a Prefect Cloud API key

First create a file named `api-key.yaml` with the following contents:
First create a file named `api-key.yaml` with the following contents:

```yaml
apiVersion: v1
kind: Secret
metadata:
name: prefect-api-key
namespace: prefect
type: Opaque
data:
key: <base64-encoded-api-key>
```
```yaml
apiVersion: v1
kind: Secret
metadata:
name: prefect-api-key
namespace: prefect
type: Opaque
data:
key: <base64-encoded-api-key>
```

Replace `<base64-encoded-api-key>` with your Prefect Cloud API key encoded in base64. The helm chart looks for a secret of this name and schema, this can be overridden in the `values.yaml`.
Replace `<base64-encoded-api-key>` with your Prefect Cloud API key encoded in base64. The helm chart looks for a secret of this name and schema, this can be overridden in the `values.yaml`.

You can use the following command to generate the base64-encoded value:
You can use the following command to generate the base64-encoded value:

```bash
echo -n "your-prefect-cloud-api-key" | base64
```
```bash
echo -n "your-prefect-cloud-api-key" | base64
```

Then apply the `api-key.yaml` file to create the Kubernetes secret:
Then apply the `api-key.yaml` file to create the Kubernetes secret:

```bash
kubectl apply -f api-key.yaml
```
```bash
kubectl apply -f api-key.yaml
```

Alternatively, you can create the Kubernetes secret via the cli with the following command. In this case, Kubernetes will take care of base64 encoding the value on your behalf:
Alternatively, you can create the Kubernetes secret via the cli with the following command. In this case, Kubernetes will take care of base64 encoding the value on your behalf:

```bash
kubectl create secret generic prefect-api-key --from-literal=key=pnu_xxxx
```
```bash
kubectl create secret generic prefect-api-key --from-literal=key=pnu_xxxx
```

2. Configure the Prefect worker values

Create a `values.yaml` file to customize the Prefect worker configuration. Add the following contents to the file:
Create a `values.yaml` file to customize the Prefect worker configuration. Add the following contents to the file:

```yaml
worker:
cloudApiConfig:
accountId: <target account ID>
workspaceId: <target workspace ID>
config:
workPool: <target work pool name>
```

These settings will ensure that the worker connects to the proper account, workspace, and work pool
View your Account ID and Workspace ID in your browser URL when logged into Prefect Cloud. For example: `https://app.prefect.cloud/account/abc-my-account-id-is-here/workspaces/123-my-workspace-id-is-here`
```yaml
worker:
cloudApiConfig:
accountId: <target account ID>
workspaceId: <target workspace ID>
config:
workPool: <target work pool name>
```

These settings will ensure that the worker connects to the proper account, workspace, and work pool
View your Account ID and Workspace ID in your browser URL when logged into Prefect Cloud. For example: `https://app.prefect.cloud/account/abc-my-account-id-is-here/workspaces/123-my-workspace-id-is-here`

### Configuring a Worker for Prefect Server:

1. Configure the Prefect worker values

Create a `values.yaml` file to customize the Prefect worker configuration. Add the following contents to the file:
Create a `values.yaml` file to customize the Prefect worker configuration. Add the following contents to the file:

```yaml
worker:
apiConfig: server
config:
workPool: <target work pool name>
serverApiConfig:
apiUrl: <dns or ip address of the prefect-server pod here>
```
```yaml
worker:
apiConfig: server
config:
workPool: <target work pool name>
serverApiConfig:
apiUrl: <dns or ip address of the prefect-server pod here>
```

### Installing & Verifying Deployment of the Prefect Worker

1. Install the Prefect worker using Helm

```bash
helm install prefect-worker prefect/prefect-worker \
--namespace=prefect \
-f values.yaml
```
```bash
helm install prefect-worker prefect/prefect-worker \
--namespace=prefect \
-f values.yaml
```

2. Verify the deployment

Check the status of your Prefect worker deployment:
Check the status of your Prefect worker deployment:

```bash
kubectl get pods -n prefect
```bash
kubectl get pods -n prefect

NAME READY STATUS RESTARTS AGE
prefect-worker-658f89bc49-jglvt 1/1 Running 0 25m
```
NAME READY STATUS RESTARTS AGE
prefect-worker-658f89bc49-jglvt 1/1 Running 0 25m
```

You should see the Prefect worker pod running
You should see the Prefect worker pod running

{{ template "chart.maintainersSection" . }}

Expand Down

0 comments on commit 2b744f3

Please sign in to comment.