Skip to main content
Feedback

Importing Seed Data (applicable to LE 6.0.0 only)

important

This file is intended solely for use with LE v6.0.0. This topic was included in LE v6.0.0, but has been deprecated and removed as of LE v6.1.0.

This step is only needed for base installation of Local Edition and can be skipped if you are migrating from a previous version of Local Edition.

Seed data provides initial configuration, policy definitions and other data required for to Local Edition function. Steps explained here use the Local Edition toolkit image. The toolkit image has a pre-packaged MySQL client and you can choose not to use the toolkit container for importing data. You can find the MySQL script files in <extract location>/scripts folder

Before you begin

If toolkit container is not running, start toolkit container.

#replace v6.0.0 if you have changed the tag during image build

$ kubectl run -it --image=<registry>/[repository]/apim-le-toolkit:<tag> toolkit

Procedure

  1. Optional: Copy certs and keys to toolkit container.

    kubectl cp <extract-location>/samples/database/db-ca.pem toolkit:/opt/apim/db

    kubectl cp <extract-location>/samples/database/db-client-cert.pem toolkit:/opt/apim/db

    kubectl cp <extract-location>/samples/database/db-client-key.pem toolkit:/opt/apim/db
  2. Modify the following property in /deploy/charts/configui/values.yaml:

    mlc_oauth_scope: "41a96952-ab9f-4abe-a2c8-e096c63324db"

  3. Optional: Do this step only when you need to customize the seed data. This step generates random UUIDs for Local Edition.

    I have no name!@toolkit:/$ cd /opt/apim/db

    I have no name!@toolkit:/$ customize-papi-properties.sh --domain_suffix <YOUR_DOMAIN_SUFFIX> --area_name <YOUR_AREA_NAME> --localdevadmin <YOUR_LOCAL_DEV_ADMIN_NAME>

    Retain a temporary copy of the customized data as it is needed for setting up Helm values and secrets.

    1. Modify the following property in deploy/charts/configui/values.yaml:

      mlc_oauth_scope: "Value of areas_customer_area_uuid found in apim-le-papi-properties.json"
    2. Modify the following properties in deploy/values.yaml:

      domainSuffix : YOUR_DOMAIN_SUFFIX
    3. Modify the following property in deploy/charts/configui/values.yaml:

      adminuser : YOUR_LOCAL_DEV_ADMIN_NAME	
    4. Modify the following properties in samples/configui/configui-secrets.yaml:

      .mlc_apikey: THE_VALUE_OF_your_api_key_for_v3_api_IN_apim-le-papi-properties.json.
      mlc_apisecret: THE_VALUE_OF_your_secret_for_v3_api_IN_apim-le-papi-properties.json
      note

      You must encode these values either with base64 or encrypt with apiml_crypto as per your choice.

  4. Create seed data SQL file.

    I have no name!@toolkit:/$ cd /opt/apim/db
    I have no name!@toolkit:/$ instantiate-seeds-template.sh
  5. Run the following MySQL scripts:

    I have no name!@toolkit:/$ cd /opt/apim/db
    I have no name!@toolkit:/$ export MYSQL_SERVICE_HOST=<FQDN or IP address of MySQL database server>
    I have no name!@toolkit:/$ export MYSQL_USER=<db user - default masheryonprem>
    I have no name!@toolkit:/$ export MYSQL_PWD=<database password>
    I have no name!@toolkit:/$ export MYSQL_DB=<database name | default masherysolar>
    I have no name!@toolkit:/$ export MYSQL_PORT=<database port | default 3306>
    # Clear screen to remove password from screen
    I have no name!@toolkit:/$ tput clear
    I have no name!@toolkit:/$ MYSQL_PWD=$MYSQL_PWD mysql -h $MYSQL_SERVICE_HOST -u$MYSQL_USER -P$MYSQL_PORT --database=name $MYSQL_DB < apim-le-db-data_6.0.0.sql
    I have no name!@toolkit:/$ MYSQL_PWD=$MYSQL_PWD mysql -h $MYSQL_SERVICE_HOST -u$MYSQL_USER -P$MYSQL_PORT --database=name $MYSQL_DB < apim-le-db-seeds_6.0.0.sql
    I have no name!@toolkit:/$ MYSQL_PWD=$MYSQL_PWD mysql -h $MYSQL_SERVICE_HOST -u$MYSQL_USER -P$MYSQL_PORT --database=name $MYSQL_DB < apim-le-db-token-purger-data_6.0.0.sql
    I have no name!@toolkit:/$ MYSQL_PWD=$MYSQL_PWD mysql -h $MYSQL_SERVICE_HOST -u$MYSQL_USER -P$MYSQL_PORT --database=name $MYSQL_DB < apim-le-db-token-purger-event_6.0.0.sql
    I have no name!@toolkit:/$ MYSQL_PWD=$MYSQL_PWD mysql -h $MYSQL_SERVICE_HOST -u$MYSQL_USER -P$MYSQL_PORT --database=name $MYSQL_DB < apim-le-db-expired-key-event_6.0.0.sql
On this Page