@@ -121,10 +121,10 @@ remove the `ring` from the HLD repository and subsequently, the cluster, follow
121
121
the manual steps outlined
122
122
[ here.] ( manual-guide-to-rings.md#removing-the-ring-from-the-cluster )
123
123
124
- ### Setting the Default Ring
124
+ ### Setting the Default Ring / Routing
125
125
126
- For every bedrock project, there will be a default ring. By default, this is the
127
- ` master ` ring, which corresponds to the master branch of the repository.
126
+ For every bedrock project, there may be a single default ring. By default, this
127
+ is the ` master ` ring, which corresponds to the master branch of the repository.
128
128
129
129
For a ` bedrock.yaml ` :
130
130
@@ -134,15 +134,69 @@ rings:
134
134
isDefault : true
135
135
develop :
136
136
isDefault : false
137
- services : ...
137
+ qa : {} # isDefault not present is same as isDefault: false
138
+ services :
139
+ ./my-service-foo :
140
+ displayName : fancy-service
141
+ helm :
142
+ chart :
143
+ accessTokenVariable : MY_ENV_VAR
144
+ branch : master
145
+ git : " https://dev.azure.com/my-org/my-project/_git/my-repo"
146
+ path : my-service-helm-chart
147
+ k8sBackend : backend-service
148
+ k8sBackendPort : 80
149
+ middlewares : []
150
+ pathPrefix : " "
151
+ pathPrefixMajorVersion : " "
138
152
` ` `
139
153
140
154
the property ` isDefault` denotes which `ring` is the default ring.
141
155
142
- Currently this property is only being used by the `spk service create-revision`
143
- command. Details can be found
156
+ Being a _default_ ring means an additional set of Traefik2 IngressRoute and
157
+ Middleware will be created for its services in the Manifest-Generation pipeline.
158
+ These IngressRoute and Middleware will not be _ringed_ (i.e. not require a
159
+ header to ping it) but point to the same underlying Kubernetes service as its
160
+ ringed counterpart. In the example of above, the Manifest-Generation pipeline
161
+ will generate the following ingress routes :
162
+
163
+ ` ` ` yaml
164
+ apiVersion: traefik.containo.us/v1alpha1
165
+ kind: IngressRoute
166
+ metadata:
167
+ name: fancy-service-master
168
+ spec:
169
+ routes:
170
+ - kind: Rule
171
+ match: "PathPrefix(` /fancy-service`) && Headers(`Ring`, `master`)" # a route still requiring a the Ring header
172
+ middlewares :
173
+ - name : fancy-service-master
174
+ services :
175
+ - name : backend-service-master # the ringed version of the k8s backend service
176
+ port : 80
177
+
178
+ ---
179
+ apiVersion : traefik.containo.us/v1alpha1
180
+ kind : IngressRoute
181
+ metadata :
182
+ name : fancy-service
183
+ spec :
184
+ routes :
185
+ - kind : Rule
186
+ match : PathPrefix(`/fancy-service`) # a route freely exposed without a Ring header
187
+ middlewares :
188
+ - name : fancy-service
189
+ services :
190
+ - name : backend-service-master # points to the same backend service as its ringed counterpart
191
+ port : 80
192
+ ` ` `
193
+
194
+ In addition this property is used by the ` spk service create-revision` command.
195
+ Details can be found
144
196
[here.](https://catalystcode.github.io/spk/commands/index.html#service_create-revision)
145
197
198
+ Note : there can only be 1 (one) ringed marked as `isDefault`.
199
+
146
200
# ## What Services Have What Rings?
147
201
148
202
For each ring defined in your `bedrock.yaml` file, every services
@@ -216,8 +270,14 @@ ping our services now via a curl command containing the header
216
270
ping :
217
271
218
272
` ` ` sh
273
+ curl -H 88.88.88.88/foo/
274
+ curl -H 88.88.88.88/bar/
219
275
curl -H "Ring: master" 88.88.88.88/foo/
220
276
curl -H "Ring: master" 88.88.88.88/bar/
221
277
curl -H "Ring: develop" 88.88.88.88/foo/
222
278
curl -H "Ring: develop" 88.88.88.88/bar/
223
279
` ` `
280
+
281
+ Note : the curl requests with and without the header `Ring: master` will be point
282
+ to the same underlying service Kubernetes service (refer to :
283
+ [Setting A Default Ring](#setting-the-default-ring--routing))
0 commit comments