Skip to content

Commit

Permalink
Merge pull request #29 from GlueOps/feat/updates
Browse files Browse the repository at this point in the history
feat/updates
  • Loading branch information
venkatamutyala authored Sep 19, 2023
2 parents 6ccc315 + 5d726e6 commit d65b3d3
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 6 deletions.
126 changes: 126 additions & 0 deletions docs/deploy-applications/hello-world-adding-configurations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
---
id: adding-configurations-and-secrets-to-the-hello-world-app-glueops-platform
title: Adding Application Configurations
type: tutorial
---

# Adding Application Configurations/Secrets
:::caution
Before diving in, it's essential to have a [Hello World App Deployment](../deploy-applications/deploy-hello-world-to-glueops) running. Once that's in place, we can explore how to tweak its greeting using configurations and secrets.
:::

In this guide, you'll learn how to add configurations and secrets to your applications using the GlueOps platform. As an example, we'll update the default greeting of your existing 'Hello World' app to showcase this functionality.

## Let's create the new greeting message

:::info prerequisites

Before you get started we will begin referencing links located on your cluster information home page:
`https://cluster-info.<MY_CAPTAIN_DOMAIN>`

_Using the URL above, replace `<MY_CAPTAIN_DOMAIN>` with the correct value provided by your Platform Administrator_
:::

Once you are on the cluster info home page, click on the `Resource/Link` for `Secrets Management`. You will then be taking our our secrets management system (Vault). For the role enter "editor" as you will need read/write access and then click on `Sign in with OIDC Provider`

![Alt text](./images/login.png)

To create our first configuration/secret, Click on "Create secret +`

![Alt text](./images/create-secret.png)

Finally, let's enter in the details for the new greeting message. For the field `Path for this secret` you will want to use `app-projectname` in our case our demo projectname as used in other tutorials is `antoniostacos`.
For the `key` enter `GREETING_MESSAGE` (this is indeed case sensitive) and for the value (left of the `key`) enter: `¡Hola Mundo!`.

![Alt text](./images/create-secret-greeting-message.png)

Once complete, click Save!

You can expect the confirmation page to look like this:

![Alt text](./images/saved-secret.png)

## Let's wrap up and get this new greeting deployed!

:::info
You will need to go back to your `values.yaml` within your deployment configurations repository. In this case case it's the same repo/file you used when you initially deployed the "Hello World!" application.

```
deployment-configurations
├── apps
│ └── app-antoniostacos
│ └── envs
│ └── qa
│ └── values.yaml <
```
:::


We are going to add the following YAML to the very bottom of the existing file:

```yaml
externalSecret:
enabled: true
secrets:
<MY_APP_PROJECTNAME>:
dataFrom:
key: secret/<MY_APP_PROJECTNAME>
```
:::caution Replacements:
`<MY_APP_PROJECTNAME>` with the name you used when adding the secret/configuration. In our case it's `app-antoniostacos`


```yaml
externalSecret:
enabled: true
secrets:
app-antoniostacos:
dataFrom:
key: secret/app-antoniostacos
```
:::

And that's it! Save the file, commit the changes and push them back up! Within a few moments you should see the greeting changed on the QA deployment of your "Hello World" website.

:::info Reference

In case you aren't sure where to place the `YAML` in this guide, it would look like this when appended to the previously provided `YAML`:


```yaml
image:
repository: '<MY_ORG>/<MY_REPO>'
registry: ghcr.io
pullPolicy: Always
port: 8080
tag: main
service:
enabled: true
deployment:
replicas: 1
enabled: true
imagePullPolicy: Always
imagePullSecrets: <CONTAINER_REGISTRY_CREDENTIALS>
resources:
requests:
cpu: 100m
memory: 128Mi
ingress:
enabled: true
ingressClassName: public
entries:
- name: public
hosts:
- hostname: '<MY_APP_NAME>-qa.apps.<MY_CAPTAIN_DOMAIN>'
externalSecret:
enabled: true
secrets:
<MY_APP_PROJECTNAME>:
dataFrom:
key: secret/<MY_APP_PROJECTNAME>
```
:::
9 changes: 5 additions & 4 deletions docs/deploy-applications/hello-world.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: deploy-hello-world-to-glueops
title: Deploy a "Hello World" Application
title: Deploy "Hello World"
type: tutorial
---

Expand Down Expand Up @@ -330,7 +330,7 @@ deployment:
replicas: 1
enabled: true
imagePullPolicy: Always
imagePullSecrets: regcred
imagePullSecrets: <CONTAINER_REGISTRY_CREDENTIALS>
resources:
requests:
cpu: 100m
Expand All @@ -349,8 +349,9 @@ ingress:
Ensure you replace the placeholders appropriately:
- `<MY_ORG>` and `<MY_REPO>` with your GitHub organization and application repository names.
- Replace `<MY_APP_NAME>` with your chosen app name.
- Replace `<MY_CAPTAIN_DOMAIN>` with your assigned captain domain, provided by the Platform Administrators.
- `<MY_APP_NAME>` with your chosen app name.
- `<MY_CAPTAIN_DOMAIN>` with your assigned captain domain, provided by the Platform Administrators.
- `<CONTAINER_REGISTRY_CREDENTIALS>` if your image is in a private registry you will need to specify a value provided by the Platform Administrators. Otherwise use `nil`.
:::

Once you've done the above, commit your changes to the deployment configurations repository and push the changes. In a short while, you should be able to access your app at the URL: `https://<MY_APP_NAME>-qa.apps.<MY_CAPTAIN_DOMAIN>`
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/deploy-applications/images/create-secret.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/deploy-applications/images/login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/deploy-applications/images/saved-secret.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ const sidebars = {
collapsible: true,
items: [
"deploy-applications/deploy-hello-world-to-glueops",
"deploy-applications/deploy-docusarus-website-to-glueops",
"deploy-applications/deploy-python-app-to-glueops"
"deploy-applications/adding-configurations-and-secrets-to-the-hello-world-app-glueops-platform"
],
link: {
type: "generated-index",
Expand Down

0 comments on commit d65b3d3

Please sign in to comment.