How do I check my Kubernets Master URL?
I'm trying to deploy metrics components, following the steps from tue URL: https://docs.openshift.org/latest/install_config/cluster_metrics.html#deploying-the-metrics-components
When I run:
oc new-app -f metrics-deployer.yaml
-p HAWKULAR_METRICS_HOSTNAME=pxl0docker001
-p USE_PERSISTENT_STORAGE=false
The pod logfile shows:
Creating the Cassandra Certificate Secrets configuration json file ++ base64 -w 0 /etc/deploy/_output/hawkular-cassandra.cert ++ base64 -w 0 /etc/deploy/_output/hawkular-cassandra-ca.cert Creating Hawkular Metrics & Cassandra Secrets
- echo 'Creating Hawkular Metrics & Cassandra Secrets'
- oc create -f /etc/deploy/_output/hawkular-metrics-secrets.json unable to connect to a server to handle "secrets": Get https://kubernetes.default.svc:443/api: http: error connecting to proxy http://user:password@localhost:8080: dial tcp [::1]:8080: getsockopt: connection refused
In the URL listed below, there is a topic with the instruction: "For instance, if you have a custom install in which the Kubernetes master is not available under https://kubernetes.default.svc:443 you can specify the value to use instead with the MASTER_URL parameter."
How can I identify this MASTER_URL parameter for use on the metrics-deployer.yaml file?
Thanks in advance.
Version
$ oc version oc v1.3.0-alpha.3+1148c68 kubernetes v1.3.0+507d3a7 features: Basic-Auth GSSAPI Kerberos SPNEGO
Server https://10.8.7.213:8443 openshift v1.3.0-alpha.3+1148c68 kubernetes v1.3.0+507d3a7
from within a pod, cluster DNS makes the kubernetes API available at https://kubernetes.default.svc:443
you might want to run diagnostics to make sure cluster DNS is working:
oadm diagnostics DiagnosticPod
@liggitt Results from within my openshift container:
$ oadm diagnostics DiagnosticPod [Note] Determining if client configuration exists for client/cluster diagnostics Info: Successfully read a client config file at '/var/lib/origin/openshift.local.config/master/admin.kubeconfig'
[Note] Running diagnostic: DiagnosticPod Description: Create a pod to run diagnostics from the application standpoint
Info: Output from the diagnostic pod (image openshift/origin-deployer:v1.3.0-alpha.3): [Note] Running diagnostic: PodCheckAuth Description: Check that service account credentials authenticate as expected
Info: Service account token successfully authenticated to master
Info: Service account token was authenticated by the integrated registry.
[Note] Running diagnostic: PodCheckDns
Description: Check that DNS within a pod works as expected
[Note] Summary of diagnostics execution (version v1.3.0-alpha.3):
[Note] Completed with no errors or warnings seen.
[Note] Summary of diagnostics execution (version v1.3.0-alpha.3+1148c68): [Note] Completed with no errors or warnings seen.
$ curl -v https://kubernetes.default.svc:443
- Could not resolve host: kubernetes.default.svc; Name or service not known
- Closing connection 0 curl: (6) Could not resolve host: kubernetes.default.svc; Name or service not known
$ ping kubernetes.default.svc ping: unknown host kubernetes.default.svc
$ oc get pods NAME READY STATUS RESTARTS AGE metrics-deployer-4ma42 0/1 Error 0 58m metrics-deployer-i2ocz 0/1 Error 0 2h metrics-deployer-l7h56 0/1 Error 0 56m metrics-deployer-rjidy 0/1 Error 0 1h metrics-deployer-tl7r2 0/1 Error 0 55m metrics-deployer-zzot1 0/1 Error 0 2h
@Shyckymn from where you issued "curl -v https://kubernetes.default.svc:443" ? This works only inside the cluster, you have to oc rsh into a running pod to make that succeed.
@liggitt @mfojtik - I'm running Docker and openshift (container) into the same server.
$ docker ps -a | grep -i openshift 1f2efda957fb openshift/origin-docker-registry:v1.3.0-alpha.3 "/bin/sh -c 'DOCKER_R" 2 days ago Up 2 days k8s_registry.6eb106be_docker-registry-1-ekorr_default_24eeaf26-6b98-11e6-be34-005056b90590_3c0f49a5 565561015f3a openshift/origin-pod:v1.3.0-alpha.3 "/pod" 2 days ago Up 2 days k8s_POD.e4a40125_docker-registry-1-ekorr_default_24eeaf26-6b98-11e6-be34-005056b90590_6eea5ae0 0c8d7c419a71 openshift/origin "/usr/bin/openshift s" 6 days ago Up About a minute origin
$ docker exec -it 0c8d7c419a71 bash
$ oc status In project default on server https://10.8.7.213:8443
svc/docker-registry - 172.30.78.43:5000 dc/docker-registry deploys docker.io/openshift/origin-docker-registry:v1.3.0-alpha.3 deployment #1 deployed 2 days ago - 1 pod
svc/kubernetes - 172.30.0.1 ports 443, 53->8053, 53->8053
View details with 'oc describe
$ oc describe svc/kubernetes
Name: kubernetes
Namespace: default
Labels: component=apiserver
provider=kubernetes
Selector:
$ oc get pods NAME READY STATUS RESTARTS AGE docker-registry-1-ekorr 1/1 Running 0 2d
$ oc login -u system:admin Logged into "https://10.8.7.213:8443" as "system:admin" using existing credentials.
You have access to the following projects and can switch between them with 'oc project
- default kube-system openshift openshift-infra
Using project "default".
$ curl -v https://kubernetes.default.svc:443
- Could not resolve host: kubernetes.default.svc; Name or service not known
- Closing connection 0 curl: (6) Could not resolve host: kubernetes.default.svc; Name or service not known
$ curl -v https://kubernetes.default.svc
- Could not resolve host: kubernetes.default.svc; Name or service not known
- Closing connection 0 curl: (6) Could not resolve host: kubernetes.default.svc; Name or service not known
Creating Hawkular Metrics & Cassandra Secrets unable to connect to a server to handle "secrets": Get https://kubernetes.default.svc:443/api: http: error connecting to proxy http://user:password@localhost:8080: dial tcp [::1]:8080: getsockopt: connection refused
It's still trying to access kubernetes service by proxy. I added the following lines in the metrics-deployer.yaml with no success: - name: NO_PROXY value: "https://kubernetes.default.svc:443"
@liggitt seems to be like an metrics installer problem (it should respect the NO_PROXY variable)
What exactly is the NO_PROXY variable? and why this is something Hawkular Metrics should explicitly handle itself?
IRC chat:
<agoldste> no_proxy means don't use an http proxy when connecting to < >
<agoldste> if you have http_proxy set
<mfojtik> agoldste: i think NO_PROXY=kubernetes.foo.svc.cluster:443 will do
Summary, we should update the deployer to accept an ENV_VAR of NO_PROXY assuming its an issue with the deployer. @Shyckymn can you point to the block in the metrics-deployer.yaml where you added this value or prove a link to the changed template?
https://docs.openshift.com/enterprise/3.2/install_config/http_proxies.html#configuring-hosts-for-proxies explains how to set {HTTP,HTTPS,NO}_PROXY systemwide, which I'm assuming is what you've done here. We should probably add ,kubernetes.default.svc to that suggested NO_PROXY value. At least, that should get past the immediate issue; we want to whitelist the API server by name, the problem I see is that it can be accessed by many names and I'm not sure if *.cluster.local would cover e.g. kubernetes.default.svc
I added these two lines in the metrics-deployer.yaml and now the installation works:
- name: "NO_PROXY" value: "kubernetes.default.svc,kubernetes.default.svc:443,kubernetes.foo.svc.cluster,kubernetes.foo.svc.cluster:443"
And now I have a new issue, but I will describe it in a new topic.
Closing this issue. Thanks for all your support!
Hello @liggitt please help me in changing openshift origin logo , I added the extendedStylesheets in assetConfig , but still nothing happens ?! please help I am in hurry for it :(
@Chisha14 this issue is not related to the logo, please open a new issue to track whatever problem you are having.
@mwringe sorry for disturbtion , I will thanks a lot ...