GarbageYard

haproxy_lb_ha_kubernetes

Sep 11th, 2017
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 3.78 KB | None | 0 0
  1. [root@cent-gluster-workstation service-loadbalancer]# cat rc.yaml
  2. apiVersion: v1
  3. kind: ReplicationController
  4. metadata:
  5.   name: service-loadbalancer
  6.   labels:
  7.     app: service-loadbalancer
  8.     version: v1
  9. spec:
  10.   replicas: 3
  11.   selector:
  12.     app: service-loadbalancer
  13.     version: v1
  14.   template:
  15.     metadata:
  16.       labels:
  17.         app: service-loadbalancer
  18.         version: v1
  19.     spec:
  20.       nodeSelector:
  21.         role: loadbalancer
  22.       containers:
  23.       - image: gcr.io/google_containers/servicelb:0.4
  24.         imagePullPolicy: Always
  25.         livenessProbe:
  26.           httpGet:
  27.             path: /healthz
  28.             port: 8081
  29.             scheme: HTTP
  30.           initialDelaySeconds: 30
  31.           timeoutSeconds: 5
  32.         name: haproxy
  33.         ports:
  34.        # All http services
  35.         - containerPort: 80
  36.           hostPort: 80
  37.           protocol: TCP
  38.         # nginx https
  39.         - containerPort: 443
  40.           hostPort: 8080
  41.           protocol: TCP
  42.         # haproxy stats
  43.         - containerPort: 1936
  44.           hostPort: 1936
  45.           protocol: TCP
  46.         resources: {}
  47.  
  48. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  49.  
  50. [root@cent-gluster-workstation service-loadbalancer]# kubectl get rc service-loadbalancer
  51. NAME                   DESIRED   CURRENT   READY     AGE
  52. service-loadbalancer   3         3         3         21h
  53.  
  54. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  55.  
  56. [root@cent-gluster-workstation service-loadbalancer]# kubectl describe rc service-loadbalancer
  57. Name:          service-loadbalancer
  58. Namespace:     default
  59. Selector:      app=service-loadbalancer,version=v1
  60. Labels:        app=service-loadbalancer
  61.                 version=v1
  62. Annotations:   kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"v1","kind":"ReplicationController","metadata":{"annotations":{},"labels":{"app":"service-loadbalancer","version":"v1"},"name":"service-l...
  63. Replicas:       3 current / 3 desired
  64. Pods Status:    3 Running / 0 Waiting / 0 Succeeded / 0 Failed
  65. Pod Template:
  66.  Labels:       app=service-loadbalancer
  67.                version=v1
  68.  Containers:
  69.   haproxy:
  70.    Image:      gcr.io/google_containers/servicelb:0.4
  71.    Ports:      80/TCP, 443/TCP, 1936/TCP
  72.    Args:
  73.      --tcp-services=nginxsvc:443
  74.    Liveness:           http-get http://:8081/healthz delay=30s timeout=5s period=10s #success=1 #failure=3
  75.    Environment:        <none>
  76.    Mounts:             <none>
  77.  Volumes:              <none>
  78. Events:
  79.  FirstSeen     LastSeen        Count   From                    SubObjectPath   Type            Reason                  Message
  80.  ---------     --------        -----   ----                    -------------   --------        ------                  -------
  81.  8m            8m              1       replication-controller                  Normal          SuccessfulCreate        Created pod: service-loadbalancer-0v1tl
  82.  8m            8m              1       replication-controller                  Normal          SuccessfulCreate        Created pod: service-loadbalancer-lcqr6
  83.  
  84. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  85.  
  86. [root@cent-gluster-workstation service-loadbalancer]# cat ~/gitlab-service.yaml
  87. apiVersion: v1
  88. kind: Service
  89. metadata:
  90.  creationTimestamp: null
  91.  labels:
  92.    io.kompose.service: gitlab
  93.  name: gitlab
  94. spec:
  95.  type: LoadBalancer
  96.  ports:
  97.  - name: "443"
  98.    port: 443
  99.    targetPort: 443
  100.  - name: "80"
  101.    port: 80
  102.    targetPort: 80
  103.  - name: "10022"
  104.    port: 10022
  105.    targetPort: 22
  106.  selector:
  107.    io.kompose.service: gitlab
  108. status:
  109.  loadBalancer: {}
  110.  
  111. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Add Comment
Please, Sign In to add comment