# No https URL generated on AKS?

**URL:** <https://community.okteto.com/t/no-https-url-generated-on-aks/372>\
**Category:** Help\
**Created:** [November 23, 2022, 8:14pm UTC](https://community.okteto.com/t/no-https-url-generated-on-aks/372 "2022-11-23T20:14:12Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![scheung38](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/scheung38/32/205_2.png) [@scheung38](https://community.okteto.com/u/scheung38)\
**Post date:** [November 23, 2022, 8:14pm UTC](https://community.okteto.com/t/no-https-url-generated-on-aks/372/1 "2022-11-23T20:14:12Z")

</div>

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

```auto
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

```auto
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

```auto
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](https://okteto).[example.org.uk](http://example.org.uk)

---

<div class="post-metadata">

**Author:** ![ramiro](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/ramiro/32/6_2.png) [@ramiro](https://community.okteto.com/u/ramiro)\
**Post date:** [November 23, 2022, 8:27pm UTC](https://community.okteto.com/t/no-https-url-generated-on-aks/372/2 "2022-11-23T20:27:34Z")

</div>

Based on your question, I think you are mixing two concepts.

The `helm upgrade okteto okteto/okteto -f config.yml --namespace=okteto` command is used to install and configure your Okteto Self-Hosted instance. You don’t need to run this command every time you deploy a new development environment. You only need to run this command when you want to make changes to your Okteto Self-Hosted instance (e.g., upgrade to a new version). You and your entire team can deploy as many development environments into your Okteto Self-Hosted instance as you need. Okteto Self-Hosted will handle account creation, access control, and namespace creation.

When you install Okteto Self-Hosted, the “okteto” namespace is used exclusively for Okteto’s services. Services deployed on that namespace won’t have an automatic HTTPS endpoints. You should deploy your development environment on a namespace managed by Okteto. By default, Okteto Self-Hosted will create a namespace for you when you first log in.

`okteto deploy...` and `okteto up...` are the commands that you use to deploy your development environment and interact with it. To deploy your development environment on your Okteto Self-Hosted instance, do the following:

1. Log in to your instance `okteto context use okteto.arthur-paf.example.org.uk`. With this, all the `okteto ` commands that you run will use the namespace that Okteto Self-Hosted created for you.
2. Remove the hardcoded namespace on your `okteto.yml` file.
3. Deploy `okteto deploy --build --wait -l=error`.

Once your development environment is deployed, you can see the available endpoints using the `okteto` CLI, or by opening your browser and accessing your Okteto Self-Hosted instance (eg. `https://okteto.example.com`). The endpoints will use the same domain your Okteto Self-Hosted instance uses.

---

<div class="post-metadata">

**Author:** ![scheung38](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/scheung38/32/205_2.png) [@scheung38](https://community.okteto.com/u/scheung38)\
**Post date:** [November 23, 2022, 8:30pm UTC](https://community.okteto.com/t/no-https-url-generated-on-aks/372/3 "2022-11-23T20:30:14Z")

</div>

@ramiro I should not use namespace okteto but instead

`kubectl create ns okteto-dev`

for example?

1. okteto context use 
2. Remove hardcoded namespace so okteto.yml: delete line 2 namepsace: okteto?

---

<div class="post-metadata">

**Author:** ![ramiro](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/ramiro/32/6_2.png) [@ramiro](https://community.okteto.com/u/ramiro)\
**Post date:** [November 23, 2022, 8:35pm UTC](https://community.okteto.com/t/no-https-url-generated-on-aks/372/4 "2022-11-23T20:35:16Z")

</div>

No, you should use the instructions we provided above. If you want to create more namespaces, you can do it the website that Okteto Self-Hosted provides or by using the command `okteto namespace create name`.

---

<div class="post-metadata">

**Author:** ![scheung38](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/scheung38/32/205_2.png) [@scheung38](https://community.okteto.com/u/scheung38)\
**Post date:** [November 23, 2022, 8:36pm UTC](https://community.okteto.com/t/no-https-url-generated-on-aks/372/5 "2022-11-23T20:36:39Z")

</div>

Are you saying we should or should not use namespace okteto but use any other namespace such as okteto-dev, etc?

kubectl create namespace okteto-dev? or  
okteto create namespace okteto-dev

Should be the same?

Doc says

kubectl create namespace okteto, didn’t say  
okteto create namespace okteto

“Remove the hardcoded namespace from your `production.yml`” but there is no namespace in production.yml defined, only in okteto.yml, if that’s what you mean

---

<div class="post-metadata">

**Author:** ![ramiro](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/ramiro/32/6_2.png) [@ramiro](https://community.okteto.com/u/ramiro)\
**Post date:** [November 23, 2022, 8:44pm UTC](https://community.okteto.com/t/no-https-url-generated-on-aks/372/6 "2022-11-23T20:44:01Z")

</div>

Okteto Self-Hosted is a platform that will manage Kubernetes namespaces for you, among many other things.

For your question, you don’t need to create a namespace, Okteto automatically creates one for you when you log in to your Okteto Self-Hosted instance. You need to:

1. Log in to your instance `okteto context use okteto.arthur-paf.example.org.uk`. (you only need to do this the first time, okteto will remember your log in).
2. Remove the hardcoded namespace from `okteto.yml` file.
3. Deploy `okteto deploy --build --wait -l=error`.

The `okteto deploy` command will automatically deploy your development environment on the namespace that Okteto created for you.

---

<div class="post-metadata">

**Author:** ![scheung38](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/scheung38/32/205_2.png) [@scheung38](https://community.okteto.com/u/scheung38)\
**Post date:** [November 23, 2022, 8:46pm UTC](https://community.okteto.com/t/no-https-url-generated-on-aks/372/7 "2022-11-23T20:46:00Z")

</div>

> [@ramiro](#):
>
> By default, Okteto Self-Hosted will create a namespace for you when you first log in.

sorry default namespace already created? But we don’t see that in our AKS cluster? The AKS cluster has namespaces:

default  
kube-node-release  
kube-public  
kube-system

that’s all

---

<div class="post-metadata">

**Author:** ![scheung38](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/scheung38/32/205_2.png) [@scheung38](https://community.okteto.com/u/scheung38)\
**Post date:** [November 23, 2022, 8:48pm UTC](https://community.okteto.com/t/no-https-url-generated-on-aks/372/8 "2022-11-23T20:48:11Z")

</div>

> [@ramiro](#):
>
> automatically creates one for you when you log in

okteto login?

But okteto login to where if not using okteto cloud?

okteto namespace create test-ns  
x This command is only available on Okteto Cloud or Okteto Enterprise

---

<div class="post-metadata">

**Author:** ![scheung38](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/scheung38/32/205_2.png) [@scheung38](https://community.okteto.com/u/scheung38)\
**Post date:** [November 23, 2022, 8:52pm UTC](https://community.okteto.com/t/no-https-url-generated-on-aks/372/9 "2022-11-23T20:52:04Z")

</div>

> [@ramiro](#):
>
> Log in to your instance `okteto context use`

when you say the above, you are referring the which cluster it is currently pointed to correct? as [okteto.arthur-paf.example.org.uk](http://okteto.arthur-paf.example.org.uk) would only be an eventual endpoint that would be later created.

So within the context of self-hosting, in this case Azure AKS, basically we need helm install into this reserved okteto namespace:

`helm install okteto okteto/okteto -f config.yml --namespace=okteto`

But separately we need to create our our namepace okteto-dev

`kubectl create namespace okteto-dev`

in our working namespace to deploy app

Is that the correct assumption to generate the https endpoint?

---

<div class="post-metadata">

**Author:** ![ramiro](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/ramiro/32/6_2.png) [@ramiro](https://community.okteto.com/u/ramiro)\
**Post date:** [November 23, 2022, 10:22pm UTC](https://community.okteto.com/t/no-https-url-generated-on-aks/372/10 "2022-11-23T22:22:20Z")

</div>

> [@scheung38](#):
>
> when you say the above, you are referring the which cluster it is currently pointed to correct?

No. What I’m saying there is that you need to run this command: `okteto context use https://okteto.example.com`, replacing `https://okteto.example.com` with the address of your Okteto Self-Hosted instance.

* * *

When you install [Okteto Self-Hosted](https://www.okteto.com/docs/self-hosted), you are installing a web application, a webhook, and a few other components inside the `okteto` namespace in your Kubernetes cluster (our docs have the entire list if you are interested).

The web application and the APIs are available at `https://okteto.$SUBDOMAIN` (where `subdomain` is the value you provided to the `subdomain` key in the `values.yaml` file that you used when installing Okteto Self-Hosted). You can access the web application directly from your browser or with the Okteto CLI.

**We recommend you first log in to your Okteto Self-Hosted instance with your browser to ensure everything works correctly.**

To deploy your development environment, you first need to connect the `okteto` CLI in your computer with the Okteto Self-Hosted instance you deployed in your Kubernetes cluster. To do this, you need to run: `okteto context use https://okteto.$SUBDOMAIN`.

After that command has been run successfully, Okteto will create a namespace for you in your Kubernetes cluster. Every `okteto` command you run will use that namespace by default.

To deploy your development environment, run `okteto deploy`. **You do not need to run any `kubectl` command when using the `okteto` CLI to develop.**

---

<div class="post-metadata">

**Author:** ![scheung38](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/scheung38/32/205_2.png) [@scheung38](https://community.okteto.com/u/scheung38)\
**Post date:** [November 23, 2022, 10:25pm UTC](https://community.okteto.com/t/no-https-url-generated-on-aks/372/11 "2022-11-23T22:25:34Z")

</div>

okteto ctx  
A context defines the default cluster/namespace for any Okteto CLI command.  
Select the context you want to use:  
Use the arrow keys to navigate: ↓ ↑ → ←  
[https://cloud.okteto.com](https://cloud.okteto.com) (Okteto Cloud)  
▸ ArthurPafStagingCluster \*  
ArthurStagingAKSCluster  
docker-desktop

```
Create new context

```

so this selects the context? How can there be [https://okteto.example.com](https://okteto.example.com) at this stage if the endpoint has not been created yet?

---

<div class="post-metadata">

**Author:** ![scheung38](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/scheung38/32/205_2.png) [@scheung38](https://community.okteto.com/u/scheung38)\
**Post date:** [November 23, 2022, 10:28pm UTC](https://community.okteto.com/t/no-https-url-generated-on-aks/372/12 "2022-11-23T22:28:20Z")

</div>

> [@ramiro](#):
>
> You do not need to run any `kubectl` command

> **[Azure Kubernetes Service (AKS) | Okteto Documentation](https://www.okteto.com/docs/self-hosted/aks/)**
>
> How to install Okteto onto Azure Kubernetes Service (AKS)

But here it is using

kubectl create ns and  
kubectl config view --minify | grep server

---

<div class="post-metadata">

**Author:** ![ramiro](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/ramiro/32/6_2.png) [@ramiro](https://community.okteto.com/u/ramiro)\
**Post date:** [November 23, 2022, 10:28pm UTC](https://community.okteto.com/t/no-https-url-generated-on-aks/372/13 "2022-11-23T22:28:30Z")

</div>

> [@scheung38](#):
>
> so this selects the context? How can there be [https://okteto.example.com](https://okteto.example.com/) at this stage if the endpoint has not been created yet?

Select the `Create new context` option, and type the URL address of your Okteto Self-Hosted (the same URL that you use to browse the Okteto Self-Hosted web application).

When you run `okteto context use` **you are connecting to your Okteto Self-Hosted instance** , not to your application.

---

<div class="post-metadata">

**Author:** ![ramiro](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/ramiro/32/6_2.png) [@ramiro](https://community.okteto.com/u/ramiro)\
**Post date:** [November 23, 2022, 10:30pm UTC](https://community.okteto.com/t/no-https-url-generated-on-aks/372/14 "2022-11-23T22:30:10Z")

</div>

> [@scheung38](#):
>
> But here it is using

The link you refer to is to install Okteto Self-Hosted. You need to use `kubectl` when you are installing Okteto Self-Hosted.

You do not need to run any `kubectl` command when using the okteto CLI to deploy your development environment. You just need to run `okteto deploy`.

---

<div class="post-metadata">

**Author:** ![scheung38](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/scheung38/32/205_2.png) [@scheung38](https://community.okteto.com/u/scheung38)\
**Post date:** [November 23, 2022, 10:30pm UTC](https://community.okteto.com/t/no-https-url-generated-on-aks/372/15 "2022-11-23T22:30:30Z")

</div>

But if selecting Create new context then the ArthurPafStagingCluster cluster is not going to be used?

---

<div class="post-metadata">

**Author:** ![ramiro](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/ramiro/32/6_2.png) [@ramiro](https://community.okteto.com/u/ramiro)\
**Post date:** [November 23, 2022, 10:35pm UTC](https://community.okteto.com/t/no-https-url-generated-on-aks/372/16 "2022-11-23T22:35:58Z")

</div>

By following the instructions we provided you’ll be able to deploy your development environment inside the cluster where you installed Okteto Self-Hosted.

---

<div class="post-metadata">

**Author:** ![scheung38](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/scheung38/32/205_2.png) [@scheung38](https://community.okteto.com/u/scheung38)\
**Post date:** [November 23, 2022, 10:40pm UTC](https://community.okteto.com/t/no-https-url-generated-on-aks/372/17 "2022-11-23T22:40:17Z")

</div>

okteto context prompts to ask which context (cluster) so I enter Create new context with what https?

ok context  
✓ Context ‘Create new context’ selected  
? Enter your Okteto URL [[https://cloud.okteto.com](https://cloud.okteto.com)]:

I am slightly confused because we are providing an endpoint which does not exist at this time yet? On the contrary I thought it would be selecting one of the existing AKS clusters? But you are pointing out the create a new context, then how is it going to deploy onto AKS cluster that was created?

---

<div class="post-metadata">

**Author:** ![scheung38](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/scheung38/32/205_2.png) [@scheung38](https://community.okteto.com/u/scheung38)\
**Post date:** [November 23, 2022, 10:44pm UTC](https://community.okteto.com/t/no-https-url-generated-on-aks/372/18 "2022-11-23T22:44:32Z")

</div>

> [@ramiro](#):
>
> replacing `https://okteto.example.com` with the address of your Okteto Self-Hosted instance.

Could you clarify this? Because you are saying replacing with https address of your self-hosted instance but as far as I understood, it is not created yet?

and a blank page:

![Screenshot 2022-11-23 at 22.48.33](https://us1.discourse-cdn.com/flex019/uploads/okteto/original/1X/b0413df4fceb2b417f5ef3e992cb64d0d6752766.png)

---

<div class="post-metadata">

**Author:** ![ramiro](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/ramiro/32/6_2.png) [@ramiro](https://community.okteto.com/u/ramiro)\
**Post date:** [November 23, 2022, 10:51pm UTC](https://community.okteto.com/t/no-https-url-generated-on-aks/372/19 "2022-11-23T22:51:10Z")

</div>

What happens when you follow the instructions displayed on the terminal?

---

<div class="post-metadata">

**Author:** ![scheung38](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/scheung38/32/205_2.png) [@scheung38](https://community.okteto.com/u/scheung38)\
**Post date:** [November 23, 2022, 10:51pm UTC](https://community.okteto.com/t/no-https-url-generated-on-aks/372/20 "2022-11-23T22:51:37Z")

</div>

as I said, a blank page

 ![Screenshot 2022-11-23 at 22.55.34](https://us1.discourse-cdn.com/flex019/uploads/okteto/original/1X/0c8a67334794d73726ef2ca46301126ea7f03f87.png)

[Next page](https://community.okteto.com/t/no-https-url-generated-on-aks/372.md?page=2)
