Importing Seed Data (applicable to LE 6.0.0 only)
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
-
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 -
Modify the following property in
/deploy/charts/configui/values.yaml:mlc_oauth_scope: "41a96952-ab9f-4abe-a2c8-e096c63324db" -
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.
-
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" -
Modify the following properties in
deploy/values.yaml:domainSuffix : YOUR_DOMAIN_SUFFIX -
Modify the following property in
deploy/charts/configui/values.yaml:adminuser : YOUR_LOCAL_DEV_ADMIN_NAME -
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.jsonnoteYou must encode these values either with base64 or encrypt with
apiml_cryptoas per your choice.
-
-
Create seed data SQL file.
I have no name!@toolkit:/$ cd /opt/apim/db
I have no name!@toolkit:/$ instantiate-seeds-template.sh -
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