Skip to content

Commit 5a80e66

Browse files
committed
Change the annotation example
1 parent b9e7dfa commit 5a80e66

File tree

1 file changed

+41
-20
lines changed

1 file changed

+41
-20
lines changed

README.md

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -70,41 +70,62 @@ For annotations with bool value types, `"1"`, `"t"`, `"T"`, `"True"`, `"true"`
7070
#### Example usage
7171

7272
```yaml
73-
apiVersion: v1
7473
kind: Service
74+
apiVersion: v1
7575
metadata:
76-
name: wordpress-lsmnl-wordpress
77-
namespace: wordpress-lsmnl
76+
name: https-lb
7877
annotations:
7978
service.beta.kubernetes.io/linode-loadbalancer-throttle: "4"
8079
service.beta.kubernetes.io/linode-loadbalancer-default-protocol: "http"
8180
service.beta.kubernetes.io/linode-loadbalancer-port-443: |
8281
{
83-
"tls-secret-name": "prod-app-tls",
82+
"tls-secret-name": "example-secret",
8483
"protocol": "https"
8584
}
86-
labels:
87-
app: wordpress-lsmnl-wordpress
8885
spec:
8986
type: LoadBalancer
90-
clusterIP: 10.97.58.169
91-
externalTrafficPolicy: Cluster
87+
selector:
88+
app: nginx-https-example
9289
ports:
93-
- name: http
94-
nodePort: 32660
95-
port: 80
96-
protocol: TCP
97-
targetPort: http
98-
- name: https
99-
nodePort: 30806
100-
port: 443
101-
protocol: TCP
102-
targetPort: https
90+
- name: http
91+
protocol: TCP
92+
port: 80
93+
targetPort: http
94+
- name: https
95+
protocol: TCP
96+
port: 443
97+
targetPort: https
98+
99+
---
100+
apiVersion: apps/v1
101+
kind: Deployment
102+
metadata:
103+
name: nginx-https-deployment
104+
spec:
105+
replicas: 2
103106
selector:
104-
app: wordpress-lsmnl-wordpress
105-
sessionAffinity: None
107+
matchLabels:
108+
app: nginx-https-example
109+
template:
110+
metadata:
111+
labels:
112+
app: nginx-https-example
113+
spec:
114+
containers:
115+
- name: nginx
116+
image: nginx
117+
ports:
118+
- name: http
119+
containerPort: 80
120+
protocol: TCP
121+
- name: https
122+
containerPort: 80
123+
protocol: TCP
124+
106125
```
107126

127+
See more in the [examples directory](examples)
128+
108129
## Why `stickiness` and `algorithm` annotations don't exit
109130

110131
As kube-proxy will simply double-hop the traffic to a random backend Pod anyway, it doesn't matter which backend Node traffic is forwarded-to for the sake of session stickiness.

0 commit comments

Comments
 (0)