Skip to content

Commit 2f67dd2

Browse files
committed
Add bash and yaml identifiers to code blocks
1 parent 1248462 commit 2f67dd2

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

docs/configuration/agent/pki-certificates.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ but a consistent method should be used, for example `<cluster-name>.<CA-ROOT-DOM
175175

176176
Replace the `<cluster-name>` and `<Organizational Unit>` tokens to match your requirements:
177177

178-
```
178+
```yaml
179179
apiVersion: cert-manager.io/v1
180180
kind: Certificate
181181
metadata:
@@ -199,7 +199,7 @@ but need to transpose it into the cluster secret.
199199
200200
Extract the fields we need into environment variables:
201201
202-
```
202+
```bash
203203
export PRINCIPAL_AGENT_CA=$(kubectl get secret <cluster-name>-principal -o jsonpath='{.data.ca\.crt}')
204204
export PRINCIPAL_AGENT_TLS=$(kubectl get secret <cluster-name>-principal -o jsonpath='{.data.tls\.crt}')
205205
export PRINCIPAL_AGENT_KEY=$(kubectl get secret <cluster-name>-principal -o jsonpath='{.data.tls\.key}')
@@ -208,7 +208,7 @@ export PRINCIPAL_AGENT_KEY=$(kubectl get secret <cluster-name>-principal -o json
208208
To create the `<cluster-name>-cluster` secret that is needed we must first create the `config` block
209209
with the certs:
210210

211-
```
211+
```bash
212212
cat << EOF > config
213213
{
214214
"tlsClientConfig": {
@@ -223,7 +223,7 @@ EOF
223223

224224
Now create the secret:
225225

226-
```
226+
```bash
227227
kubectl create secret generic <cluster-name>-cluster -n argocd --from-literal=name=<cluster-name> --from-literal=server=https://argocd-agent-resource-proxy:9090?agentName=<cluster-name> --from-file=config=./config
228228
```
229229
!!! note "Add unique query parameter to server"
@@ -233,7 +233,7 @@ kubectl create secret generic <cluster-name>-cluster -n argocd --from-literal=na
233233
as shown in this example.
234234

235235
Then label the secret as a cluster secret and include the label to identify the matching agent:
236-
```
236+
```bash
237237
kubectl label secret <cluster-name>-cluster argocd.argoproj.io/secret-type=cluster
238238
kubectl label secret <cluster-name>-cluster argocd-agent.argoproj-labs.io/agent-name=<cluster-name>
239239
```
@@ -250,7 +250,7 @@ be minted on the Principal where the Issuer is available and then moved to the A
250250
the Agents will at times run in less secure locations/networks then the Principle so isolating
251251
the CA to one location, the principal, is beneficial.
252252

253-
```
253+
```yaml
254254
apiVersion: cert-manager.io/v1
255255
kind: Certificate
256256
metadata:
@@ -271,7 +271,7 @@ spec:
271271
272272
Output the secret to a file as we need to install it on the cluster where the Agent resides:
273273
274-
```
274+
```bash
275275
kubectl get secret <cluster-name>-agent -o yaml -n argocd | kubectl neat > <cluster-name>-agent.yaml
276276
```
277277

@@ -285,21 +285,21 @@ the security reasons discussed earlier.
285285
!!! note "Using yq"
286286
The command `yq` is used to modify the secret, if `yq` is not available simply edit the secret as needed.
287287

288-
```
288+
```bash
289289
kubectl get secret argocd-agent-ca -o yaml -n argocd | yq 'del(.data.["tls.key"])' -y | oc neat > argocd-agent-ca.yaml
290290
```
291291

292292
Change the secret type to `Opaque` since a Kubernetes TLS secret requires a key, additionally change the name of the exported secret from `<cluster-name>-agent` to
293293
to `argocd-agent-client-tls`.
294294

295-
```
296-
yq -i '.type = "Opaque"' ./argocd-agent-ca.yaml -y
295+
```bash
296+
yq -i '.type = "Opaque"' argocd-agent-ca.yaml -y
297297
yq -i '.metadata.name = "argocd-agent-client-tls"' <path-to-secret>/<cluster-name>-agent.yaml -y
298298
```
299299

300300
On the Agent cluster apply the two secrets:
301301

302-
```
302+
```bash
303303
kubectl apply -f ./argocd-agent-ca.yaml
304304
kubectl apply -f <cluster-name>-agent.yaml
305305
```

docs/configuration/principal/pki-certificates.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,25 +156,25 @@ certificates on demand.
156156

157157
Create private key with openssl
158158

159-
```
159+
```bash
160160
openssl genrsa -out ca.key 4096
161161
```
162162

163163
Create root certificate using the generated key:
164164

165-
```
165+
```bash
166166
openssl req -new -x509 -sha256 -days 3650 -key ca.key -out ca.crt
167167
```
168168

169169
Create a CA secret in Kubernetes:
170170

171-
```
171+
```bash
172172
kubectl create secret tls argocd-agent-ca --cert=ca.crt --key=ca.key -n argocd
173173
```
174174

175175
Create cert-manager issuer for the CA we generated previously:
176176

177-
```
177+
```yaml
178178
apiVersion: cert-manager.io/v1
179179
kind: Issuer
180180
metadata:
@@ -190,7 +190,7 @@ spec:
190190
Generate the server certificate for the principal's gRPC service, `argocd-agent-principal-tls`, using cert-manager Certificate.
191191
Make sure you update the `organizationalUnits` and `dnsNames` to reflect the values for your installation:
192192

193-
```
193+
```yaml
194194
apiVersion: cert-manager.io/v1
195195
kind: Certificate
196196
metadata:
@@ -215,7 +215,7 @@ Next generate the certificate for the resource proxy, note the `dnsNames` may no
215215
need to be changed here since it is an internal service unless you are using a different
216216
namespace then `argocd`. However update your `organizationalUnits` as desired:
217217

218-
```
218+
```yaml
219219
apiVersion: cert-manager.io/v1
220220
kind: Certificate
221221
metadata:
@@ -239,7 +239,7 @@ spec:
239239
Confirm that the certificates have been deployed and are ready, `READY` should be `True` for both certs as
240240
per this example:
241241

242-
```
242+
```bash
243243
$ kubectl get certificate -n argocd
244244
NAME READY SECRET AGE
245245
argocd-agent-principal-tls True argocd-agent-principal-tls 4m8s

0 commit comments

Comments
 (0)