Change:
YAML code examples have a Copy To Clipboard function. This function is broken on several pages. Example: code example in When you click the Copy To Clipboard icon, the following code is copied: which is not correct YAML because of extra indentation on all lines except of the first line: Indentation is broken when element responsible for rendering of code is itself indented, for example when it's part of ordered or unordered list: There are several places like this: and more
The error message "error parsing error converting YAML to JSON: yaml: line 2: mapping values are not allowed in this context" typically indicates a syntax error in your "" file. The error is likely in the second line of the YAML file, where mapping values are not correctly formatted. Here are a few common reasons that can cause this error and how to resolve them: Incorrect YAML Formatting: Make sure your YAML file is correctly formatted. YAML is sensitive to indentation and structure. Ensure that the YAML keys and values are properly indented and aligned. YAML files use spaces for indentation, and each level should be indented by the same number of spaces. Improper Use of Tabs: YAML doesn't support tabs for indentation. Ensure that you are using spaces only for indentation in your YAML file. Unbalanced Quotes: Check if you have any unbalanced quotes (single or double) in your YAML file. Unbalanced quotes can lead to parsing errors. Invalid Characters: Verify that there are no special characters or control characters that might be causing issues in your YAML file. Incorrect Use of Dashes: YAML uses dashes to represent lists. Make sure that you are using the correct syntax for lists if applicable in your "" file. Errors in Line 2: Since the error message points to line 2, double-check that the syntax in line 2 is correct. Ensure that it is a valid YAML key-value pair. To help you further, it would be helpful if you can share the content of your "" file. That way, I can assist you in identifying the specific issue in the YAML file and provide a solution to resolve it.
YAML is correct, it goes directly from But when you use Copy To Clipboard icon on this page and paste it from the clipboard, it gets broken.
I can replicate this. /triage accepted /priority backlog /area web-development

Discussion:
una [specifica pod](/esempi/debug/counter-pod.yaml) con un contenitore che scrive del testo sullo standard output una volta al secondo. <del> {{< codenew file="debug/counter-pod.yaml" >}} </del> <ins> {{% codenew file="debug/counter-pod.yaml" %}} </ins> Per eseguire questo pod, utilizzare il seguente comando:

scrive su due file di registro diversi, utilizzando due formati diversi. Ecco un file di configurazione per il pod: <del> {{< codenew file="admin/logging/two-files-counter-pod.yaml" >}} </del> <ins> {{% codenew file="admin/logging/two-files-counter-pod.yaml" %}} </ins> Sarebbe un disastro avere voci di registro di diversi formati nello stesso registro stream, anche se si è riusciti a reindirizzare entrambi i componenti al flusso `stdout` di

Ecco un file di configurazione per un pod con due contenitori sidecar: <del> {{< codenew file="admin/logging/two-files-counter-pod-streaming-sidecar.yaml" >}} </del> <ins> {{% codenew file="admin/logging/two-files-counter-pod-streaming-sidecar.yaml" %}} </ins> Ora quando si esegue questo pod, è possibile accedere separatamente a ciascun flusso di log eseguendo i seguenti comandi:

puoi usare per implementare questo approccio. Il primo file contiene a [ConfigMap](/docs/tasks/configure-pod-container/configure-pod-configmap/) per configurare fluentd. <del> {{< codenew file="admin/logging/fluentd-sidecar-config.yaml" >}} </del> <ins> {{% codenew file="admin/logging/fluentd-sidecar-config.yaml" %}} </ins> {{< note >}} La configurazione di fluentd esula dallo scopo di questo articolo. Per

Il secondo file descrive un pod con un contenitore sidecar in esecuzione fluentd. Il pod monta un volume dove fluentd può raccogliere i suoi dati di configurazione. <del> {{< codenew file="admin/logging/two-files-counter-pod-agent-sidecar.yaml" >}} </del> <ins> {{% codenew file="admin/logging/two-files-counter-pod-agent-sidecar.yaml" %}} </ins> Dopo un po 'di tempo è possibile trovare i messaggi di registro nell'interfaccia Stackdriver.

Molte applicazioni richiedono la creazione di più risorse, ad esempio una distribuzione e un servizio. La gestione di più risorse può essere semplificata raggruppandole nello stesso file (separate da `---` in YAML). Per esempio: <del> {{< codenew file="application/nginx-app.yaml" >}} </del> <ins> {{% codenew file="application/nginx-app.yaml" %}} </ins> Multiple resources can be created the same way as a single resource: