Kubernetes Deployments
If you are using a non-local Kubernetes cluster, the images should be deployed to a registry accessible to it.
Prerequisites
The current guide assumes you have a working Kubernetes cluster and access it via kubectl and a bash terminal.
If using the AWS Elasticsearch service, skip the Elasticsearch/Kibana section and modify the Aspire ConfigMap section according to this page:Properties.
Step-by-step guide
Deploy Elasticsearch and Kibana.
Skip these steps if you already have an Elasticsearch cluster for Aspire to use and go directly to Deploying Aspire 5.
The guide below is based on ECK quickstart. If you need a production deployment or a more detailed process description, please refer to:
Run Elasticsearch on ECK | Elastic Cloud on Kubernetes [master] | Elastic
Node configuration | Elastic Cloud on Kubernetes [master] | Elastic
Install custom resource definitions
kubectl create -f https://download.elastic.co/downloads/eck/1.7.0/crds.yaml kubectl apply -f https://download.elastic.co/downloads/eck/1.7.0/operator.yamlDeploy Elasticsearch cluster (single node)
Create a file called elasticsearch.yaml
elasticsearch.yaml
apiVersion: elasticsearch.k8s.elastic.co/v1 kind: Elasticsearch metadata: name: quickstart spec: version: 7.9.2 nodeSets: - name: default count: 1 config: node.store.allow_mmap: falseDeploy the Elasticsearch cluster
kubectl apply -f elasticsearch.yaml
Obtain Basic Authentication password
The password will be stored in the environment variable called "PASSWORD"
PASSWORD=$(kubectl get secret quickstart-es-elastic-user -o go-template='{{.data.elastic | base64decode}}')
Deploy Kibana cluster
Create a file called kibana.yaml
kibana.yaml
apiVersion: kibana.k8s.elastic.co/v1 kind: Kibana metadata: name: quickstart spec: version: 7.9.2 count: 1 elasticsearchRef: name: quickstartDeploy Kibana
kubectl apply -f kibana.yaml
Expose Kibana's port locally
kubectl port-forward service/quickstart-kb-http 5601Browse to Kibana at https://localhost:5601/ (HTTPS warnings will appear on the browser due to the self-signed certificates Elasticsearch and Kibana generates)
Log in using the username "elastic" and the password obtained at step #3.
Deploy Aspire 5
(Optional) Upload Kibana Dashboards
Download export.ndjson
Kibana's port should be forwarded into localhost:5601 as of Step #6 on the Elasticsearch deployment instructions
The environment variable $PASSWORD should hold the elastic's user password as of Step #3 on the Elasticsearch deployment instructions.
curl -u "elastic:$PASSWORD" -k -F 'file=@/path/to/export.ndjson' \ -H 'kbn-xsrf:reporting' \ "https://localhost:5601/api/saved_objects/_import?overwrite=true"
Create the Kubernetes secret for connecting to the SCA Docker registry
Replace <EMAIL> and <PASSWORD> with your registered email and password
kubectl create secret docker-registry regcred \ --docker-server=accenturesca.jfrog.io \ --docker-username=<EMAIL> \ --docker-password=<PASSWORD>\ --docker-email=<EMAIL>
Create Aspire ConfigMap
Holds common configuration options for your Aspire 5 deployment.
Create a file called aspire-config.yaml
The com_accenture_aspire_ssl_trustAll is not recommended to be set as true in production environments, the recommended way is to import the untrusted certificate into a Java Key Store (see /wiki/spaces/aspire/pages/68560356) and then importing using the com_accenture_aspire_ssl_truststore_file property (see SSL Certificates Properties).
Deploy ConfigMap
kubectl apply -f aspire-config.yaml
Upload License and Settings to Elasticsearch
Create a secret containing your settings.json and AspireLicense.lic files
kubectl create secret generic aspire-license-settings \ --from-file=/path/to/AspireLicense.lic \ --from-file=/path/to/config/settings.jsonCreate a file called aspire-upload-job.yaml
When using a non local kubernetes cluster, make sure to change the image url to where the images are hosted.
Run job
kubectl apply -f aspire-upload-job.yamlWait until it has uploaded the files
kubectl get pods | grep aspire-upload | awk '{print $1}' | xargs kubectl logs -f
Create the Kubernetes secret for the Aspire cluster-wide encryption key
Create a random 32-bytes file, which will be your key
head -c 32 /dev/urandom > encryption.keyCreate the secret using the encryption.key file
kubectl create secret generic aspire-encryption-key --from-file=encryption.key
(Optional) Generate TLS Certificates for the Admin UI and REST Endpoints
Obtain certificates or generate self-signed certificates. Follow the steps at Configuring Certificates for steps on doing this. Also make sure to generate a Java Keystore with the certificates.
Create 2 certificates, one for each FQDN of each subdomain:
*.aspire-managers.default.svc.cluster.local → import it into managers.jks
Certificate to use for all manager nodes
*.aspire-workers.default.svc.cluster → import it into workers.jks
Certificate to use for all worker nodes
If you have custom certificates, just import them into a Java keystore. If the certificates are trusted, the CA's certificates are not needed.
Create the Kubernetes ConfigMap holding the CA and Java Keystore with the certificate for the Aspire servers
kubectl create secret generic aspire-encryption-key --from-file=encryption.key --from-file myKeystore.jks
Deploy Managers
Create a file called aspire-managers.yaml
Deploy managers
kubectl apply -f aspire-managers.yaml
Deploy Workers
Create a file called aspire-workers.yaml
Deploy workers
kubectl apply -f aspire-workers.yaml
Expose Manager port
kubectl port-forward pod/aspire-manager-0 50505Browse to the Aspire Admin UI at http://localhost:50505