fabric8io / gofabric8

CLI used when working with fabric8 running on Kubernetes or OpenShift
https://fabric8.io/
Apache License 2.0
147 stars 72 forks source link

What are the requirements k8s environment #148

Open BoriszhangSec opened 8 years ago

BoriszhangSec commented 8 years ago

hello all: i deployment f8 on k8s-mesos, I always have all sorts of problems, I want to know what f8 to k8s have rigid demand, must satisfy the conditions to deployment is successful, if you can list, I think for the couple, will be easier to troubleshoot problems.

                    thanks:)
jstrachan commented 8 years ago

The requirement is a kubernetes or openshift cluster really. We do assume that kubernetes DNS works. There can be challenges getting access to services externally from the cluster - we have a microservice to help deal with the various complexities involved https://github.com/fabric8io/exposecontroller

We've used fabric8 on many different kinds of installation (local, openshift, GKE, EC2 etc).

How about you raise issues for what goes wrong on your mesos cluster and we can try figure it out?

BoriszhangSec commented 8 years ago

@jstrachan

this is infomation

environment: km apiserver --version Kubernetes v1.3.6+ae4550c

cat /etc/os-release NAME="CentOS Linux" VERSION="7 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="7" PRETTY_NAME="CentOS Linux 7 (Core)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:7" HOME_URL="https://www.centos.org/" BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7" CENTOS_MANTISBT_PROJECT_VERSION="7" REDHAT_SUPPORT_PRODUCT="centos" REDHAT_SUPPORT_PRODUCT_VERSION="7"

docker version

Client: Version: 1.12.1 API version: 1.24 Go version: go1.6.3 Git commit: 23cf638 Built:
OS/Arch: linux/amd64

Server: Version: 1.12.1 API version: 1.24 Go version: go1.6.3 Git commit: 23cf638 Built:
OS/Arch: linux/amd64

kubectl get node NAME STATUS AGE shiku-paas-master1 Ready 22h shiku-paas-master2 Ready 22h shiku-paas-slave1 Ready 22h shiku-paas-slave2 Ready 22h shiku-paas-slave3 Ready 22h

ps -ef | grep km

root 9489 1 1 16:42 ? 00:01:09 km apiserver --allow-privileged=true --address=192.168.1.151 --etcd-servers=http://192.168.1.151:4001 --service-cluster-ip-range=10.10.10.0/24 --port=8080 --cloud-provider=mesos --cloud-config=/etc/mesos-cloud.conf --secure-port=0 --v=4 root 9503 1 1 16:42 ? 00:00:48 km controller-manager --master=192.168.1.151:8080 --cloud-provider=mesos --cluster-name=kubernetes --namespace-sync-period=20m0s --address=192.168.1.151 --cloud-config=/etc/mesos-cloud.conf --v=4 root 9516 1 0 16:42 ? 00:00:27 km scheduler --address=192.168.1.151 --docker=unix:///var/run/docker.sock --framework-name=Kubernetes --allow-privileged=true --mesos-master=192.168.1.155:5050 --etcd-servers=http://192.168.1.151:4001 --mesos-user=root --api-servers=192.168.1.151:8080 --cluster-dns=10.10.10.53 --cluster-domain=cluster.local --v=4

ps -ef | grep mesos-master /opt/mesosinstall/sbin/mesos-master --work_dir=/var/lib/mesos --log_dir=/opt/mesoslog --registry_fetch_timeout=10mins

kubectl exec busybox -- nslookup kubernetes.default Server: 10.10.10.53 Address 1: 10.10.10.53 kube-dns.kube-system.svc.cluster.local

Name: kubernetes.default Address 1: 10.10.10.1 kubernetes.default.svc.cluster.local

deploy command: gofabric8 deploy -y --version-ipaas=2.2.151 --fabric8-version=2.2.173 --version-devops=2.3.18 --namespace=fabric8 --domain=f8.cluster.local

image

image

image

Deployed for a long time, I have been these two services have a problem

rawlingsj commented 8 years ago

I think we can reuse the getting started docs for AWS here. If they help we can pull them out to a higher level and use them in a getting started with Mesos guide too. This might help?

http://fabric8.io/guide/getStarted/aws.html#install-the-fabric8-microservices-platform

At the end of running gofabric8 deploy there should have been a summary saying which Kubernetes Node was assigned the externalIP=true label, this is used to find the node to schedule the nginx-ingress controller on. Did this happen?

kubectl get nodes -l externalIP=true

My guess at the moment is one of two things for the ingress-nginx pod:

  1. the label wasn't added for some reason when running gofabric8 deploy, any errors during gofabric8 deploy?
  2. there was a port clash, I've seen this before when the externalIP=true is on the same node as the kubernetes master and there's a 443 port conflict
kubectl label node $EXISTING_NODE  externalIP-
kubectl label node $NEW_NODE  externalIP=true

Also, can you get the events from the CLI to see if there's anymore information there?

kubectl describe rs exposecontroller

and

kubectl describe rs ingress-nginx
rawlingsj commented 8 years ago

We also have a blog that helps explain more about the role of the exposecontroller in case you'd like more background information https://blog.fabric8.io/accessing-your-applications-on-kubernetes-or-openshift-3e69be0ad3bc#.2n8e1s5gg