Private access (VPN only)

Make the portal reachable only from your VPN or company network.

Maintained by Solvia Lab s.r.o. · Updated

On this page

Infrayard holds credentials that can create and delete infrastructure in your OCI tenancy. We strongly recommend that the portal is reachable only from your company network or VPN, not from the whole internet. Infrayard does not restrict network access by itself: this is part of your network setup, and this page shows the usual ways to do it.

Keep in mind what still has to work:

  • Inbound: users on the VPN reach the portal on port 443. With the bundled Keycloak, sign-in runs on the same address under /auth, so it becomes private too.
  • Outbound from Infrayard: OCI APIs, the image registry, and the Kubernetes API (port 6443) of every cluster it creates. A NAT gateway or your proxy path is enough; Infrayard needs no inbound connection from the internet.
  • Clusters: users need a route from the VPN to the Kubernetes API of their clusters to use kubectl. See Kubernetes API access.

The portal gets an IP address inside your VCN and has no public IP at all. The VPN reaches the VCN through a dynamic routing gateway (Site-to-Site VPN or FastConnect) or through a VPN server in the VCN.

OKE with Traefik: install Traefik with an internal load balancer in a private subnet. OCI does not change an existing load balancer from public to private: if Traefik already runs with a public one, remove it first with helm uninstall traefik -n traefik. The new load balancer receives a private IP.

helm install traefik traefik/traefik -n traefik --create-namespace \
  --set-string service.annotations."service\.beta\.kubernetes\.io/oci-load-balancer-internal"=true \
  --set-string service.annotations."service\.beta\.kubernetes\.io/oci-load-balancer-subnet1"=<private-subnet-ocid> \
  --set-string service.annotations."service\.beta\.kubernetes\.io/oci-load-balancer-shape"=flexible \
  --set-string service.annotations."service\.beta\.kubernetes\.io/oci-load-balancer-shape-flex-min"=10 \
  --set-string service.annotations."service\.beta\.kubernetes\.io/oci-load-balancer-shape-flex-max"=100

Annotations must be strings; with --set, Helm reads true and the numbers as other types and the install fails.

Other Kubernetes distributions: use your platform's internal load balancer, or expose the ingress controller only on the nodes' private addresses.

k3s on a single VM: create the VM in a private subnet without a public IP. Give the subnet a NAT gateway for outbound traffic.

Option B: public address with an allowlist#

The portal keeps its public IP, but only your VPN's egress addresses may connect. In OCI, add an ingress rule for TCP 443 (and 80) from your VPN CIDR ranges only, in the network security group or security list of the load balancer or the VM, and remove any rule that allows 0.0.0.0/0.

This is quicker to set up but depends on the VPN's public addresses staying the same.

Certificates for a private portal#

Let's Encrypt's standard check (HTTP-01) connects to your portal from the internet, so it fails once the portal is private. Choose one of these:

Certificate How
From your company CA kubectl create secret tls infrayard-tls -n infrayard --cert=fullchain.pem --key=privkey.pem and remove the cert-manager.io/cluster-issuer annotation from the values
Let's Encrypt with a DNS check (DNS-01) A cert-manager ClusterIssuer with a DNS-01 solver for your DNS provider

A company CA certificate must be trusted on users' devices; for a public DNS-01 certificate nothing extra is needed. Renew company CA certificates before they expire: Infrayard does not do that for you.

DNS#

Point infrayard.example.com to the private IP in your internal DNS, for example a private view in OCI DNS or your company DNS that VPN clients use. A public DNS record with a private IP also works, but it publishes the internal address.

Keycloak admin console on a private portal#

The bundled Keycloak's admin console and master realm answer 404 on the portal address, so administrators open them with kubectl port-forward. When the portal is reachable only from your VPN, you can serve the console on the portal address instead:

keycloak:
  exposeAdminConsole: true

After helm upgrade, the console is at https://infrayard.example.com/auth/admin/. Sign in as admin with the Keycloak master admin password from secrets.yaml. Leave the value false for a portal that is reachable from the internet: the master realm would then accept password guesses for the account that controls all of Keycloak.

Your own Keycloak#

If you use your own Keycloak, users' browsers must reach it from the VPN, and the Infrayard API must reach it from the cluster. If the API sees Keycloak under a different internal address, set api.oidc.internalUrl.

Cluster API endpoints#

Clusters created by Infrayard can use a private Kubernetes API endpoint or a public one restricted to allowed source ranges. With a restricted public endpoint, add the VPN's egress ranges and Infrayard's own outbound address to Allowed API CIDRs in Admin → Configuration → OCI Settings; Infrayard calls the cluster API to issue kubeconfigs. With a private endpoint, the VPN needs a route into each cluster VCN, for example through a DRG, and its ranges belong in Allowed API CIDRs too, with Infrayard's own range when the portal runs outside the cluster VCN. When the VPN ranges change, update the list: existing clusters take it at their next Scale or Upgrade. See networking.

Check it#

From a machine outside the VPN, the portal must not answer:

curl -m 10 -sS -o /dev/null https://infrayard.example.com && echo "STILL PUBLIC"

From the VPN, it must load and sign-in must work. Then create a test cluster and download its kubeconfig to confirm that Infrayard still reaches OCI and the cluster API.