|
7 | 7 | "path/filepath" |
8 | 8 | "text/template" |
9 | 9 |
|
| 10 | + constants "github.com/cofide/spiffe-enable/internal/const" |
10 | 11 | "github.com/cofide/spiffe-enable/internal/helper" |
11 | 12 | "github.com/cofide/spiffe-enable/internal/workload" |
12 | 13 | corev1 "k8s.io/api/core/v1" |
@@ -172,6 +173,7 @@ func NewEnvoy(params EnvoyConfigParams) (*Envoy, error) { |
172 | 173 | }, |
173 | 174 | }, |
174 | 175 | }, |
| 176 | + getSDSCluster(), |
175 | 177 | }, |
176 | 178 | }, |
177 | 179 | } |
@@ -200,6 +202,33 @@ func NewEnvoy(params EnvoyConfigParams) (*Envoy, error) { |
200 | 202 | return &Envoy{InitScript: renderedScript.String(), Cfg: envoyConfigJSON}, nil |
201 | 203 | } |
202 | 204 |
|
| 205 | +func getSDSCluster() map[string]interface{} { |
| 206 | + return map[string]interface{}{ |
| 207 | + "name": "sds-grpc", |
| 208 | + "connect_timeout": "5s", |
| 209 | + "type": "STATIC", |
| 210 | + "http2_protocol_options": map[string]interface{}{}, |
| 211 | + "load_assignment": map[string]interface{}{ |
| 212 | + "cluster_name": "sds-grpc", |
| 213 | + "endpoints": []interface{}{ |
| 214 | + map[string]interface{}{ |
| 215 | + "lb_endpoints": []interface{}{ |
| 216 | + map[string]interface{}{ |
| 217 | + "endpoint": map[string]interface{}{ |
| 218 | + "address": map[string]interface{}{ |
| 219 | + "pipe": map[string]interface{}{ |
| 220 | + "path": constants.SPIFFEWLSocketPath, |
| 221 | + }, |
| 222 | + }, |
| 223 | + }, |
| 224 | + }, |
| 225 | + }, |
| 226 | + }, |
| 227 | + }, |
| 228 | + }, |
| 229 | + } |
| 230 | +} |
| 231 | + |
203 | 232 | func (e *Envoy) GetConfigVolume() corev1.Volume { |
204 | 233 | return corev1.Volume{ |
205 | 234 | Name: EnvoyConfigVolumeName, |
|
0 commit comments