Как запустить openldap в k8s?

*** CONTAINER_LOG_LEVEL = 3 (info)
*** Search service in CONTAINER_SERVICE_DIR = /container/service :
*** link /container/service/:ssl-tools/startup.sh to /container/run/startup/:ssl-tools
*** link /container/service/slapd/startup.sh to /container/run/startup/slapd
*** link /container/service/slapd/process.sh to /container/run/process/slapd/run
*** Set environment for startup files
*** Environment files will be proccessed in this order :  Caution: previously defined variables will not be overriden. /container/environment/99-default/default.startup.yaml /container/environment/99-default/default.yaml
To see how this files are processed and environment variables values, run this container with '--loglevel debug'
*** Running /container/run/startup/:ssl-tools...
*** Running /container/run/startup/slapd... Database and config directory are empty... Init new ldap server... invoke-rc.d: could not determine current runlevel invoke-rc.d: policy-rc.d denied execution of stop.   Backing up /etc/ldap/slapd.d in /var/backups/slapd-2.4.44+dfsg-5+deb9u2... done.   Creating initial configuration... done.   Creating LDAP directory... done. invoke-rc.d: could not determine current runlevel invoke-rc.d: policy-rc.d denied execution of start. Start OpenLDAP... Waiting for OpenLDAP to start... Add bootstrap schemas... config file testing succeeded Add image bootstrap ldif... Add custom bootstrap ldif... Disable replication config... Stop OpenLDAP... Remove config files... First start is done...
*** Set environment for container process
*** Remove file /container/environment/99-default/default.startup.yaml
*** Environment files will be proccessed in this order :  Caution: previously defined variables will not be overriden. /container/environment/99-default/default.yaml
To see how this files are processed and environment variables values, run this container with '--loglevel debug'
*** Running /container/run/process/slapd/run...
*** Running --loglevel debug...
*** --loglevel debug exited with status 127.
*** Shutting down /container/run/process/slapd/run (PID 414)...
*** Killing all processes...

Когда я пытаюсь запустить контейнер osixia / openldap: 1.4.0 в k8s, я получаю сообщение об ошибке выше. Файл манифеста:

...
    containers:
        - name: ldap
          image: osixia/openldap:1.4.0
          #args: ["--copy-service","--loglevel warning"]
          args: ["--loglevel debug"]
          ports:
          - containerPort: 389
          env:
            - name: LDAP_ADMIN_PASSWORD
              value: "admin"
            - name: LDAP_TLS
              value: "false"
            - name: LDAP_ORGANISATION
              value: "My Company"
            - name: LDAP_DOMAIN
              name: "mycompany.io"

Когда я добавляю тома db и config, я получаю другое сообщение об ошибке:

To see how this files are processed and environment variables values,
run this container with '--loglevel debug'
*** Running /container/run/process/slapd/run...
5f841fca @(#) $OpenLDAP: slapd 2.4.50+dfsg-1~bpo10+1 (May  4 2020 05:25:06) $
    Debian OpenLDAP Maintainers <pkg-openldap-devel@lists.alioth.debian.org>
5f841fca daemon: listen URL "ldap://ldap:tcp://10.100.225.153:389" parse error=5
5f841fca slapd stopped.
5f841fca connections_destroy: nothing to destroy.
*** /container/run/process/slapd/run exited with status 1
*** Killing all processes...

Есть идеи, что не так? Большое спасибо.

0
задан 12 October 2020 в 12:34
2 ответа

Ответ находится в этой строке:

*** --loglevel debug exited with status 127.

Статус выхода 127 в основном означает, что команда не найдена .

Вам нужно исправить одну строку в вашем файле yaml . Вместо:

args: ["--loglevel debug"]

должно быть:

args: ["--loglevel", "debug"]

, и все будет работать нормально.

0
ответ дан 4 January 2021 в 09:53

Я думаю, вы столкнулись с этой проблемой: https://github.com/osixia/docker-openldap/issues/457

Цитата оттуда:

Это происходит потому, что вы назвали свою службу LDAP, и kubernetes автоматически создает LDAP_PORT и ряд других переменных среды.

И LDAP_PORT противоречит этим соглашениям об образе докеров.

Решение:не называйте контейнер ldap , выберите другое имя.

0
ответ дан 4 January 2021 в 09:53

Теги

Похожие вопросы