Entrypoint namespaces support

Registered by Grzegorz Grasza

Adopted from https://etherpad.openstack.org/p/k8s-entrypoint-namespaces

Proposal for introducing the namespace specification when using k8s-entrypoint for dependency checking.

General information:
k8s-entrypoint GitHub repo:
https://github.com/stackanetes/kubernetes-entrypoint
OpenStack Helm uses built image:
docker.io/kolla/ubuntu-source-kubernetes-entrypoint:4.0.0
https://hub.docker.com/r/kolla/ubuntu-source-kubernetes-entrypoint/tags/

kubernetes-entrypoint 0.2 image available at:
https://quay.io/repository/stackanetes/kubernetes-entrypoint

New kubernetes-entrypooint supports passing in a string with a list of namespace:enttity entries, for example:
openstack:ovs-agent,openstack:l3-agent

It is backwards compatible with the previously used string without namespaces, which is the current behavior that means checking the pod in current namespace.

OpenStack Helm considerations:
The string is passed from resource definitions, i.e.:
https://github.com/openstack/openstack-helm/blob/59d9c463bd3886b5548b982772ff05ccd50d25df/neutron/templates/deployment-server.yaml#L43-44

{{- $dependencies := .Values.dependencies.server }}
initContainers:
    {{ tuple $envAll $dependencies $mounts_neutron_server_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}

The values.yaml is currently looking like this:
https://github.com/openstack/openstack-helm/blob/59d9c463bd3886b5548b982772ff05ccd50d25df/neutron/values.yaml#L118
dependencies:
  server:
    jobs:
    - neutron-db-sync
    - neutron-ks-user
    - neutron-ks-endpoints
    services: --
    - service: oslo_db
      endpoint: internal
    - service: oslo_messaging
      endpoint: internal
    - service: oslo_cache
      endpoint: internal
    - service: identity
      endpoint: internal

The above YAML file need to be designed to include the namespace where the jobs/daemonset runs.

dependencies:
  server:
    jobs:
    - job: neutron-db-sync
      namespace: openstack
    - job: neutron-ks-user
      namespace: openstack
    - job: neutron-ks-endpoints
      namespace: openstack
    services:
    - service: oslo_db
      endpoint: internal
      namespace: openstack
    - service: oslo_messaging
      endpoint: internal
      namespace: openstack
    daemonsets:
    - daemonset: ovs-agent
      namespace: openstack

For the services, this information is already available in the `endpoints` section in the values.yaml. Because this will also be required to get the fqdn - we can then make a simple extension in the helm toolkit to get this and pass it on.

The `namespace` key in `dependencies` structure can also be empty (just like in the `endpoints` section), which will default to the current namespace.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
Grzegorz Grasza
Direction:
Needs approval
Assignee:
Grzegorz Grasza
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/entrypoint-namespaces,n,z

Addressed by: https://review.openstack.org/510541
    Change entrypoint version

Addressed by: https://review.openstack.org/510810
    WIP: Support services in different namespaces

Addressed by: https://review.openstack.org/511515
    WIP: Add jobs and daemonsets namespace support

Addressed by: https://review.openstack.org/512634
    Add documentation about endpoint/service namespaces

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.