CorfedoCorfedoDocs

Install on Kubernetes

Install Corfedo on a Kubernetes cluster with the Helm chart, from the Secrets and the values file to the setup Job and the setup page.

Install Corfedo on a Kubernetes cluster with its Helm chart. To run Corfedo on one machine, install on a single host.

Before you begin

  • A cluster prepared for Corfedo.
  • kubectl and Helm on your machine.
  • A host name for Corfedo, such as corfedo.example.com.
  • Your organization's identity provider. The setup page shows the callback address to register there.

Create the Secrets

Create these Secrets in the release's namespace before you install. Their names start with the release name, here corfedo.

SecretHoldsComes from
corfedo-databaseThe passwords of the six database logins, one key per loginThe passwords you set in PostgreSQL
corfedo-storage, corfedo-search-storage, corfedo-indexer-storageThe bucket's access key for the platform roles, the search nodes and the indexers, as credentials.jsonYour object storage

The trust bundle is a ConfigMap with the workload issuer's CA certificate, as ca.crt.

Run the commands in a new directory that only you can read. Each file has the name of its key.

kubectl create namespace corfedo

# One file per login with the password you set in PostgreSQL:
# migrator, runtime, authentication, issuer, validation, webhooks
kubectl create secret generic corfedo-database --namespace corfedo \
  --from-file=migrator --from-file=runtime --from-file=authentication \
  --from-file=issuer --from-file=validation --from-file=webhooks

# credentials.json: {"access_key": "...", "secret_key": "..."}
for name in corfedo-storage corfedo-search-storage corfedo-indexer-storage; do
  kubectl create secret generic "$name" --namespace corfedo --from-file=credentials.json
done

kubectl create configmap corfedo-workload-trust --namespace corfedo --from-file=ca.crt

Then remove the directory.

Keys and the setup secret

The install creates three more Secrets with random values unless they exist: corfedo-keys encrypts the credentials saved in Settings, corfedo-oauth signs the clients' access tokens and corfedo-setup holds the setup secret. helm uninstall keeps them. Back them up with the database.

To use your own Secrets, name them in the values file, both OAuth values together. Corfedo never changes them. A rendering without hooks, such as helm template --no-hooks or helm template | kubectl apply, names all three.

secrets:
  keyDirectory: {name: acme-keys}
  oauth:
    keySet: {name: acme-oauth}
    verificationKeySet: {name: acme-oauth}
  setup: {name: acme-setup}

Write the values file

Save this as values.yaml and replace the example values. helm show values prints every value with its description.

# The platform and engine images of the release you install.
image:
  platform:
    repository: ghcr.io/corfedo/corfedo-platform
    tag: PLATFORM_VERSION
  engine:
    repository: ghcr.io/corfedo/corfedo-search
    tag: ENGINE_VERSION

hosting:
  # One workspace at one address.
  mode: SingleTenant
  publicOrigin: https://corfedo.example.com/
  # The network the ingress controller's pods forward requests from.
  trustedProxies: [10.42.0.0/16]

database:
  host: postgres.example.com
  # The server's max_connections.
  maxConnections: 700

storage:
  s3:
    # An empty bucket that no other installation uses.
    # To share a bucket, set prefix to an empty prefix for this installation.
    bucket: corfedo-example
    region: eu-central-1
    # For an S3-compatible service other than AWS:
    # serviceUrl: https://objects.example.com
    # forcePathStyle: true
  # The GiB of the bucket that indexes may use, 16 or more.
  budgetGiB: 100

ingress:
  enabled: true
  className: nginx
  # The HTTPS certificate, see below.

networkPolicy:
  # The pods that may send public requests to Corfedo: your ingress controller's.
  ingressFrom:
    - namespaceSelector:
        matchLabels:
          kubernetes.io/metadata.name: ingress-nginx
      podSelector:
        matchLabels:
          app.kubernetes.io/name: ingress-nginx

workload:
  # A name for the identities in this installation's workload certificates.
  trustDomain: corfedo.example.com
  # The issuer of the workload certificates and the ConfigMap with its CA certificate.
  issuerRef: {name: corfedo-workload, kind: ClusterIssuer}
  trustBundle: {name: corfedo-workload-trust}

# The volume of each search node and of each indexer.
search:
  volume:
    size: 8Gi
indexer:
  volume:
    size: 20Gi

Then add the values for the host name's certificate from HTTPS certificate.

Install

helm install corfedo oci://ghcr.io/corfedo/charts/corfedo --version CHART_VERSION \
  --namespace corfedo --values values.yaml

helm install stops with a message when a required value is missing or database.maxConnections is too low for the replicas, see PostgreSQL.

Check the result

The setup Job prepares the database and the bucket. The other pods restart until it has completed. The installation is complete when every workload is ready too.

kubectl wait job --namespace corfedo \
  --selector app.kubernetes.io/instance=corfedo,corfedo.ai/job=setup \
  --for=condition=complete --timeout=15m
kubectl rollout status deployment,statefulset --namespace corfedo \
  --selector app.kubernetes.io/instance=corfedo --timeout=15m
kubectl get pods --namespace corfedo

Every pod is Running and ready, and the setup pod is Completed. For a pod that stays in ContainerCreating, the events at the end of kubectl describe pod name what it waits for. For its workload certificate, kubectl get certificaterequest --namespace corfedo shows whether the request was denied.

When the setup pod fails at the storage step, these logs say why, with --previous after a restart.

kubectl logs --namespace corfedo -c artifact-storage-configure \
  --selector app.kubernetes.io/instance=corfedo,app.kubernetes.io/component=setup
What you seeWhyWhat to do
… is not empty and has no markerThe bucket or prefix holds other objectsUse an empty one
The storage holds the marker of another installationIt is another installation's storageUse an unused bucket or prefix
… lies inside the storage at …The prefix is inside another installation's storageUse a prefix outside it
Shared storage refused the request (403 …)The platform's key lacks a right, often the bucket listingGrant the rights of Object storage

Evaluate without your own database and identity provider

postgresql.enabled and keycloak.enabled add a PostgreSQL server and Keycloak as the account service to the release, each one instance without replication or backup, for evaluation only. helm show values describes their Secrets and values. With postgresql.enabled, remove database.host.

Next step

Follow Set up your workspace at https://corfedo.example.com/setup. Under Sign-in connection, enter your identity provider's application as Sign-in describes. This command prints the setup secret. With your own setup Secret, use its name and key:

kubectl get secret corfedo-setup --namespace corfedo -o jsonpath='{.data.setup-secret}' | base64 -d

On this page