GarbageYard

service_ingress_details

Sep 10th, 2017
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 3.61 KB | None | 0 0
  1. Application that i want to expose outside cluster:
  2. [root@cent-gluster-workstation ~]# cat gitlab-service.yaml
  3. apiVersion: v1
  4. kind: Service
  5. metadata:
  6.   creationTimestamp: null
  7.   labels:
  8.     io.kompose.service: gitlab
  9.   name: gitlab
  10. spec:
  11.   type: LoadBalancer
  12.   ports:
  13.   - name: "443"
  14.     port: 443
  15.     targetPort: 443
  16.   - name: "80"
  17.     port: 80
  18.     targetPort: 80
  19.   - name: "10022"
  20.     port: 10022
  21.     targetPort: 22
  22.   selector:
  23.     io.kompose.service: gitlab
  24. status:
  25.   loadBalancer: {}
  26.  
  27. --------------------------------------------------------------
  28.  
  29. [root@cent-gluster-workstation ~]# cat gitlab-ingress.yaml
  30. apiVersion: extensions/v1beta1
  31. kind: Ingress
  32. metadata:
  33.   name: gitlab-ingress
  34. spec:
  35.   backend:
  36.     serviceName: gitlab
  37.     servicePort: 80
  38.  
  39. --------------------------------------------------------------
  40.  
  41. [root@cent-gluster-workstation service-loadbalancer]# cat rc.yaml
  42. apiVersion: v1
  43. kind: ReplicationController
  44. metadata:
  45.   name: service-loadbalancer
  46.   labels:
  47.     app: service-loadbalancer
  48.     version: v1
  49. spec:
  50.   replicas: 1
  51.   selector:
  52.     app: service-loadbalancer
  53.     version: v1
  54.   template:
  55.     metadata:
  56.       labels:
  57.         app: service-loadbalancer
  58.         version: v1
  59.     spec:
  60.       nodeSelector:
  61.         role: loadbalancer
  62.       containers:
  63.       - image: gcr.io/google_containers/servicelb:0.4
  64.         imagePullPolicy: Always
  65.         livenessProbe:
  66.           httpGet:
  67.             path: /healthz
  68.             port: 8081
  69.             scheme: HTTP
  70.           initialDelaySeconds: 30
  71.           timeoutSeconds: 5
  72.         name: haproxy
  73.         ports:
  74.        # All http services
  75.         - containerPort: 80
  76.           hostPort: 80
  77.           protocol: TCP
  78.         # nginx https
  79.         - containerPort: 443
  80.           hostPort: 8080
  81.           protocol: TCP
  82.         # haproxy stats
  83.         - containerPort: 1936
  84.           hostPort: 1936
  85.           protocol: TCP
  86.         resources: {}
  87.  
  88. --------------------------------------------------------------
  89.  
  90. [root@cent-gluster-workstation ~]# kubectl get -o yaml svc gitlab
  91. apiVersion: v1
  92. kind: Service
  93. metadata:
  94.   annotations:
  95.     kubectl.kubernetes.io/last-applied-configuration: |
  96.      {"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"creationTimestamp":null,"labels":{"io.kompose.service":"gitlab"},"name":"gitlab","namespace":"default"},"spec":{"ports":[{"name":"443","port":443,"targetPort":443},{"name":"80","port":80,"targetPort":80},{"name":"10022","port":10022,"targetPort":22}],"selector":{"io.kompose.service":"gitlab"},"type":"LoadBalancer"},"status":{"loadBalancer":{}}}
  97.   creationTimestamp: 2017-09-08T09:42:31Z
  98.   labels:
  99.     io.kompose.service: gitlab
  100.   name: gitlab
  101.   namespace: default
  102.   resourceVersion: "321850"
  103.   selfLink: /api/v1/namespaces/default/services/gitlab
  104.   uid: 08ea0247-947a-11e7-91f5-023b4c0eea15
  105. spec:
  106.   clusterIP: 10.43.85.137
  107.   externalTrafficPolicy: Cluster
  108.   ports:
  109.   - name: "443"
  110.     nodePort: 30812
  111.     port: 443
  112.     protocol: TCP
  113.     targetPort: 443
  114.   - name: "80"
  115.     nodePort: 32483
  116.     port: 80
  117.     protocol: TCP
  118.     targetPort: 80
  119.   - name: "10022"
  120.     nodePort: 31588
  121.     port: 10022
  122.     protocol: TCP
  123.     targetPort: 22
  124.   selector:
  125.     io.kompose.service: gitlab
  126.   sessionAffinity: None
  127.   type: LoadBalancer
  128. status:
  129.   loadBalancer:
  130.     ingress:
  131.     - ip: 10.128.0.10
  132.     - ip: 10.128.0.10
  133.     - ip: 10.128.0.10
  134.  
  135. --------------------------------------------------------------
  136.  
  137. [root@cent-gluster-workstation ~]# kubectl get ing
  138. NAME             HOSTS     ADDRESS       PORTS     AGE
  139. gitlab-ingress   *         10.128.0.14   80        35m
Add Comment
Please, Sign In to add comment