Bug 1322121 - [DOCS] example YAML missing parameters
Summary: [DOCS] example YAML missing parameters
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: doc-RHEL-Atomic
Version: 7.2
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: rc
: ---
Assignee: Chris Negus
QA Contact: Vikram Goyal
Vikram Goyal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-29 20:44 UTC by David Darrah/Red Hat QE
Modified: 2019-03-06 02:28 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1320339
Environment:
Last Closed: 2017-03-08 09:20:57 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description David Darrah/Red Hat QE 2016-03-29 20:44:16 UTC
On the "Red Hat Enterprise Linux Atomic Host 7 Getting Started with Containers" documentation page, in section 2.3.3 Launching container pods with Kubernetes the example yaml files for the replication controllers are missing the host port specifications that will allow the web server and db server to be accessible from the host os when launched from Kubernetes.

In the red-hat-enterprise-linux-atomic-host/version-7/getting-started-guide/, the images are built exposing the ports from the Dockerfile, then run with 'docker run -p' to map them to the host ports.  When Kubernetes runs them, the option for a host port is not specified in the yaml, so the web server is not available from the host OS.

Suggested change to the files (just the hostPort parameter added under containerPort in the containers section:

[cloud-user@atomic01 yamlfiles]$ more db-rc.yaml 
apiVersion: v1
kind: ReplicationController
metadata:
  name: db-controller
spec:
  replicas: 1
  selector:
    app: "db"
  template:
    metadata:
      name: "db"
      labels:
        app: "db"
    spec:
      containers:
      - name: "db"
        image: "dbforweb"
        ports:
        - containerPort: 3306
          hostPort: 3306
[cloud-user@atomic01 yamlfiles]$ more webserver-rc.yaml 
kind: "ReplicationController"
apiVersion: "v1"
metadata:
  name: "webserver-controller"
spec:
  replicas: 1
  selector:
    name: "webserver"
  template:
    spec:
      containers:
        - name: "apache-frontend"
          image: "webwithdb"
          ports:
            - containerPort: 80
              hostPort: 80
    metadata:
      labels:
        name: "webserver"
        uses: db
[cloud-user@atomic01 yamlfiles]$

Comment 2 Vikram Goyal 2017-03-08 09:20:57 UTC
I am closing this bug as this content was moved and revised a few times since it was first published and since the bug was filed [1].

If there is any issue with the current document, please raise a new bug.

[1] https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux_atomic_host/7/html-single/getting_started_with_kubernetes/#launching_container_pods_with_kubernetes


Note You need to log in before you can comment on or make changes to this bug.