Intel Provisioning Certificate Caching Service (PCCS) for caching collaterals required for quote generation and quote verification.
Ensure you have the following tools installed before proceeding:
Before deploying PCCS, make sure you are connected to the target Kubernetes cluster. You can either create a new cluster (e.g., using k3d) or point your environment to an existing one by setting the KUBECONFIG variable.
To create a new local cluster with k3d, run:
k3d cluster create pccs-cluster \
--agents 2 \
-p "80:80@loadbalancer" \
-p "443:443@loadbalancer" \
--k3s-arg "--disable=traefik@server:0"π‘ Tip: If you already have a cluster, simply set your environment to use it:
export KUBECONFIG=/path/to/your/cluster/kubeconfig
Clone the repository and navigate to the project directory:
git clone https://github.com/scontain/cc-intel-pccs.git
cd cc-intel-pccsPCCS requires cert-manager to issue TLS certificates. You must install cert-manager and its CRDs before deploying PCCS.
π‘ Tip: If cert-manager is already installed in your cluster, you do not need to reinstall it. Instead, simply point your PCCS
values.yamlto the existing cert-manager instance by configuring the following section:# values.yaml certManager: # Enables automatic TLS certificate management via cert-manager enabled: true # Configuration for the ACME certificate issuer issuer: # The name used to identify this cert-manager Issuer or ClusterIssuer name: "pccs-issuer" # The type of issuer to create. Supported values: # - "acme": Use ACME protocol (e.g., Let's Encrypt) to obtain certificates. # - "selfSigned": Create a self-signed issuer for local or testing use. type: selfSigned # URL of the ACME server to use for issuing certificates (only used if type is "acme"). # Use Let's Encrypt staging URL for testing: # https://acme-staging-v02.api.letsencrypt.org/directory # Use Let's Encrypt production URL for live certificates: # https://acme-v02.api.letsencrypt.org/directory server: "https://acme-staging-v02.api.letsencrypt.org/directory" # Contact email address for certificate expiration notices and ACME registration # (only used if type is "acme"). email: "example@mymail.com"
Run the following commands:
helm repo add jetstack https://charts.jetstack.io
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm install cert-manager jetstack/cert-manager --set installCRDs=true \
--version v1.18.2 --namespace cert-manager --create-namespace
# Wait for cert-manager to be ready
kubectl rollout status deployment/cert-manager -n cert-manager --timeout=120sThis chart does not install an ingress controller. If your cluster already provides one (nginx, traefik, etc.), enable ingress and set the correct one:
helm install ... --set ingress.enabled=true --set ingress.className=<controller>For more configuration details, see the ingress section in values.yaml. If your cluster does not have an ingress controller installed, choose one of the following ways to expose the PCCS service:
-
Install an ingress controller (recommended)
Example with nginx. Remember to use the flags above when installing PCCS:
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx helm install ingress-nginx ingress-nginx/ingress-nginx
-
Expose PCCS using NodePort
service: type: NodePort nodePort: 32000
-
Development only β port-forward after deploying PCCS
kubectl port-forward -n pccs svc/pccs 8081:8081
Before deploying, you must set your Intel DCAP API key as an environment variable. If not provided, the PCCS service will fail to start and certificate retrieval will not work.
export DCAP_KEY=<your-intel-dcap-api-key>π‘ Tip: If your container images are hosted in a private registry, export the following environment variables before deploying.
export IMAGE_USERNAME=<your-docker-username> export IMAGE_PASSWORD=<your-docker-password-or-token> export IMAGE_EMAIL=<your-docker-email> export IMAGE_REGISTRY=<your-docker-registry-url> # e.g. https://index.docker.io/v1/
helm dependency build charts/pccsFor a quick deployment using default settings, run (remember that DCAP is mandatory):
helm install pccs ./charts/pccs --namespace pccs --create-namespace --wait \
--set pccsConfig.apiKey=$DCAP_KEY \For local environments (e.g., k3d), run the following command:
helm install pccs ./charts/pccs --namespace pccs --create-namespace --wait \
--set replicas=1 \
--set ingress.host=pccs.example.com \
--set pccsConfig.apiKey=$DCAP_KEY \
--set pccsConfig.logLevel=debug \
--set persistentVolumeClaim.logs.storageClassName=local-path \
--set persistentVolumeClaim.db.storageClassName=local-path \
--set imagePullSecrets.enabled=true \
--set imagePullSecrets.data.username=$IMAGE_USERNAME \
--set imagePullSecrets.data.password=$IMAGE_PASSWORD \
--set imagePullSecrets.data.email=$IMAGE_EMAIL \
--set imagePullSecrets.data.registry=$IMAGE_REGISTRYπ‘ Tip: For a full list of configurable Helm values (ingress, persistence, TLS, logging, etc.), see
charts/pccs/values.yaml.
Set up a monitoring and logging stack using Helm. This includes:
- Blackbox Exporter β External endpoint monitoring (HTTP, HTTPS, TCP, ICMP) and latency measurement
- Prometheus β Metrics collection
- Loki β Centralized log aggregation
- Grafana β Metrics and logs visualization
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo add grafana https://grafana.github.io/helm-charts
helm repo updateBefore running the command bellow, change the PCCS addres as needed.
helm install blackbox-exporter prometheus-community/prometheus-blackbox-exporter -f monitoring/blackbox-values.yaml \
--version 11.3.1 --namespace monitoring --create-namespacehelm install kube-prometheus-stack prometheus-community/kube-prometheus-stack \
--version 77.11.0 --namespace monitoring --create-namespaceThen, apply your custom probes:
kubectl apply -f monitoring/prometheus-probe.yamlhelm install loki grafana/loki -f monitoring/loki-values.yaml \
--version 6.43.0 --namespace monitoring --create-namespaceInstall Grafana using the file (remember to change user and password):
helm install grafana grafana/grafana -f monitoring/grafana-sources.yaml \
--set adminUser=admin --set adminPassword=admin \
--version 10.0.0 --namespace monitoring --create-namespacekubectl port-forward -n monitoring svc/grafana 3000:80- Open http://localhost:3000 in your browser.
- Default login:
admin/admin.
Last but not least, import the preconfigured dashboard (monitoring/grafana-dashboard.json) through the web interface to see some interesting metrics.
To interact with PCCS, use kubectl port-forward and curl:
kubectl port-forward -n pccs pod/pccs-0 8081:8081 &
curl -k https://$PCCS_URL:8081/sgx/certification/v4/rootcacrlTo allow local access using your PCCS URL, add it to /etc/hosts:
echo "127.0.0.1 $PCCS_URL" >> /etc/hosts
curl -k https://$PCCS_URL/sgx/certification/v4/rootcacrlTo remove PCCS from your cluster:
helm uninstall pccs --namespace pccs(Optional) To delete the namespace as well:
kubectl delete namespace pccsTo remove Prometheus, Grafana, and Loki:
helm uninstall kube-prometheus-stack --namespace monitoring
helm uninstall grafana --namespace monitoring
helm uninstall loki --namespace monitoring
helm uninstall blackbox-exporter --namespace monitoring
# Optionally, delete the namespace
kubectl delete namespace monitoringTo remove Cert-Manager:
helm uninstall cert-manager --namespace cert-manager
# Optionally, delete the namespace
kubectl delete namespace cert-managerCopy the sample configuration and update values as needed:
cp config.env .env
# edit .env with your preferred values
sudo su
source .envRun all tests with:
bash tests/run-all.shWhat this script does:
- Creates a temporary working directory under tests/tmp for intermediate files
- Installs required dependencies if missing
- Creates a local k3d cluster with 2 agents
- Installs cert-manager for TLS certificate management
- Deploys PCCS with Helm
- Updates /etc/hosts to map the PCCS URL locally
- Installs PCKIDRetrievalTool
- Tests platform registration and package management
- Runs PCCS API tests
To fully clean up your environment after testing, simply run:
bash ./tests/teardown.shThis script will:
- Clean up any
/etc/hostsentries related to$PCCS_URL. - Delete the k3d cluster.