Run script to prepare for k8s deployment
The Sitecore container deployment package provides scripts for automating some of the preparations for Sitecore deployment to a developer machine. The k8s-init.ps1 and k8s-init-upgrade.ps1 files are located with the secrets and configmaps folders.
The k8s-init.ps1 file performs the following actions:
- compresses the Sitecore license fileâ¯
- creates the Identity Server token signing certificateâ¯Â
- populates the secrets folderâ¯Â
- updates the configmaps hostname filesÂ
- generates TLS/HTTPS certificatesâ¯Â
- installs the root certificate into your Trusted Root Certification Authoritiesâ¯Â
- updates Windows host names
The k8s-init-upgrade.ps1 file performs the following actions:
- compresses the Sitecore license fileâ¯
- populates the secrets folder
The scripts accept a number of parameters. The following table shows the parameters you can use.
| Parameter | Description | Example | Mandatory |
|---|---|---|---|
| LicenseXmlPath | Path to the Sitecore license file. You must specify this. | -LicenseXmlPath "c:\license.xml" | Yes |
| Topology | The name of your chosen topology | -Topology "XM1" | No |
| IdHost | A custom host name for the Identity Server | -IdHost mySCID_1 | No |
| CdHost | A custom host name for the CD server | -CdHost mySCCD_1 | No |
| CmHost | A custom host name for the CM server | -CmHost mySCCM_1 | No |
| ExternalIPAddress | EXTERNAL-IP address for the ingress | -ExternalIPAddress 52.236.147.141 | Yes |
| SecretsFolderPath | Path to the folder where the secrets (*.txt files) are located. Specify this if the secrets are not located in .\secrets. Â For upgrade specify this if the secrets are not located in .\configuration. | -SecretsFolderPath "c:\k8s\ secrets" | No |
| CertDataFolder | Path to the folder where the TLS certificates are located. Specify this if the certificates are not located in .\secrets\tls | -CertDataFolder "c:\k8s\ secrets\tls" | No |
| ConfigmapsDataFolder | Path to the folder where the hostname files for cd, cm, id are located. Specify this if the certificates are not located in .\configmaps | -ConfigmapsDataFolder "c:\k8s\configmaps" | No |
| SitecoreAdminPassword | A custom password for the admin user | -SitecoreAdminPassword df8732V45GH | Yes |
| SqlServer | Name of the Sql server instance | -SqlServer âmssqlâ | No |
| SqlUserName | Name of the user of sql server | -SqlUserName âsaâ | Yes |
| SqlUserPassword | A custom password for the SQL server user | -SqlUserPassword poi34l2xGH45 | Yes |
| SqlCoreDatabasePassword | A custom password for the Core database | -SqlCoreDatabasePassword poi34l2xGH45 | No |
| SqlFormsDatabasePassword | A custom password for the Forms database | -SqlFormsDatabasePassword poi34l2xGH45 | No |
| SqlMasterDatabasePassword | A custom password for the Master database | -SqlMasterDatabasePassword poi34l2xGH45 | No |
| SqlWebDatabasePassword | A custom password for the Web database | -SqlWebDatabasePassword poi34l2xGH45 | No |
| SqlCollectionShardmapmanagerDatabasePassword | A custom password for the CollectionShardmapmanager database | -SqlCollectionShardmapmanagerDatabasePassword poi34l2xGH45 | No |
| SqlExmMasterDatabasePassword | A custom password for the ExmMaster database. | -SqlExmMasterDatabasePassword poi34l2xGH45 | No |
| SqlMarketingAutomationDatabasePassword | A custom password for the MarketingAutomation database | -SqlMarketingAutomationDatabasePassword poi34l2xGH45 | No |
| SqlMessagingDatabasePassword | A custom password for the Messaging database | -SqlMessagingDatabasePassword poi34l2xGH45 | No |
| SqlProcessingEngineStorageDatabasePassword | A custom password for the ProcessingEngineStorage database | -SqlProcessingEngineStorageDatabasePassword poi34l2xGH45 | No |
| SqlProcessingEngineTasksDatabasePassword | A custom password for the ProcessingEngineTasks database | -SqlProcessingEngineTasksDatabasePassword poi34l2xGH45 | No |
| SqlProcessingPoolsDatabasePassword | A custom password for the ProcessingPools database | -SqlProcessingPoolsDatabasePassword poi34l2xGH45 | No |
| SqlProcessingTasksDatabasePassword | A custom password for the ProcessingTasks database | -SqlProcessingTasksDatabasePassword poi34l2xGH45 | No |
| SqlReferenceDataDatabasePassword | Acustom password for the ReferenceData database | -SqlReferenceDataDatabasePassword poi34l2xGH45 | No |
| SqlReportingDatabasePassword | A custom password for the Reporting database | -SqlReportingDatabasePassword poi34l2xGH45 | No |
| IsAlwaysEncrypted | Option for sql server which allows using of encryption (only for upgrade folder) | -IsAlwaysEncrypted $false | No |
| ProcessingEngineTasksDatabaseUserName | Name of the least privileged user in database (only for upgrade folder) | -ProcessingEngineTasksDatabaseUsernameâ¯Â âdboâ | No |
| SitecoreGalleryRepositoryLocation | Path to the location of the Sitecore Gallery repository. Specify this if you are not using the official repository | - SitecoreGalleryRepositoryLocation "https:\<path_to_repository>" | No |
| SpecificVersion | Define and install the specific version for SitecoreDockerTools module | -SpecificVersion âspecific versionâ | No |
| SqlServerCertificatePassword | Password set for certificate created for SqlServer | -SqlServerCertificatePassword df8732V45GH | No |
| SolrAdminUserName | Admin Username used in Solr | -SolrAdminUsername admin | No |
| SolrAdminPassword | Admin Password used in Solr | -SolrAdminPassword df8732V45GH | Yes |
| SolrConnectionUserName | UserName for user used in connection of Sitecore to Solr | -SolrConnectionUserName sitecore | No |
| SolrConnectionPassword | Password for user used in connection of Sitecore to Solr | -SolrConnectionPassword df8732V45GH | Yes |
| SolrProtocol | Http/Https used to connect to the Solr Instance | -SolrProtocol âhttpâ | No |
| SolrInstance | Host name / instance name of Solr | -SorlInstance âsolrâ | No |
| SolrPort | Port of Solr | -SolrPort 8983 | No |
To use the script:
-
Open a Windows PowerShell console (or the ISE) with administrator access (for now, supporting PowerShell version is 5.X). Navigate to the folder containing the k8s-init.ps1 or k8s-init-upgrade.ps1 file.
-
Run the script. For example:
If your TLS certificates folder (â.\secrets\tlsâ) already contains certificates the script does not install new certificates.
If a custom password for specific databases (core, master, web etc.) is empty, then the random password will be set for the specific user.