Merge pull request #1259 from jcmoraisjr/jm-ns-var-haproxy

Add namespace var to HAProxy deployments
This commit is contained in:
Manuel Alejandro de Brito Fontes 2017-08-28 21:14:20 -04:00 committed by GitHub
commit 7844415cff
5 changed files with 14 additions and 17 deletions

View file

@ -6,7 +6,7 @@ This example uses a [ConfigMap](https://kubernetes.io/docs/user-guide/configmap/
This document has the following prerequisites: This document has the following prerequisites:
Deploy only the tls-secret and the default backend from the [deployment instructions](../../../deployment/haproxy/) Deploy only the tls-secret and the default backend from the [deployment instructions](/examples/deployment/haproxy)
## Customize the HAProxy configuration ## Customize the HAProxy configuration
@ -15,16 +15,17 @@ Using a [ConfigMap](https://kubernetes.io/docs/user-guide/configmap/) is possibl
For example, if we want to change the syslog-endpoint we need to create a ConfigMap: For example, if we want to change the syslog-endpoint we need to create a ConfigMap:
``` ```
$ kubectl create configmap haproxy-conf --from-literal=syslog-endpoint=172.17.8.101 $ kubectl create configmap haproxy-ingress --from-literal=syslog-endpoint=172.17.8.101
``` ```
Create the HAProxy Ingress deployment: Create the HAProxy Ingress deployment:
``` ```
$ kubectl create -f haproxy-custom-configuration.yaml $ kubectl create -f haproxy-custom-configuration.yaml
``` ```
The only difference from the deployment instructions is the --configmap parameter: The only difference from the deployment instructions is the --configmap parameter:
``` ```
- --configmap=default/haproxy-conf - --configmap=default/haproxy-conf
``` ```

View file

@ -5,7 +5,6 @@ metadata:
run: haproxy-ingress run: haproxy-ingress
name: haproxy-ingress name: haproxy-ingress
spec: spec:
replicas: 1
selector: selector:
matchLabels: matchLabels:
run: haproxy-ingress run: haproxy-ingress
@ -18,9 +17,9 @@ spec:
- name: haproxy-ingress - name: haproxy-ingress
image: quay.io/jcmoraisjr/haproxy-ingress image: quay.io/jcmoraisjr/haproxy-ingress
args: args:
- --default-backend-service=default/ingress-default-backend - --default-backend-service=$(POD_NAMESPACE)/ingress-default-backend
- --default-ssl-certificate=default/tls-secret - --default-ssl-certificate=$(POD_NAMESPACE)/tls-secret
- --configmap=default/haproxy-conf - --configmap=$(POD_NAMESPACE)/haproxy-ingress
ports: ports:
- name: http - name: http
containerPort: 80 containerPort: 80

View file

@ -13,10 +13,9 @@ spec:
containers: containers:
- name: haproxy-ingress - name: haproxy-ingress
image: quay.io/jcmoraisjr/haproxy-ingress image: quay.io/jcmoraisjr/haproxy-ingress
imagePullPolicy: IfNotPresent
args: args:
- --default-backend-service=default/default-http-backend - --default-backend-service=$(POD_NAMESPACE)/default-http-backend
- --default-ssl-certificate=default/tls-secret - --default-ssl-certificate=$(POD_NAMESPACE)/tls-secret
ports: ports:
- name: http - name: http
containerPort: 80 containerPort: 80

View file

@ -5,7 +5,6 @@ metadata:
run: haproxy-ingress run: haproxy-ingress
name: haproxy-ingress name: haproxy-ingress
spec: spec:
replicas: 1
selector: selector:
matchLabels: matchLabels:
run: haproxy-ingress run: haproxy-ingress
@ -18,9 +17,9 @@ spec:
- name: haproxy-ingress - name: haproxy-ingress
image: quay.io/jcmoraisjr/haproxy-ingress image: quay.io/jcmoraisjr/haproxy-ingress
args: args:
- --default-backend-service=default/ingress-default-backend - --default-backend-service=$(POD_NAMESPACE)/ingress-default-backend
- --default-ssl-certificate=default/tls-secret - --default-ssl-certificate=$(POD_NAMESPACE)/tls-secret
- --configmap=default/haproxy-ingress - --configmap=$(POD_NAMESPACE)/haproxy-ingress
ports: ports:
- name: http - name: http
containerPort: 80 containerPort: 80

View file

@ -17,10 +17,9 @@ spec:
containers: containers:
- name: haproxy-ingress - name: haproxy-ingress
image: quay.io/jcmoraisjr/haproxy-ingress image: quay.io/jcmoraisjr/haproxy-ingress
imagePullPolicy: IfNotPresent
args: args:
- --default-backend-service=default/default-http-backend - --default-backend-service=$(POD_NAMESPACE)/default-http-backend
- --default-ssl-certificate=default/tls-secret - --default-ssl-certificate=$(POD_NAMESPACE)/tls-secret
ports: ports:
- name: http - name: http
containerPort: 80 containerPort: 80