Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
In section 3.7 "Launching Services, Replication Controllers, and Container Pods with Kubernetes", the example YAML files have a number of invalid fields for the v1 API of Kubernetes.
Below is what happens when you try to use them using the 7.2.2.-2 version of RHEALAH.
# atomic host status
TIMESTAMP (UTC) VERSION ID OSNAME REFSPEC
* 2016-03-01 01:35:21 7.2.2-2 8b2cf24b42 rhel-atomic-host rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard
# cat db-rc.yaml
---
kind: ReplicationController
apiVersion: v1
metadata:
name: db-controller
spec:
replicas: 2
selector:
name: db
template:
spec:
containers:
- name: db
image: dbforweb
ports:
- containerPort: 3306
metadata:
labels:
name: "db"
selectorname: "db"
labels:
name: "db"
# kubectl create -f db-rc.yaml
error validating "db-rc.yaml": error validating data: [found invalid field selectorname for v1.ObjectMeta, found invalid field labels for v1.ReplicationControllerSpec]; if you choose to ignore these errors, turn
validation off with --validate=false
# cat webserver-service.yaml
---
apiVersion: v1
kind: Service
metadata:
labels:
name: webserver
name: webserver-service
namespace: default
spec:
ports:
- port: 80
publicIPs:
- 192.168.122.182
selector:
name: webserver
kubectl create -f webserver-service.yaml
error validating "webserver-service.yaml": error validating data: found invalid field publicIPs for v1.ServiceSpec; if you choose to ignore these errors, turn validation off with --validate=false
# cat webserver-rc.yaml
---
apiVersion: v1
kind: ReplicationController
metadata:
name: webserver-controller
spec:
replicas: 2
selector:
name: webserver
template:
spec:
containers:
- name: apache-frontend
image: webwithdb
ports:
- containerPort: 80
metadata:
labels:
name: webserver
uses: db
labels:
name: "webserver"
# kubectl create -f webserver-rc.yaml
error validating "webserver-rc.yaml": error validating data: found invalid field labels for v1.ReplicationControllerSpec; if you choose to ignore these errors, turn validation off with --validate=false
I've corrected the three files and prepared the chapter for publishing. I'll comment again when the new chapter is published. I corrected the db-rc.yaml file as follows:
-------
apiVersion: v1
kind: ReplicationController
metadata:
name: db-controller
labels:
app: db
spec:
replicas: 2
selector:
app: "db"
template:
metadata:
labels:
app: "db"
spec:
containers:
- name: "db"
image: "dbforweb"
ports:
- containerPort: 3306
-------
I corrected the webserver-service.yaml file to not use a specific IP address:
-------
apiVersion: v1
kind: Service
metadata:
labels:
name: webserver
name: webserver-service
namespace: default
spec:
ports:
- port: 80
selector:
name: webserver
-------
I corrected the webserver-rc.yaml file as follows:
-------
kind: "ReplicationController"
apiVersion: "v1"
metadata:
name: "webserver-controller"
spec:
replicas: 2
selector:
name: "webserver"
template:
spec:
containers:
- name: "apache-frontend"
image: "webwithdb"
ports:
- containerPort: 80
metadata:
labels:
name: "webserver"
uses: db
-------
Please try the service and two replication controllers again using the updated yaml files.
I tested the modified YAML files and they work with with 'kubectl'
However, I'm re-opening the bug because the link to the docs still shows the old YAML files for me (checked via two browsers).
In section 3.7 "Launching Services, Replication Controllers, and Container Pods with Kubernetes", the example YAML files have a number of invalid fields for the v1 API of Kubernetes. Below is what happens when you try to use them using the 7.2.2.-2 version of RHEALAH. # atomic host status TIMESTAMP (UTC) VERSION ID OSNAME REFSPEC * 2016-03-01 01:35:21 7.2.2-2 8b2cf24b42 rhel-atomic-host rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard # cat db-rc.yaml --- kind: ReplicationController apiVersion: v1 metadata: name: db-controller spec: replicas: 2 selector: name: db template: spec: containers: - name: db image: dbforweb ports: - containerPort: 3306 metadata: labels: name: "db" selectorname: "db" labels: name: "db" # kubectl create -f db-rc.yaml error validating "db-rc.yaml": error validating data: [found invalid field selectorname for v1.ObjectMeta, found invalid field labels for v1.ReplicationControllerSpec]; if you choose to ignore these errors, turn validation off with --validate=false # cat webserver-service.yaml --- apiVersion: v1 kind: Service metadata: labels: name: webserver name: webserver-service namespace: default spec: ports: - port: 80 publicIPs: - 192.168.122.182 selector: name: webserver kubectl create -f webserver-service.yaml error validating "webserver-service.yaml": error validating data: found invalid field publicIPs for v1.ServiceSpec; if you choose to ignore these errors, turn validation off with --validate=false # cat webserver-rc.yaml --- apiVersion: v1 kind: ReplicationController metadata: name: webserver-controller spec: replicas: 2 selector: name: webserver template: spec: containers: - name: apache-frontend image: webwithdb ports: - containerPort: 80 metadata: labels: name: webserver uses: db labels: name: "webserver" # kubectl create -f webserver-rc.yaml error validating "webserver-rc.yaml": error validating data: found invalid field labels for v1.ReplicationControllerSpec; if you choose to ignore these errors, turn validation off with --validate=false