Repository: openshift/openshift-ansible

Issue #10969: Installation fails: TASK [openshift_cluster_monitoring_operator : Wait for the ServiceMonitor CRD to be created] 
Created: 2019-01-08T15:12:13Z
Description
We try to install OpenShift for the first time and now stuck on the problem that we cant resolve the issue here
TASK [openshift_cluster_monitoring_operator : Wait for the ServiceMonitor CRD to be created]
In the attached File is the error with the log of the pod.
Thanks for your help!
Fehler SND.txt

Duplicate issue #10534: 3.11 installation |Failed : Retrying : Wait for ServiceMonitor CRD to be created 
Created: 2018-10-27T05:48:24Z
I am getting error while installing openshift 3.11
Failed : Retrying : Wait for ServiceMonitor CRD to be created
openshift-ansible-3.11.33-1
ansible 2.6.5
CentOS Linux release 7.5.1804 (Core)
##############################################################################
Errors
##############################################################################


###########################################################################
Inventory.ini
###########################################################################
[OSEv3:children]
masters
nodes
etcd
[masters]
10.0.0.4 openshift_ip=10.0.0.4 openshift_schedulable=true
[etcd]
10.0.0.4 openshift_ip=10.0.0.4
[nodes]
10.0.0.4 openshift_ip=10.0.0.4 openshift_schedulable=true openshift_node_group_name="node-config-all-in-one"
[OSEv3:vars]
openshift_additional_repos=[{'id': 'centos-paas', 'name': 'centos-paas', 'baseurl' :'https://buildlogs.centos.org/centos/7/paas/x86_64/openshift-origin311', 'gpgcheck' :'0', 'enabled' :'1'}]
ansible_ssh_user=root
enable_excluders=False
enable_docker_excluder=False
ansible_service_broker_install=False
openshift_release=3.11
containerized=True
os_sdn_network_plugin_name='redhat/openshift-ovs-multitenant'
openshift_disable_check=disk_availability,docker_storage,memory_availability,docker_image_availability
openshift_node_kubelet_args={'pods-per-core': ['10']}
deployment_type=origin
openshift_deployment_type=origin
template_service_broker_selector={"region":"infra"}
openshift_metrics_image_version="v3.11"
openshift_logging_image_version="v3.11"
openshift_logging_elasticsearch_proxy_image_version="v1.0.0"
openshift_logging_es_nodeselector={"node-role.kubernetes.io/infra":"true"}
logging_elasticsearch_rollout_override=false
openshift_logging_kibana_hostname=kibana.104.211.92.103.nip.io
osm_use_cockpit=true
openshift_metrics_install_metrics=True
openshift_logging_install_logging=True
openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', 'challenge': 'true', 'kind': 'HTPasswdPasswordIdentityProvider'}]
openshift_master_htpasswd_file='/etc/origin/master/htpasswd'
openshift_public_hostname=console.13.71.2.200.nip.io
openshift_master_default_subdomain=apps.13.71.2.200.nip.io
openshift_master_api_port=8443
openshift_master_console_port=8443
############################################################################
Failure summary:
############################################################################

Hosts:    10.0.0.4
Play:     Configure Cluster Monitoring Operator
Task:     Wait for the ServiceMonitor CRD to be created
Message:  non-zero return code

############################################################################
Script used for installation
############################################################################
#!/bin/bash
see: https://youtu.be/aqXSbDZggK4
Default variables to use
export INTERACTIVE=${INTERACTIVE:="true"}
export PVS=${INTERACTIVE:="true"}
export DOMAIN=${DOMAIN:="$(curl -s ipinfo.io/ip).nip.io"}
export USERNAME=${USERNAME:="$(whoami)"}
export PASSWORD=${PASSWORD:=password}
export VERSION=${VERSION:="3.11"}
export SCRIPT_REPO=${SCRIPT_REPO:="https://raw.githubusercontent.com/gshipley/installcentos/master"}
export IP=${IP:="$(ip route get 8.8.8.8 | awk '{print $NF; exit}')"}
export API_PORT=${API_PORT:="8443"}
Make the script interactive to set the variables
if [ "$INTERACTIVE" = "true" ]; then
read -rp "Domain to use: ($DOMAIN): " choice;
if [ "$choice" != "" ] ; then
export DOMAIN="$choice";
fi
    read -rp "Username: ($USERNAME): " choice;
    if [ "$choice" != "" ] ; then
            export USERNAME="$choice";
    fi

    read -rp "Password: ($PASSWORD): " choice;
    if [ "$choice" != "" ] ; then
            export PASSWORD="$choice";
    fi

    read -rp "OpenShift Version: ($VERSION): " choice;
    if [ "$choice" != "" ] ; then
            export VERSION="$choice";
    fi
    read -rp "IP: ($IP): " choice;
    if [ "$choice" != "" ] ; then
            export IP="$choice";
    fi

    read -rp "API Port: ($API_PORT): " choice;
    if [ "$choice" != "" ] ; then
            export API_PORT="$choice";
    fi

    echo

fi
echo ""
echo " Your domain is $DOMAIN "
echo " Your IP is $IP "
echo " Your username is $USERNAME "
echo " Your password is $PASSWORD "
echo " OpenShift version: $VERSION "
echo "*****"
install updates
yum update -y
install the following base packages
yum install -y  wget git zile nano net-tools docker-1.13.1
bind-utils iptables-services 
bridge-utils bash-completion 
kexec-tools sos psacct openssl-devel 
httpd-tools NetworkManager 
python-cryptography python2-pip python-devel  python-passlib 
java-1.8.0-openjdk-headless "@development Tools"
#install epel
yum -y install epel-release
Disable the EPEL repository globally so that is not accidentally used during later steps of the installation
sed -i -e "s/^enabled=1/enabled=0/" /etc/yum.repos.d/epel.repo
systemctl | grep "NetworkManager.*running"
if [ $? -eq 1 ]; then
systemctl start NetworkManager
systemctl enable NetworkManager
fi
install the packages for Ansible
yum -y --enablerepo=epel install pyOpenSSL python2-pip
curl -o ansible.rpm https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.6.5-1.el7.ans.noarch.rpm
yum -y --enablerepo=epel install ansible.rpm
[ ! -d openshift-ansible ] && git clone https://github.com/openshift/openshift-ansible.git
cd openshift-ansible && git fetch && git checkout release-${VERSION} && cd ..
cat < /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
${IP}           $(hostname) console console.${DOMAIN}
EOD
if [ -z $DISK ]; then
echo "Not setting the Docker storage."
else
cp /etc/sysconfig/docker-storage-setup /etc/sysconfig/docker-storage-setup.bk
    echo DEVS=$DISK > /etc/sysconfig/docker-storage-setup
    echo VG=DOCKER >> /etc/sysconfig/docker-storage-setup
    echo SETUP_LVM_THIN_POOL=yes >> /etc/sysconfig/docker-storage-setup
    echo DATA_SIZE="100%FREE" >> /etc/sysconfig/docker-storage-setup

    systemctl stop docker
    rm -rf /var/lib/docker
    wipefs --all $DISK
    docker-storage-setup

fi
systemctl restart docker
systemctl enable docker
if [ ! -f ~/.ssh/id_rsa ]; then
ssh-keygen -q -f ~/.ssh/id_rsa -N ""
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh -o StrictHostKeyChecking=no root@$IP "pwd" < /dev/null
fi
export METRICS="True"
export LOGGING="True"
##########################################################################
vol.yml
############################################################################
apiVersion: v1
kind: PersistentVolume
metadata:
name: vol
spec:
capacity:
storage: 500Gi
accessModes:
- ReadWriteOnce
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
hostPath:
path: /mnt/data/vol
memory=$(cat /proc/meminfo | grep MemTotal | sed "s/MemTotal:[ ]([0-9]) kB/\1/")
envsubst < inventory.download > inventory.ini
add proxy in inventory.ini if proxy variables are set
if [ ! -z "${HTTPS_PROXY:-${https_proxy:-${HTTP_PROXY:-${http_proxy}}}}" ]; then
echo >> inventory.ini
echo "openshift_http_proxy="${HTTP_PROXY:-${http_proxy:-${HTTPS_PROXY:-${https_proxy}}}}"" >> inventory.ini
echo "openshift_https_proxy="${HTTPS_PROXY:-${https_proxy:-${HTTP_PROXY:-${http_proxy}}}}"" >> inventory.ini
if [ ! -z "${NO_PROXY:-${no_proxy}}" ]; then
__no_proxy="${NO_PROXY:-${no_proxy}},${IP},.${DOMAIN}"
else
__no_proxy="${IP},.${DOMAIN}"
fi
echo "openshift_no_proxy="${__no_proxy}"" >> inventory.ini
fi
mkdir -p /etc/origin/master/
touch /etc/origin/master/htpasswd
ansible-playbook -i inventory.ini openshift-ansible/playbooks/prerequisites.yml
ansible-playbook -i inventory.ini openshift-ansible/playbooks/deploy_cluster.yml
htpasswd -b /etc/origin/master/htpasswd ${USERNAME} ${PASSWORD}
oc adm policy add-cluster-role-to-user cluster-admin ${USERNAME}

Closing comment (2019-03-24T14:28:43Z): Dupe of #10969