From 9b373cd6be3f10cc20618d77e14258158203f9fc Mon Sep 17 00:00:00 2001 From: soumyalj Date: Tue, 5 Jun 2018 16:13:13 -0700 Subject: [PATCH 1/5] Added secrets and registry sections --- .../rancher/v2.x/en/tasks/projects/_index.md | 69 ++++++++++++++++++- 1 file changed, 67 insertions(+), 2 deletions(-) diff --git a/content/rancher/v2.x/en/tasks/projects/_index.md b/content/rancher/v2.x/en/tasks/projects/_index.md index bfa8bc07408..4ed6468f14b 100644 --- a/content/rancher/v2.x/en/tasks/projects/_index.md +++ b/content/rancher/v2.x/en/tasks/projects/_index.md @@ -34,12 +34,77 @@ Coming Soon Coming Soon ## Using Private Registries +Private registries allow us to have repositories to hold containers that need to be private. +Private registries can be added in the UI and images in the registry can be used +while creating workloads. Registry can be added by providing a name, specifying +the scope and credentials for the chosen repositry. The scope of the registry can +be the one which is available to all namespaces or which is available to a +single namespace. + +In the UI, +1. Click on 'Add registry' +2. Provide a name +3. Choose the scope of the registry +4. Choose the Address [DockerHub, Quay.io, Custom] +5. Provide credentials of the registry chosen +6. Click 'Save' + +Once a registry is added in rancher, the images in the registry can be chosen to +create a workload + +a. From the workloads section, click on deploy a workload +b. Provide an image which is in the registry and choose the namespace + Ex: quay.io/username/testubuntu +c. Click on 'Launch'. The workload should get deployed successfully -Coming Soon ## Adding a Secret -Coming Soon +Secrets are used to hold sensitive information such as passwords. +Secret can be created in rancher by providing a name along with a keyvalue pair. + +The scope of the secret can be the one which is available to all namespaces or +which is available to a single namespace. +A secret which is created as available to all namespaces can be used to create +a workload in any namespace +A secret which is created as available to a single namespace can be used to +create to a workload in that single namespace + + +In the UI, +1. Click on 'Add secret' +2. Provide a name +3. Choose the scope of the secret +4. Fill in the key value pair +5. Click 'Save' + +Once a secret is created, it can be used in a workload. +A secret can be used in a workload in two ways: + +1. A workload can be created by using secret as a volume + +a. From the workloads section, click on 'Deploy' +b. Provide a docker image and choose the namespace +c. Click on volumes +d. Provide a volume name and default mode +e. Choose a secret which has been added +f. Add a mount point (Eg: /test) and subpath if required +g. Launch the workload + + +Once the workload is deployed, right click on the workload and execute the shell. +In the mount point provided while creating the workload, the secret keys can be +seen as files. The contents of the file will be the value of the secret + +2. A workload can be created by using secret as an env variable + +a. From the workloads section, click on 'Deploy' +b. Provide a docker image and choose the namespace +c. Click on 'Environment variables' and 'add from source' +d. Choose the type secret, source and keys. All keys or specific keys can be chosen +e. Prefix or alias can also be provided +g. Launch the workload + ## Launching a Catalog App From 8ea12336f1c8a7a561b0bc0e0f60331bec59b3bc Mon Sep 17 00:00:00 2001 From: Mark Bishop Date: Mon, 2 Jul 2018 21:10:42 -0700 Subject: [PATCH 2/5] tasks for adding registries and secrets --- .../rancher/v2.x/en/tasks/projects/_index.md | 114 ------------------ .../en/tasks/projects/add-a-secret/_index.md | 2 +- .../tasks/projects/add-registries/_index.md | 34 ++++++ .../tasks/projects/use-registries/_index.md | 76 ------------ 4 files changed, 35 insertions(+), 191 deletions(-) create mode 100644 content/rancher/v2.x/en/tasks/projects/add-registries/_index.md delete mode 100644 content/rancher/v2.x/en/tasks/projects/use-registries/_index.md diff --git a/content/rancher/v2.x/en/tasks/projects/_index.md b/content/rancher/v2.x/en/tasks/projects/_index.md index dd633c240fc..43214fef9d8 100644 --- a/content/rancher/v2.x/en/tasks/projects/_index.md +++ b/content/rancher/v2.x/en/tasks/projects/_index.md @@ -3,118 +3,4 @@ title: Projects weight: 3650 draft: true --- -<<<<<<< HEAD _Projects_ are a new feature in Rancher that allows you to group namespaces. Users can be added as members to the project, and the project owner can assign roles to each member to control their project access. -======= -Coming Soon - -## Creating a Project - -Coming Soon - -## Switching Projects - -Coming Soon - -## Adding / Managing Project Members - -Coming Soon - -## Adding SSL Certificates - -Coming Soon - -## Adding Configuration Maps - -Coming Soon - -## Enabling Project Logging - -Coming Soon - -## Adding Project Alerts - -Coming Soon - -## Using Private Registries -Private registries allow us to have repositories to hold containers that need to be private. -Private registries can be added in the UI and images in the registry can be used -while creating workloads. Registry can be added by providing a name, specifying -the scope and credentials for the chosen repositry. The scope of the registry can -be the one which is available to all namespaces or which is available to a -single namespace. - -In the UI, -1. Click on 'Add registry' -2. Provide a name -3. Choose the scope of the registry -4. Choose the Address [DockerHub, Quay.io, Custom] -5. Provide credentials of the registry chosen -6. Click 'Save' - -Once a registry is added in rancher, the images in the registry can be chosen to -create a workload - -a. From the workloads section, click on deploy a workload -b. Provide an image which is in the registry and choose the namespace - Ex: quay.io/username/testubuntu -c. Click on 'Launch'. The workload should get deployed successfully - - -## Adding a Secret - -Secrets are used to hold sensitive information such as passwords. -Secret can be created in rancher by providing a name along with a keyvalue pair. - -The scope of the secret can be the one which is available to all namespaces or -which is available to a single namespace. -A secret which is created as available to all namespaces can be used to create -a workload in any namespace -A secret which is created as available to a single namespace can be used to -create to a workload in that single namespace - - -In the UI, -1. Click on 'Add secret' -2. Provide a name -3. Choose the scope of the secret -4. Fill in the key value pair -5. Click 'Save' - -Once a secret is created, it can be used in a workload. -A secret can be used in a workload in two ways: - -1. A workload can be created by using secret as a volume - -a. From the workloads section, click on 'Deploy' -b. Provide a docker image and choose the namespace -c. Click on volumes -d. Provide a volume name and default mode -e. Choose a secret which has been added -f. Add a mount point (Eg: /test) and subpath if required -g. Launch the workload - - -Once the workload is deployed, right click on the workload and execute the shell. -In the mount point provided while creating the workload, the secret keys can be -seen as files. The contents of the file will be the value of the secret - -2. A workload can be created by using secret as an env variable - -a. From the workloads section, click on 'Deploy' -b. Provide a docker image and choose the namespace -c. Click on 'Environment variables' and 'add from source' -d. Choose the type secret, source and keys. All keys or specific keys can be chosen -e. Prefix or alias can also be provided -g. Launch the workload - - -## Launching a Catalog App - -Coming Soon - -## Creating a Pod Security Policy - -Coming Soon - ->>>>>>> 9b373cd6be3f10cc20618d77e14258158203f9fc diff --git a/content/rancher/v2.x/en/tasks/projects/add-a-secret/_index.md b/content/rancher/v2.x/en/tasks/projects/add-a-secret/_index.md index d6fcc6a94b9..819cb8d77c3 100644 --- a/content/rancher/v2.x/en/tasks/projects/add-a-secret/_index.md +++ b/content/rancher/v2.x/en/tasks/projects/add-a-secret/_index.md @@ -15,7 +15,7 @@ When creating a secret, you can make it available for any deployment within a pr >**Note:** Kubernetes classifies secrets, certificates, ConfigMaps, and registries all as [secrets](https://kubernetes.io/docs/concepts/configuration/secret/), and no two secrets in a project or namespace can have duplicate names. Therefore, to prevent conflicts, your secret must have a unique name among all secrets within your workspace. -1. Select a **Scope** for the secret. +1. Select a **Scope** for the secret. 1. From **Secret Values**, click **Add Secret Value** to add a key value pair. Add as many values as you need. diff --git a/content/rancher/v2.x/en/tasks/projects/add-registries/_index.md b/content/rancher/v2.x/en/tasks/projects/add-registries/_index.md new file mode 100644 index 00000000000..be7da2656b0 --- /dev/null +++ b/content/rancher/v2.x/en/tasks/projects/add-registries/_index.md @@ -0,0 +1,34 @@ +--- +title: Adding Registries +weight: +draft: true +--- + +Registries are secrets containing credentials used to authenticate with [private registries](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/). Deployments use these secrets to authenticate with a private registry and then pull a Docker image hosted on it. + +>**Prerequisites:** You must have a [private registry](https://docs.docker.com/registry/deploying/) configured. + +>**Note:** Currently, credentials are pulled automatically only if the workload is created in the Rancher UI and not kubectl. + +1. From the **Global** view, select the project or project containing the namespace that you want to add a secret to. + +1. From the main menu, select **Resources > Registry**. Click **Add Registry**. + +1. Enter a **Name** for the registry. + + >**Note:** Kubernetes classifies secrets, certificates, ConfigMaps, and registries all as [secrets](https://kubernetes.io/docs/concepts/configuration/secret/), and no two secrets in a project or namespace can have duplicate names. Therefore, to prevent conflicts, your registry must have a unique name among all secrets within your workspace. + +1. Select a **Scope** for the registry. + +1. Select the website that hosts your private registry. Then enter credentials that authenticate with the registry. + +1. Click **Save**. + + +**Result:** Your secret is added to the project or namespace, depending on the scope you chose. You can view the secret in the Rancher UI from the **Resources > Registry** view. + +## What's Next? + +Now that you have a registry added to the project or namespace, you can add it to a workload that's deploying an image from your private registry. + +For more information on adding a registry to a workload, see [Deploying Workloads](../../workloads/deploy-workloads). diff --git a/content/rancher/v2.x/en/tasks/projects/use-registries/_index.md b/content/rancher/v2.x/en/tasks/projects/use-registries/_index.md deleted file mode 100644 index 33fdabd2656..00000000000 --- a/content/rancher/v2.x/en/tasks/projects/use-registries/_index.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: Using Registries -weight: -draft: true ---- -## Using Private Registries -Private registries allow us to have repositories to hold containers that need to be private. -Private registries can be added in the UI and images in the registry can be used -while creating workloads. Registry can be added by providing a name, specifying -the scope and credentials for the chosen repositry. The scope of the registry can -be the one which is available to all namespaces or which is available to a -single namespace. - -In the UI, -1. Click on 'Add registry' -2. Provide a name -3. Choose the scope of the registry -4. Choose the Address [DockerHub, Quay.io, Custom] -5. Provide credentials of the registry chosen -6. Click 'Save' - -Once a registry is added in rancher, the images in the registry can be chosen to -create a workload - -a. From the workloads section, click on deploy a workload -b. Provide an image which is in the registry and choose the namespace - Ex: quay.io/username/testubuntu -c. Click on 'Launch'. The workload should get deployed successfully - - -## Adding a Secret - -Secrets are used to hold sensitive information such as passwords. -Secret can be created in rancher by providing a name along with a keyvalue pair. - -The scope of the secret can be the one which is available to all namespaces or -which is available to a single namespace. -A secret which is created as available to all namespaces can be used to create -a workload in any namespace -A secret which is created as available to a single namespace can be used to -create to a workload in that single namespace - - -In the UI, -1. Click on 'Add secret' -2. Provide a name -3. Choose the scope of the secret -4. Fill in the key value pair -5. Click 'Save' - -Once a secret is created, it can be used in a workload. -A secret can be used in a workload in two ways: - -1. A workload can be created by using secret as a volume - -a. From the workloads section, click on 'Deploy' -b. Provide a docker image and choose the namespace -c. Click on volumes -d. Provide a volume name and default mode -e. Choose a secret which has been added -f. Add a mount point (Eg: /test) and subpath if required -g. Launch the workload - - -Once the workload is deployed, right click on the workload and execute the shell. -In the mount point provided while creating the workload, the secret keys can be -seen as files. The contents of the file will be the value of the secret - -2. A workload can be created by using secret as an env variable - -a. From the workloads section, click on 'Deploy' -b. Provide a docker image and choose the namespace -c. Click on 'Environment variables' and 'add from source' -d. Choose the type secret, source and keys. All keys or specific keys can be chosen -e. Prefix or alias can also be provided -g. Launch the workload From dc90ce1f9093cedef19c358a6cefb992e3576dbf Mon Sep 17 00:00:00 2001 From: "Jason L. van Brackel" Date: Tue, 3 Jul 2018 13:50:39 -0400 Subject: [PATCH 3/5] Removing extra markup Github is having issues with this file. Making a small edit just to ensure there's not an actual problem From a2758944a506e28e2a4db2c7ace19e7680b543d7 Mon Sep 17 00:00:00 2001 From: "Jason L. van Brackel" Date: Tue, 3 Jul 2018 13:55:08 -0400 Subject: [PATCH 4/5] Minor spelling and grammar updates --- .../rancher/v2.x/en/tasks/projects/add-a-secret/_index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/rancher/v2.x/en/tasks/projects/add-a-secret/_index.md b/content/rancher/v2.x/en/tasks/projects/add-a-secret/_index.md index 819cb8d77c3..3f09f4cc029 100644 --- a/content/rancher/v2.x/en/tasks/projects/add-a-secret/_index.md +++ b/content/rancher/v2.x/en/tasks/projects/add-a-secret/_index.md @@ -7,9 +7,9 @@ draft: true [Secrets](https://kubernetes.io/docs/concepts/configuration/secret/#overview-of-secrets) store sensitive data like passwords, tokens, or keys. They may contain one or more key value pairs. When creating a secret, you can make it available for any deployment within a project, or you can limit it to a single namespace. -1. From the **Global** view, select the project or project containing the namespace that you want to add a secret to. +1. From the **Global** view, select the project containing the namespace(s) where you want to add a secret. -1. From the main menu, select **Resources > Secret**. Click **Add Secret**. +1. From the main menu, select **Resources > Secrets**. Click **Add Secret**. 1. Enter a **Name** for the secret. @@ -32,4 +32,4 @@ When creating a secret, you can make it available for any deployment within a pr Now that you have a secret added to the project or namespace, you can add it to a workload that you deploy. -For more information on adding secret to a workload, see [Deploying Workloads](../../workloads/deploy-workloads). \ No newline at end of file +For more information on adding secret to a workload, see [Deploying Workloads](../../workloads/deploy-workloads). From 869012cbf38f900be569dc8d24f9d0ce6e3c395b Mon Sep 17 00:00:00 2001 From: "Jason L. van Brackel" Date: Tue, 3 Jul 2018 14:30:57 -0400 Subject: [PATCH 5/5] Minor spelling and grammar changes --- .../v2.x/en/tasks/projects/add-registries/_index.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/content/rancher/v2.x/en/tasks/projects/add-registries/_index.md b/content/rancher/v2.x/en/tasks/projects/add-registries/_index.md index be7da2656b0..35506db9e92 100644 --- a/content/rancher/v2.x/en/tasks/projects/add-registries/_index.md +++ b/content/rancher/v2.x/en/tasks/projects/add-registries/_index.md @@ -10,9 +10,9 @@ Registries are secrets containing credentials used to authenticate with [private >**Note:** Currently, credentials are pulled automatically only if the workload is created in the Rancher UI and not kubectl. -1. From the **Global** view, select the project or project containing the namespace that you want to add a secret to. +1. From the **Global** view, select the project containing the namespace(s) where you want to add a registry. -1. From the main menu, select **Resources > Registry**. Click **Add Registry**. +1. From the main menu, select **Resources > Registries**. Click **Add Registry**. 1. Enter a **Name** for the registry. @@ -24,8 +24,7 @@ Registries are secrets containing credentials used to authenticate with [private 1. Click **Save**. - -**Result:** Your secret is added to the project or namespace, depending on the scope you chose. You can view the secret in the Rancher UI from the **Resources > Registry** view. +**Result:** Your secret is added to the project or namespace, depending on the scope you chose. You can view the secret in the Rancher UI from the **Resources > Registries** view. ## What's Next?