...

Text file src/edge-infra.dev/config/pallets/edge/bannerctl/README.md

Documentation: edge-infra.dev/config/pallets/edge/bannerctl

     1# Edge Bannerctl Pallet
     2
     3Since this pallet contains GCP infra, split scheduling is recommended. Read the documentation on [Applying Pallet Packages](https://docs.edge-infra.dev/foundation/manifest-scheduling/pallets/developing-pkgs/applying/) to learn about split scheduling and its prerequisites. Also, getting/having access to a GCP development sandbox is required.
     4
     5## Environment Setup
     6
     7Create an .env file with the following variables:
     8```dotenv
     9# gke, sds, or generic. use "generic" for any K8s cluster that isn't GKE or 
    10# SDS.
    11export CLUSTER_PROVIDER=
    12# uuid is necessary for generating a cluster_hash, existing resources should
    13# have this in their annotations already but one can be created by using
    14# uuidgen
    15export CLUSTER_UUID=
    16# google cloud project id
    17export GCP_PROJECT_ID=
    18# defaults to us and east1-b, otherwise needs to be valid GCP value
    19export GCP_REGION=
    20export GCP_ZONE=
    21# set to same value as gcp project ID when developing within a single
    22# project.
    23export FOREMAN_GCP_PROJECT_ID=
    24# enables split scheduling
    25export INFRA=true
    26# name of the kubeconfig context to use to schedule infra objects; 
    27# default behavior is to apply all objects to the same K8s context
    28export INFRA_CONTEXT=
    29# target namespace for all applied infrastructure resources, including 
    30# dependencies; the namespace is created if it does not already exist.
    31export INFRA_NAMESPACE=
    32```
    33
    34## Applying the Pallet
    35
    36The `bannerctl` pallet requires the `edge-backend-launch-darkly-sdk-key` and `edge-backend-totp-secret` to exist on the cluster it is being applied to. Check out the [Create Secret Manager Secrets](https://docs.edge-infra.dev/edge/operations/bootstrapping/#create-secret-manager-secrets) section of the Bootstrapping docs for more information.
    37
    38Tips for applying:
    39- The `key.json` can be created by going to the GCP console for your sandbox project, finding the IAM service account for kcc and adding a key in the `key` section of the service account
    40- If you are using a `kind` cluster, you can reset it with:
    41```
    42just hack/kind/reset
    43```
    44
    45lift apply \
    46  --domain= \
    47  --edge-env-url= \
    48  --platform-infra-gcp-project-id= \
    49  --tenants-gcp-folder-id= \
    50  config/pallets/edge/bannerctl
    51```
    52
    53*Note:* Some IAM policy members may not have the permissions required to be configured correctly depending on where the infra for the pallet is applied. The `deployment` should still run even if this issue arises
    54
    55> If this error is returned: `ConfigMap/bannerctl/bannerctl dry-run failed, error: failed to create typed patch object: .data.GCP_TENANTS_FOLDER_ID: expected string, got &value.valueUnstructured{Value:<your_id>}`, then wrap the tenants-gcp-folder-id value with double & single quotes (e.g. '"0123456789"') and apply the pallet again
    56
    57## Rendering Parameters
    58
    59Check the `bannerctl`'s ConfigMap in `config/pallets/edge/bannerctl/base/manifests.yaml` for more context on where most of these rendering parameters are being used. All gcp id's were taken from the GCP console (click select a project -> click `ALL` tab -> expand the `preprod` folder -> explore this directory).
    60
    61| Rendering Parameter           | Description                                           | Example                     |
    62|-------------------------------|-------------------------------------------------------|-----------------------------|
    63| domain                        | domain id for the instance                            | edge-preprod.dev            |
    64| edge-env-url                  | edge env url for this instance                        | dev0.edge-preprod.dev       |
    65| platform-infra-gcp-project-id | gcp project id for the instance group's infra project | ret-edge-pltf-infra |
    66| tenants-gcp-folder-id         | gcp folder id for the instance's tenants folder       | 169927670984                |

View as plain text