Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- apiVersion: apps/v1
- kind: Deployment
- metadata:
- labels:
- run: app
- name: app
- spec:
- replicas: 2
- selector:
- matchLabels:
- run: app
- template:
- metadata:
- labels:
- run: app
- spec:
- containers:
- - name: nginx-deploy
- image: nginx
- ports:
- - containerPort: 80
- ---
- apiVersion: v1
- kind: Service
- metadata:
- labels:
- run: app
- name: app
- annotations:
- haproxy.org/check: "enabled"
- haproxy.org/forwarded-for: "enabled"
- haproxy.org/load-balance: "roundrobin"
- spec:
- selector:
- run: app
- ports:
- - name: http
- port: 80
- protocol: TCP
- targetPort: 80
- ---
- apiVersion: v1
- kind: ConfigMap
- metadata:
- name: haproxy-configmap
- namespace: default
- data:
- ---
- apiVersion: apps/v1
- kind: Deployment
- metadata:
- labels:
- run: haproxy-ingress
- name: haproxy-ingress
- namespace: default
- spec:
- replicas: 1
- selector:
- matchLabels:
- run: haproxy-ingress
- template:
- metadata:
- labels:
- run: haproxy-ingress
- spec:
- serviceAccountName: haproxy-ingress-service-account
- containers:
- - name: haproxy-ingress
- image: haproxytech/kubernetes-ingress
- args:
- - --configmap=default/haproxy-configmap
- - --ingress-class=haproxy-ingress
- ports:
- - name: http
- containerPort: 80
- ---
- apiVersion: v1
- kind: Service
- metadata:
- labels:
- run: haproxy-ingress
- name: haproxy-ingress
- namespace: default
- spec:
- selector:
- run: haproxy-ingress
- type: LoadBalancer
- ports:
- - name: http
- port: 80
- protocol: TCP
- targetPort: 80
- ---
- apiVersion: networking.k8s.io/v1beta1
- kind: Ingress
- metadata:
- name: haproxy-ingress
- annotations:
- kubernetes.io/ingress.class: "haproxy-ingress"
- ingress.kubernetes.io/ssl-redirect: "false"
- ingress.kubernetes.io/app-root: "/"
- ingress.kubernetes.io/rewrite-target: "/"
- spec:
- rules:
- - host: web-app.local
- http:
- paths:
- - path: /
- backend:
- serviceName: app
- servicePort: 80
- ---
- apiVersion: v1
- kind: ServiceAccount
- metadata:
- name: haproxy-ingress-service-account
- namespace: default
- ---
- kind: ClusterRole
- apiVersion: rbac.authorization.k8s.io/v1
- metadata:
- name: haproxy-ingress-cluster-role
- rules:
- - apiGroups:
- - ""
- resources:
- - configmaps
- - endpoints
- - nodes
- - pods
- - services
- - namespaces
- - events
- - serviceaccounts
- verbs:
- - get
- - list
- - watch
- - apiGroups:
- - "extensions"
- resources:
- - ingresses
- - ingresses/status
- verbs:
- - get
- - list
- - watch
- - apiGroups:
- - ""
- resources:
- - secrets
- verbs:
- - get
- - list
- - watch
- - create
- - patch
- - update
- - apiGroups:
- - extensions
- resources:
- - ingresses
- verbs:
- - get
- - list
- - watch
- ---
- kind: ClusterRoleBinding
- apiVersion: rbac.authorization.k8s.io/v1
- metadata:
- name: haproxy-ingress-cluster-role-binding
- namespace: default
- roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: ClusterRole
- name: haproxy-ingress-cluster-role
- subjects:
- - kind: ServiceAccount
- name: haproxy-ingress-service-account
- namespace: default
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement