Skip to main content

Oracle Cloud Infrastructure

Account Information

Cloud Account Name: medapsisempresa

Credentials and 2FA are stored in pass:

  • Email: PASSWORD_STORE_DIR=~/projects/medapsis/pass pass oracle/email
  • Password: PASSWORD_STORE_DIR=~/projects/medapsis/pass pass oracle/password
  • OTP: PASSWORD_STORE_DIR=~/projects/medapsis/pass pass otp oracle/otp

k0s Kubernetes Cluster

We leverage Oracle's free tier components to deploy a lightweight k0s Kubernetes cluster.

Infrastructure Management

All cloud resources are managed using Infrastructure as Code (IaC) with Terraform.

Repository: https://github.com/Zytera/infra

Prerequisites

Before working with the infrastructure, ensure you have:

  • Terraform: Version 1.12 or higher
  • OCI CLI: Install from oracle/oci-cli
  • OCI Authentication: Configure your session:
    oci session authenticate --region eu-madrid-1 --profile-name tf
  • Age Secret Key: Set up encryption key for sensitive data:
    PASSWORD_STORE_DIR=~/projects/medapsis/pass pass show ci/age-secret-key > ~/projects/medapsis/key.txt
    export SOPS_AGE_KEY_FILE=~/projects/medapsis/key.txt

Working with Terraform

To manage the infrastructure:

# Clone the infrastructure repository
git clone git@github.com:Zytera/infra.git
cd infra/oci

# Initialize Terraform
terraform init

# Review planned changes
terraform plan

# Apply changes (when ready)
terraform apply

SSH Access

The SSH private key is securely stored in pass. To retrieve it:

PASSWORD_STORE_DIR=~/projects/medapsis/pass pass ssh-private-key

The public IP address is available as a Terraform output after deployment.

k0s Cluster Management

Deploying or Upgrading the Cluster

To deploy or upgrade the k0s cluster, use the k0sctl tool:

k0sctl apply -f k0sctl.yaml

Note: Ensure the k0sctl.yaml file contains the correct configuration for your deployment.

Kubernetes API Access

Go to documentation here

ArgoCD - GitOps Deployment

The k0s cluster includes a pre-configured ArgoCD instance for GitOps-based deployments.

First-Time Access

  1. Navigate to https://argocd.medapsis.com
  2. Click "Log in via GitHub"
  3. Authorize the application if prompted
  4. You'll be automatically granted access if you're a Zytera member

Troubleshooting

Common Issues

OCI CLI Authentication Expired

If your OCI session expires, re-authenticate:

oci session authenticate --region eu-madrid-1 --profile-name tf

Terraform State Lock

If Terraform state is locked, verify no other operations are running, then:

terraform force-unlock <LOCK_ID>

k0s Cluster Connection Issues

  1. Verify the instance is running in Oracle Console
  2. Check your SSH key is correct
  3. Ensure the public IP hasn't changed (check Terraform outputs)

Security Considerations

  • All credentials are stored encrypted using pass
  • The Kubernetes API is not exposed to the internet
  • ArgoCD uses GitHub OAuth for authentication
  • Infrastructure changes require Terraform authentication
  • SSH access is key-based only (no password authentication)

Support and Documentation