PageSourceSearch

https://www.okteto.com/docs/assets/js/4f70ecd3.283b1ece.js

js okteto.com collected 2026-10-02 03:13:47 UTC 24,947 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_okteto_website_docs=self.webpackChunk_okteto_website_docs||[]).push([[2131],{28453:(e,n,s)=>{s.d(n,{R:()=>a,x:()=>o});var t=s(96540);const i={},r=t.createContext(i);function a(e){const n=t.useContext(r);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),t.createElement(r.Provider,{value:n},e.children)}},52012:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>l,contentTitle:()=>o,default:()=>h,frontMatter:()=>a,metadata:()=>t,toc:()=>d});const t=JSON.parse('{"id":"development/using-divert","title":"Using Divert","description":"Practical guide for implementing Divert in your development workflow","source":"@site/versioned_docs/version-1.45/development/using-divert.mdx","sourceDirName":"development","slug":"/development/using-divert","permalink":"/docs/1.45/development/using-divert","draft":false,"unlisted":false,"editUrl":"https://github.com/okteto/docs/edit/main/versioned_docs/version-1.45/development/using-divert.mdx","tags":[],"version":"1.45","frontMatter":{"title":"Using Divert","description":"Practical guide for implementing Divert in your development workflow","sidebar_label":"Using Divert","id":"using-divert"},"sidebar":"docs","previous":{"title":"Using the Okteto CLI","permalink":"/docs/1.45/development/using-okteto-cli"},"next":{"title":"Development Containers","permalink":"/docs/1.45/development/containers/"}}');var i=s(74848),r=s(28453);const a={title:"Using Divert",description:"Practical guide for implementing Divert in your development workflow",sidebar_label:"Using Divert",id:"using-divert"},o=void 0,l={},d=[{value:"Okteto Manifest Configuration",id:"okteto-manifest-configuration",level:2},{value:"Basic Divert Configuration (nginx driver)",id:"basic-divert-configuration-nginx-driver",level:3},{value:"Istio Driver Configuration",id:"istio-driver-configuration",level:3},{value:"Project Structure Patterns",id:"project-structure-patterns",level:2},{value:"Single Service Development",id:"single-service-development",level:3},{value:"Multi-Service Development",id:"multi-service-development",level:3},{value:"Using Environment Variables",id:"using-environment-variables",level:3},{value:"Header Propagation",id:"header-propagation",level:2},{value:"JavaScript/Node.js (Express)",id:"javascriptnodejs-express",level:3},{value:"Go",id:"go",level:3},{value:"Java/Spring Boot",id:"javaspring-boot",level:3},{value:"Python (FastAPI)",id:"python-fastapi",level:3},{value:"Database Isolation Patterns",id:"database-isolation-patterns",level:2},{value:"Shared Database (Default)",id:"shared-database-default",level:3},{value:"Isolated Database per Developer",id:"isolated-database-per-developer",level:3},{value:"Message Queue Routing Patterns",id:"message-queue-routing-patterns",level:2},{value:"SQS Queue Routing",id:"sqs-queue-routing",level:3},{value:"Kafka Topic Routing",id:"kafka-topic-routing",level:3},{value:"Testing Your Diverted Environment",id:"testing-your-diverted-environment",level:2},{value:"Using curl",id:"using-curl",level:3},{value:"Using Browser Extensions",id:"using-browser-extensions",level:3},{value:"Automated Testing",id:"automated-testing",level:3},{value:"Multi-Developer Collaboration",id:"multi-developer-collaboration",level:2},{value:"Accessing Another Developer's Environment",id:"accessing-another-developers-environment",level:3},{value:"Sharing Your Work",id:"sharing-your-work",level:3},{value:"Troubleshooting",id:"troubleshooting",level:2},{value:"Traffic Not Being Diverted",id:"traffic-not-being-diverted",level:3},{value:"Services Not Discovered",id:"services-not-discovered",level:3},{value:"Database Connection Issues",id:"database-connection-issues",level:3},{value:"Best Practices",id:"best-practices",level:2},{value:"Next Steps",id:"next-steps",level:2},{value:"Example Repositories",id:"example-repositories",level:2}];function c(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:"This guide covers the practical implementation of Divert in your Okteto development environments, including manifest configuration, header prop
1agation, and common patterns for databases and message queues."}),"\n",(0,i.jsx)(n.h2,{id:"okteto-manifest-configuration",children:"Okteto Manifest Configuration"}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"divert"})," section goes under ",(0,i.jsx)(n.code,{children:"deploy"})," in your ",(0,i.jsx)(n.code,{children:"okteto.yaml"})," to configure traffic routing between your development environment and a shared namespace."]}),"\n",(0,i.jsx)(n.h3,{id:"basic-divert-configuration-nginx-driver",children:"Basic Divert Configuration (nginx driver)"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"deploy:\n  commands:\n    - helm upgrade --install myservice chart --set image=${OKTETO_BUILD_IMAGE}\n  divert:\n    driver: nginx  # Optional, nginx is the default\n    namespace: staging\n"})}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Field"}),(0,i.jsx)(n.th,{children:"Description"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"driver"})}),(0,i.jsxs)(n.td,{children:["The backend for divert routing. Options: ",(0,i.jsx)(n.code,{children:"nginx"})," (default) or ",(0,i.jsx)(n.code,{children:"istio"})]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"namespace"})}),(0,i.jsx)(n.td,{children:"The shared namespace containing the full application stack"})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["When you run ",(0,i.jsx)(n.code,{children:"okteto deploy"}),", Okteto automatically:"]}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsx)(n.li,{children:"Deploys only the services defined in your manifest"}),"\n",(0,i.jsx)(n.li,{children:"Configures routing to redirect requests for missing services to the shared namespace"}),"\n",(0,i.jsxs)(n.li,{children:["Injects the ",(0,i.jsx)(n.code,{children:"baggage: okteto-divert=<your-namespace>"})," header into requests through your endpoints"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"istio-driver-configuration",children:"Istio Driver Configuration"}),"\n",(0,i.jsxs)(n.p,{children:["If your cluster uses Istio for service mesh, use the ",(0,i.jsx)(n.code,{children:"istio"})," driver:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"deploy:\n  commands:\n    - helm upgrade --install myservice chart --set image=${OKTETO_BUILD_IMAGE}\n  divert:\n    driver: istio\n    virtualServices:\n      - name: frontend-vs\n        namespace: staging\n        routes:\n          - route-to-frontend\n    hosts:\n      - virtualService: frontend\n        namespace: staging\n"})}),"\n",(0,i.jsx)(n.p,{children:"The Istio driver has two key configuration fields:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:(0,i.jsx)(n.code,{children:"virtualServices"})}),": Lists the Istio VirtualService resources in the shared namespace where traffic should be diverted. Okteto modifies these virtual services to add header-based routing logic so that requests containing the baggage header are sent to the corresponding service in your development namespace. You can target all routes defined in the virtual service or specify a subset using the ",(0,i.jsx)(n.code,{children:"routes"})," field."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:(0,i.jsx)(n.code,{children:"hosts"})})," (optional): Creates a dedicated copy of the listed virtual services in your development namespace, each with its own host (e.g., ",(0,i.jsx)(n.code,{children:"https://service-a-<dev-namespace>.<subdomain>"}),"). Requests reaching this host automatically have the baggage header injected. Internally, the copied virtual service still points to the original virtual service in the shared namespace, ensuring the rest of the request flow goes through the shared environment with the divert header applied. This is useful for services you are ",(0,i.jsx)(n.strong,{children:"not"})," deploying as part of your development environment \u2014 it gives you a dedicated URL to reach your version of the app without having to manually use the staging endpoint with the baggage header. Services you deploy in your own namespace already have their own endpoints."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["For complete configuration details, see the ",(0,i.jsx)(n.a,{href:"/docs/1.45/reference/okteto-manifest#divert",children:"manifest reference"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"project-structure-patterns",children:"Project Structure Patterns"}),"\n",(0,i.jsx)(n.h3,{id:"single-service-development",children:"Single Service Development"}),"\n",(0,i.jsx)(n.p,{children:"For working on a single service, create a dedicated manifest:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"# okteto.frontend.yaml\nbuild:\n  frontend:\n    context: frontend\n\ndeploy:\n  commands:\n    - helm upgrade --install frontend chart/frontend --set image=${OKTETO_BUILD_FRONTEND_IMAGE}\n  divert:\n    namespace: ${OKTETO_SHARED_NAMESPACE:-staging}\n"})}),"\n",(0,i.jsx)(n.h3,{id:"multi-service-development",children:"Multi-Service Development"}),"\n",(0,i.jsx)(n.p,{children:"When working on related services together:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"# okteto.rentals.yaml\nbuild:\n  rent:\n    context: rentals\n  worker:\n    context: worker\n\ndeploy:\n  commands:\n    - helm upgrade --install rent chart/rent --set image=${OKTETO_BUILD_RENT_IMAGE}\n    - helm upgrade --install worker chart/worker --set image=${OKTETO_BUILD_WORKER_IMAGE}\n    - helm upgrade --install kafka chart/kafka\n    - helm upgrade --install postgresql chart/postgresql\n  divert:\n    namespace: ${OKTETO_SHARED_NAMESPACE:-staging}\n"})}),"\n",(0,i.jsx)(n.h3,{id:"using-environment-variables",children:"Using Environment Variables"}),"\n",(0,i.jsx)(n.p,{children:"Reference the shared namespace via environment variable for flexibility:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-console",children:'export OKTETO_SHARED_NAMESPACE="movies-shared"\
1nokteto deploy -f okteto.frontend.yaml\n'})}),"\n",(0,i.jsx)(n.h2,{id:"header-propagation",children:"Header Propagation"}),"\n",(0,i.jsxs)(n.p,{children:["For Divert to work across your service mesh, implement header propagation in your services. The ",(0,i.jsx)(n.code,{children:"baggage"})," header must be extracted from incoming requests and included in all outgoing requests."]}),"\n",(0,i.jsx)(n.h3,{id:"javascriptnodejs-express",children:"JavaScript/Node.js (Express)"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-javascript",children:"const express = require('express');\nconst axios = require('axios');\n\nconst app = express();\n\n// Middleware to capture baggage header\napp.use((req, res, next) => {\n  req.baggage = req.headers['baggage'] || '';\n  next();\n});\n\n// Propagate in outgoing requests\napp.get('/api/movies', async (req, res) => {\n  const response = await axios.get('http://catalog:8080/movies', {\n    headers: { 'baggage': req.baggage }\n  });\n  res.json(response.data);\n});\n"})}),"\n",(0,i.jsx)(n.h3,{id:"go",children:"Go"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-go",children:'package main\n\nimport (\n    "net/http"\n)\n\nfunc handler(w http.ResponseWriter, r *http.Request) {\n    baggage := r.Header.Get("baggage")\n\n    // Create downstream request\n    req, _ := http.NewRequest("GET", "http://catalog:8080/movies", nil)\n    req.Header.Set("baggage", baggage)\n\n    client := &http.Client{}\n    resp, _ := client.Do(req)\n    // Handle response...\n}\n'})}),"\n",(0,i.jsx)(n.h3,{id:"javaspring-boot",children:"Java/Spring Boot"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-java",children:'@RestController\npublic class ApiController {\n\n    private final WebClient webClient;\n\n    @GetMapping("/api/movies")\n    public Mono<Movies> getMovies(@RequestHeader(value = "baggage", required = false) String baggage) {\n        return webClient.get()\n            .uri("http://catalog:8080/movies")\n            .header("baggage", baggage != null ? baggage : "")\n            .retrieve()\n            .bodyToMono(Movies.class);\n    }\n}\n'})}),"\n",(0,i.jsx)(n.h3,{id:"python-fastapi",children:"Python (FastAPI)"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:'from fastapi import FastAPI, Request\nimport httpx\n\napp = FastAPI()\n\[email protected]("/api/movies")\nasync def get_movies(request: Request):\n    baggage = request.headers.get("baggage", "")\n\n    async with httpx.AsyncClient() as client:\n        response = await client.get(\n            "http://catalog:8080/movies",\n            headers={"baggage": baggage}\n        )\n        return response.json()\n'})}),"\n",(0,i.jsx)(n.h2,{id:"database-isolation-patterns",children:"Database Isolation Patterns"}),"\n",(0,i.jsx)(n.p,{children:"When using Divert, you can choose between shared or isolated databases depending on your needs."}),"\n",(0,i.jsx)(n.h3,{id:"shared-database-default",children:"Shared Database (Default)"}),"\n",(0,i.jsx)(n.p,{children:"Services connect to the database in the shared namespace. This is the simplest approach and works well when you don't need to modify the database schema or data:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"# Your diverted service uses the shared database\nenv:\n  - name: DATABASE_URL\n    value: postgresql://postgres:5432/movies  # Resolves to shared namespace\n"})}),"\n",(0,i.jsx)(n.h3,{id:"isolated-database-per-developer",children:"Isolated Database per Developer"}),"\n",(0,i.jsx)(n.p,{children:"Deploy your own database instance when you need isolation for schema changes or test data:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"deploy:\n  commands:\n    - helm upgrade --install mongodb chart/mongodb  # Local database\n    - helm upgrade --install catalog chart/catalog --set image=${OKTETO_BUILD_IMAGE}\n  divert:\n    namespace: staging\n"})}),"\n",(0,i.jsx)(n.p,{children:"Your service then connects to the local database:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"env:\n  - name: MONGODB_URL\n    value: mongodb://mongodb:27017/catalog  # Local instance\n"})}),"\n",(0,i.jsx)(n.h2,{id:"message-queue-routing-patterns",children:"Message Queue Routing Patterns"}),"\n",(0,i.jsx)(n.p,{children:"For queue-based systems, you can route messages based on the baggage header to ensure proper service isolation."}),"\n",(0,i.jsx)(n.h3,{id:"sqs-queue-routing",children:"SQS Queue Routing"}),"\n",(0,i.jsx)(n.p,{children:"When publishing messages, include the namespace in the message attributes:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-javascript",children:"// Producer: Include routing info in message\nconst baggage = req.headers['baggage'] || '';\nconst namespace = extractNamespace(baggage);  // Extract from \"okteto-divert=namespace\"\n\nawait sqs.sendMessage({\n  QueueUrl: QUEUE_URL,\n  MessageBody: JSON.stringify(orderData),\n  MessageAttributes: {\n    'okteto-namespace': {\n      DataType: 'String',\n      StringValue: namespace || 'shared'\n    }\n  }\n});\n"})}),"\n",(0,i.jsx)(n.p,{children:"Consumer filters messages by namespace:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-javascript",children:"// Consumer: Filter messages by namespace\nconst messages = await sqs.receiveMessage({\n  QueueUrl: QUEUE_URL,\n  MessageAttributeNames: ['okteto-namespace']\n});\n\nfor (const message of messages.Messages) {\n  const targetNamespace = message.MessageAttributes?.['okteto-namespace']?.StringValue;\n\n  if (targetNamespace === CURRENT_NAMESPACE || targetNamespace === 'shared') {\n    // Process this message\n    await processOrder(JSON.parse(message.Body));\n  }\n}\n"})}),"\n",(0,i.jsx)(n.h3,{id:"kafka-topic-routing",children:"Kafka Topic Routing"}),"\n",(0,i.jsx)(n.p,{children:"Use message headers for Kafka routing:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-javascript",children:"// Producer\nawait producer.send({\n  topic: 'orders',\n  messages: [{\n    value: JSON.stringify(order),\n    headers: {\n      'okteto-namespace': namespace\n    }\n  }]\n});\n\n// Consumer\nawait consumer.run({\n  eachMessage: async ({ message }) =>
1 {\n    const targetNamespace = message.headers['okteto-namespace']?.toString();\n\n    if (targetNamespace === CURRENT_NAMESPACE || !targetNamespace) {\n      await processOrder(JSON.parse(message.value));\n    }\n  }\n});\n"})}),"\n",(0,i.jsx)(n.h2,{id:"testing-your-diverted-environment",children:"Testing Your Diverted Environment"}),"\n",(0,i.jsx)(n.h3,{id:"using-curl",children:"Using curl"}),"\n",(0,i.jsx)(n.p,{children:"Test routing with the baggage header:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-console",children:'# Without header - uses shared services\ncurl https://movies-staging.okteto.example.com/api/catalog/healthz\n# Response: {"status": "ok", "namespace": "staging"}\n\n# With header - routes to your namespace\ncurl -H "baggage: okteto-divert=alice" \\\n  https://movies-staging.okteto.example.com/api/catalog/healthz\n# Response: {"status": "ok", "namespace": "alice"}\n'})}),"\n",(0,i.jsx)(n.h3,{id:"using-browser-extensions",children:"Using Browser Extensions"}),"\n",(0,i.jsxs)(n.p,{children:["Install a header modification extension (like ",(0,i.jsx)(n.a,{href:"https://modheader.com/",children:"ModHeader"}),") and add:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Header Name"}),": ",(0,i.jsx)(n.code,{children:"baggage"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Header Value"}),": ",(0,i.jsx)(n.code,{children:"okteto-divert=<your-namespace>"})]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"automated-testing",children:"Automated Testing"}),"\n",(0,i.jsx)(n.p,{children:"Include header propagation in your test setup:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-javascript",children:"// Jest/Mocha test setup\nconst request = require('supertest');\n\ndescribe('Catalog API', () => {\n  it('should return movies', async () => {\n    const response = await request(app)\n      .get('/api/movies')\n      .set('baggage', `okteto-divert=${process.env.OKTETO_NAMESPACE}`)\n      .expect(200);\n\n    expect(response.body.namespace).toBe(process.env.OKTETO_NAMESPACE);\n  });\n});\n"})}),"\n",(0,i.jsx)(n.h2,{id:"multi-developer-collaboration",children:"Multi-Developer Collaboration"}),"\n",(0,i.jsx)(n.h3,{id:"accessing-another-developers-environment",children:"Accessing Another Developer's Environment"}),"\n",(0,i.jsx)(n.p,{children:"To test a colleague's changes, use their namespace in the baggage header:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-console",children:'curl -H "baggage: okteto-divert=bob-feature" \\\n  https://movies-staging.okteto.example.com/api/movies\n'})}),"\n",(0,i.jsx)(n.h3,{id:"sharing-your-work",children:"Sharing Your Work"}),"\n",(0,i.jsx)(n.p,{children:"Others can access your diverted environment using:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["Your personal endpoint: ",(0,i.jsx)(n.code,{children:"https://movies-alice.okteto.example.com"})]}),"\n",(0,i.jsxs)(n.li,{children:["Or the shared endpoint with your header: ",(0,i.jsx)(n.code,{children:"baggage: okteto-divert=alice"})]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"troubleshooting",children:"Troubleshooting"}),"\n",(0,i.jsx)(n.h3,{id:"traffic-not-being-diverted",children:"Traffic Not Being Diverted"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Check header format"}),": Ensure you're using ",(0,i.jsx)(n.code,{children:"baggage: okteto-divert=<namespace>"})," (not ",(0,i.jsx)(n.code,{children:"baggage.okteto-divert"}),")"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Verify header propagation"}),": All services in the call chain must forward the baggage header"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Check namespace name"}),": The namespace in the header must match your Okteto namespace exactly"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"services-not-discovered",children:"Services Not Discovered"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Verify shared namespace"}),": Ensure the shared namespace is running and healthy"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Check service names"}),": Service discovery uses Kubernetes DNS (",(0,i.jsx)(n.code,{children:"<service>.<namespace>.svc.cluster.local"}),")"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Review divert config"}),": Ensure ",(0,i.jsx)(n.code,{children:"divert.namespace"})," points to the correct shared environment"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"database-connection-issues",children:"Database Connection Issues"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Check connection strings"}),": Ensure they resolve to the correct database (shared vs. local)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Verify network policies"}),": Ensure cross-namespace communication is allowed"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Test connectivity"}),": Use ",(0,i.jsx)(n.code,{children:"kubectl exec"})," to test database connectivity from your pod"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"best-practices",children:"Best Practices"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Name namespaces descriptively"}),": Use patterns like ",(0,i.jsx)(n.code,{children:"<username>-<feature>"})," for clarity"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Clean up when done"}),": Delete personal namespaces after completing work"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Keep shared environment updated"}),": Regularly deploy updates to the shared staging environment"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Document header prop
1agation"}),": Ensure all team members understand which headers to propagate"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Use environment variables"}),": Reference shared namespace via variables for flexibility"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Monitor resource usage"}),": Track namespace quotas and clean up unused resources"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"next-steps",children:"Next Steps"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:(0,i.jsx)(n.a,{href:"/docs/1.45/core/divert",children:"Divert Core Concepts"})})," - Understanding Divert architecture"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:(0,i.jsx)(n.a,{href:"/docs/tutorials/divert",children:"Divert Tutorial"})})," - Step-by-step getting started guide"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:(0,i.jsx)(n.a,{href:"/docs/1.45/reference/okteto-manifest#divert",children:"Manifest Reference"})})," - Complete configuration options"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:(0,i.jsx)(n.a,{href:"#example-repositories",children:"Example Repositories"})})," - Working code samples"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"example-repositories",children:"Example Repositories"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://github.com/okteto-community/movies-with-divert",children:"Movies with Divert"})," - Multi-service example"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://github.com/okteto-community/tacoshop-with-divert-queues",children:"TacoShop with Divert Queues"})," - Queue routing patterns"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://github.com/okteto-community/getting-started-with-divert-istio",children:"Divert with Istio Sample"})," - Istio driver configuration"]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.