Skip to content

Alternative ways to setup On Site WebCSD

Eva Myers edited this page Nov 4, 2022 · 9 revisions

Running On-Site WebCSD under SSL

As this is optional, we recommend following a similar process to that described in the database configuration and user interface customisation sections. Which is to store these settings in a separate docker-compose file. You can then include this file in your startup command.

To run WebCSD using HTTPS, you will need to do the following:

  1. Obtain a certificate and store it in a folder that can be referenced in the volumes section (path/to/certificate).

  2. Update the following sections of the webcsd service in your docker-compose file to add HTTPS support. An example of what to add and in which section, is shown below:

  webcsd:
    environment:
      - ASPNETCORE_URLS=https://+:443;http://+:80
      - ASPNETCORE_Kestrel__Certificates__Default__Password=<password used to create certificate>
      - ASPNETCORE_Kestrel__Certificates__Default__Path=/container/path/certificate.pfx

    ports:
      - 443:443

    volumes:
      - /path/to/certificate:/container/path:ro   # with read-only attributes (:ro)

Storing the docker images in your local repository

If you want to store the docker images in your own repository follow the below steps:

  1. Get a copy of this git repository as in the Prerequisites section above.

  2. Run the below command to download the docker images

docker-compose pull
  1. For each docker image run "docker tag <oldrepo/service:version> <newrepo/service:version>" e.g.
docker tag ccdcrepository.azurecr.io/webcsd:0.1.6  my.internal.registry/webcsd:0.1.6
  1. Run "docker push <newrepo/service:version>" e.g.
docker push my.internal.registry/webcsd:0.1.6
  1. Create a new docker-compose file to keep your image overrides separate and avoid them being reverted in updates e.g. "docker-compose.service-config.yml". The file will need to contain the new image location for each service copied into a new location. e.g.
version: '3.6'

services:
  webcsdbackend:
    image: my.internal.registry/webcsdbackend:0.1.6

  webcsd:
    image: my.internal.registry/webcsd:0.1.6

  database-server:
    image: my.internal.registry/csd-database:2022.1.0.alpha1

...
etc
  1. Include the new file in the startup command, so if you are also using local database configurations the command will be:
docker-compose -f docker-compose.yml -f docker-compose.db-config.yml -f docker-compose.service-config.yml up -d

Please note that process will need to be repeated to copy further updates to your local repository.

Kubernetes support

Kubernetes will not be a supported platform however we have provided instructions on what to do to use it.

If you wish to run WebCSD in a Kubernetes environment you can use the kompose tool. Kompose takes Docker Compose files and translates them into Kubernetes resources. More information can be found here:

Github: https://github.com/kubernetes/kompose

Website: https://kompose.io/

There are a few steps that you will need to follow, to complete your implementation.

1. Create a pull secret

kubectl create secret docker-registry pullsecret --docker-server=ccdcrepository.azurecr.io --docker-username=<your-token-name> --docker-password=<token-password> --docker-email=<your-email>

Where pullsecret is the name given to the pull secret referenced in the docker-compose file. If you choose a different name, you will need to update the kompose.image-pull-secret label in the x-labels section at the top of the docker-compose file.

2. Replace all ${XXX_YYY} variables in the docker-compose file with their actual values

  • ${CSD_DB_PASSWORD}
  • ${CSD_CACHE_PASSWORD}
  • ${CCDC_LICENSING_CONFIGURATION}

3. Run the kompose tool to convert docker-compose files

kompose -f docker-compose.yml [-f docker-mycustomisations.yml] convert

This should output a bunch of yaml files defining all the kubernetes resources.

4. Start everything up

kubectl apply -f .

To check everything is working:

kubectl get all

At this point you should be able to navigate to the site's home page and searching the CSD should return results. To get all your in-house and supporting data into the pods, carry on to the next step.

5. Copy all your required files to the relevant pods.

To get a list of the pods, as you will need their names:

kubectl get pods
  1. Copy OnSite database files to the webcsdbackend pod
kubectl cp .\csd-data\. <webcsdbackend-POD>:/csd-data/

Note: If you are using WebCSD-Theory, include your CSD Landscape database.

  1. If you are using WebCSD-Theory, copy the database files to the webcsd-theory pod
kubectl cp .\csd-data\CSPLandscape.csdsqlx [webcsd-theory-POD]:/app/databases/
kubectl cp .\csp-data\CSPDatabase.db [webcsd-theory-POD]:/app/
  1. If you are using structure link files Copy the structure links (CSV) file to the webcsdbackend pod (if not already done as part of copying database files in 5.1)
kubectl cp .\csd-data\structure-links.csv [webcsdbackend-POD]:/csd-data/

Copy all structure link files to the webcsd pod

kubectl cp .\structure-files\. <webcsd-POD>:/structure-files
Clone this wiki locally