WIthin Azure AKS:
Followed the instruction in portal in azure com to create A record for * and A record for buildkit mapping to the given IP addresses from helm upgrade okteto okteto/okteto -f config.yml --namespace=okteto
okteto up and once in shell, to start server in dev environment in 0.0.0.0:8000:
/usr/local/bin/gunicorn config.asgi --bind 0.0.0.0:8000 --chdir=/app -k uvicorn.workers.UvicornWorker --timeout 600
This works fine as we get 0.0.0.0:8000 in browser, but there is Forbidden 403 but that is another story?
But not sure why in deployed mode, don’t get endpoint as indicated by the helm command:
helm upgrade okteto okteto/okteto -f config.yml --namespace=okteto
Expect to see https URL, although in Lens i see a few endpoints but none pointing to my Django app?
okteto deploy --build --wait -l=error
okteto.yml
name: my-paf
namespace: okteto
build:
django:
context: .
dockerfile: compose/production/django/Dockerfile
image: myacr.azurecr.io/paf_production_django:v2.0.0
deploy:
commands:
compose:
file: production.yml
services:
- django
- mongo
dev:
django:
image: myacr.azurecr.io/my_paf_production_django:v2.0.0
# image: okteto/python:3
command: bash
# command: python manage.py runserver 0.0.0.0:8000
workdir: /app
securityContext:
runAsUser: 101
sync:
- .:/app
forward:
- 3000:3000
- 8000:8000
reverse:
- 9000:9000
volumes:
- /root/.cache/pip
config.yml
email: sebadmin@example.org.uk
license: # optional
subdomain: "arthur-paf.example.org.uk"
cluster:
endpoint: "//XXXXX-XXXXX-XXXXX.hcp.uksouth.azmk8s.io"
auth:
bitbucket:
enabled: true
clientId: 5XXXXXXXXXX # OAauth Consumer Key
clientSecret: XXXXXXXXXXXXXXXXXXXXXX # OAauth Consumer Secret
workspace: myprojects
cloud:
provider:
azure:
enabled: true
storage:
container: "my-okteto-container" # "okteto-container"
accountName: "my-paf" # "okteto-storage-account"
buildkit:
ingress:
enabled: true
service:
type: LoadBalancer
production.yml
version: "3.8"
services:
django: # &django
build:
context: .
dockerfile: ./compose/production/django/Dockerfile
image: myacr.azurecr.io/my_paf_production_django:v2.0.0
container_name: my_paf_production_django
depends_on:
- mongo
env_file:
- ./.envs/.production/.django
- ./.envs/.production/.mongodb
ports:
- "8080:8080"
- "8000:8000"
- "3000:3000"
environment:
- DB_HOST=mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@${MONGO_HOST}:${MONGO_PORT}"
- DJANGO_READ_DOT_ENV_FILE=true
- COOKIE_SECURE=true
- DEBUG= false
# - DEBUG = os.environ.get('DJANGO_DEBUG', '') != 'False'
command: /start
# command: bash -c "/usr/local/bin/gunicorn config.asgi --bind 0.0.0.0:8000 --chdir=/app -k uvicorn.workers.UvicornWorker --timeout 600"
stdin_open: true
tty: true
mongo:
image: myacr.azurecr.io/mongo:5.0.6 #
container_name: "mongo"
restart: always
env_file:
- ./.envs/.production/.mongodb
environment:
- MONGO_INITDB_ROOT_USERNAME=XXXX
- MONGO_INITDB_ROOT_PASSWORD=XXXX
- MONGO_INITDB_DATABASE=XXXX
- MONGO_INITDB_USERNAME=XXXX
- MONGO_INITDB_PASSWORD=XXXX
volumes:
- production_mongodb_data:/data/db
ports:
- 27017:27017 # mongodb
- 9216:9216 # mongodb-exporter
volumes:
production_mongodb_data:
logs_volume:
Self-hosting in AKS, but no endpoint given?
helm upgrade okteto okteto/okteto -f config.yml --namespace=okteto
Once you create both DNS entries you can access your Okteto instance at this URL:
https://okteto.example.org.uk