Skip to content

Kubernetes Examples

Kubernetes manifests and Helm charts for Ops Atlas.

bash
# Add repository
helm repo add ops-atlas https://charts.opsatlas.io
helm repo update

# Install
helm install ops-atlas ops-atlas/ops-atlas \
  --namespace ops-atlas \
  --create-namespace \
  --set ingress.enabled=true \
  --set ingress.hosts[0].host=ops.example.com

Custom Values

yaml
# values.yaml
replicaCount: 3

image:
  repository: opsatlas/ops-atlas
  tag: latest

ingress:
  enabled: true
  className: nginx
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod
  hosts:
    - host: ops.example.com
      paths:
        - path: /
          pathType: Prefix
  tls:
    - secretName: ops-atlas-tls
      hosts:
        - ops.example.com

postgresql:
  enabled: true
  auth:
    postgresPassword: your-password

redis:
  enabled: true

resources:
  requests:
    cpu: 500m
    memory: 512Mi
  limits:
    cpu: 2000m
    memory: 2Gi

autoscaling:
  enabled: true
  minReplicas: 2
  maxReplicas: 10

Raw Manifests

Namespace

yaml
apiVersion: v1
kind: Namespace
metadata:
  name: ops-atlas

Deployment

yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: ops-atlas
  namespace: ops-atlas
spec:
  replicas: 2
  selector:
    matchLabels:
      app: ops-atlas
  template:
    metadata:
      labels:
        app: ops-atlas
    spec:
      containers:
        - name: ops-atlas
          image: opsatlas/ops-atlas:latest
          ports:
            - containerPort: 3000
          env:
            - name: DATABASE_URL
              valueFrom:
                secretKeyRef:
                  name: ops-atlas-secrets
                  key: database-url
            - name: JWT_SECRET
              valueFrom:
                secretKeyRef:
                  name: ops-atlas-secrets
                  key: jwt-secret
          resources:
            requests:
              cpu: 500m
              memory: 512Mi
            limits:
              cpu: 2000m
              memory: 2Gi
          livenessProbe:
            httpGet:
              path: /health
              port: 3000
            initialDelaySeconds: 30
            periodSeconds: 10
          readinessProbe:
            httpGet:
              path: /health
              port: 3000
            initialDelaySeconds: 5
            periodSeconds: 5

Service

yaml
apiVersion: v1
kind: Service
metadata:
  name: ops-atlas
  namespace: ops-atlas
spec:
  selector:
    app: ops-atlas
  ports:
    - port: 80
      targetPort: 3000
  type: ClusterIP

Ingress

yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ops-atlas
  namespace: ops-atlas
  annotations:
    kubernetes.io/ingress.class: nginx
    cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
  tls:
    - hosts:
        - ops.example.com
      secretName: ops-atlas-tls
  rules:
    - host: ops.example.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: ops-atlas
                port:
                  number: 80

Secrets

yaml
apiVersion: v1
kind: Secret
metadata:
  name: ops-atlas-secrets
  namespace: ops-atlas
type: Opaque
stringData:
  database-url: postgres://user:pass@postgres:5432/opsatlas
  jwt-secret: your-64-character-secret-key

Released under the MIT License.