Open concaf opened 8 years ago
I have not forgotten about this. When we start working with the OpenShift team on the new K8s modules, this will get fixed.
@chouseknecht any time when the collaboration with OS team will start?
It's actually starting now. Met with @detiber yesterday. Will be helping finish the new K8s modules which we will include here. It'll take a couple weeks, but my plan is to refactor shipit once the new modules are stable.
Waiting around for the K8s modules to get done is probably not going to cut it. That's a longer term project.
Anyway... to fix this. It seems we need to create a service in kubernetes that represents the alias.
Hi,
In my
ansible/container.yml
, I have set an alias for my link as follows:I have used the alias in my container.yml:
`ansible/container.yml`
``` bash version: "1" services: webserver: image: centos:7 expose: - "80" command: ['/usr/sbin/apachectl', '-DFOREGROUND'] dev_overrides: ports: - "80:8080" webclient: image: centos:7 command: ['./tmp/client.sh'] links: - webserver:web ````ansible/main.yml`
``` bash - hosts: webserver tasks: - name: Install web server yum: name=httpd state=latest - name: Configure web server shell: echo "Hi, I am web server." > /var/www/html/index.html - hosts: webclient tasks: - name: Install nmap yum: name=nmap state=latest - name: Configure client shell: echo -e '#!/bin/sh\nwhile true; do sleep 3; nmap -Pn -p 80 $WEB_PORT_80_TCP_ADDR; curl $WEB_PORT_80_TCP_ADDR:80; done' > /tmp/client.sh - name: Make script executable file: path=/tmp/client.sh mode=0777 ```My application works fine when I do
ansible-container run
, but when I deploy the Kubernetes role fromansible-container shipit kube
, the application fails.I checked inside the
webclient
pod, and the link alias is not being honored, instead of environment variables likeWEB_PORT_80_TCP_ADDR
, there areWEBSERVER_PORT_80_TCP_ADDR
.