Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use USER env and create svc with yaml instead of expose + other changes #526

Merged
merged 27 commits into from
Aug 7, 2023

Conversation

splattner
Copy link
Member

No description provided.

@github-actions
Copy link

github-actions bot commented Mar 3, 2023

with curl instead of browser & change local deploy yaml to match for replicas
@splattner splattner changed the title use USER env and create svc with yaml instead of expose use USER env and create svc with yaml instead of expose + other changes Mar 3, 2023
@@ -25,28 +25,23 @@ In a sidecar pattern, the functionality of the main container is extended or enh
In {{<link "persistent-storage">}} you created a MariaDB deployment. In this task you are going to add the [Prometheus MySQL exporter](https://github.com/prometheus/mysqld_exporter) to it.

{{% onlyWhenNot openshift %}}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall I change this also for OpenShift?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, in the overview it didn't show the following changes. We can also change this in OpenShift, that's ok, thanks.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this is also changed in the oc variants

@splattner splattner force-pushed the no-more-imperative-and-more branch from 6cf9b35 to 59c5290 Compare March 3, 2023 11:47
@splattner splattner force-pushed the no-more-imperative-and-more branch from 4466b0c to 6cac131 Compare March 3, 2023 11:56
@bliemli
Copy link
Member

bliemli commented Mar 23, 2023

Why use $USER if you mean the namespace? The username doesn't necessarily have to be the namespace.

Or even better, use placeholders that can be set via URL parameters instead of letting the user set env vars. The reason for this is, depending on the training, we have different naming conventions, especially if we are on customer-provided infrastructure.

Copy link
Member

@bliemli bliemli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't yet review all of it and will certainly have to test all the changes in more detail, but these are my first suggestions.


```bash
{{% param cliToolName %}} expose deployment example-web-go --type=ClusterIP --name=example-web-go --port=5000 --target-port=5000 --namespace <namespace>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion it's important to know these helper commands as they facilitate editing resources and belong to a basics training. At a later time the resources are then saved as files in order to adopt a gitops approach.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remember correctly we once discussed, that we wan't to get rid of these imperative commands. Not sure if you were involved in this discussion though. In my opinion the --dry-run=client -o yaml approach is the nicer one to create resources for the gitops approach. But I guess for expose there is not relly an equivalent.
Maybee also something to quickly discuss/align in a S1 Stream meeting.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also use oc create route. However, this only works for secured routes, so we'd need to make sure all OpenShift training variants are run on a cluster that offers a proper wildcard certificate or cert-manager that handles these. Up until now this is the case.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the expose command again as a second option.

content/en/docs/exposing-a-service/_index.md Outdated Show resolved Hide resolved
content/en/docs/scaling/_index.md Outdated Show resolved Hide resolved
content/en/docs/scaling/_index.md Outdated Show resolved Hide resolved
@splattner
Copy link
Member Author

splattner commented Apr 20, 2023

Why use $USER if you mean the namespace? The username doesn't necessarily have to be the namespace.

Or even better, use placeholders that can be set via URL parameters instead of letting the user set env vars. The reason for this is, depending on the training, we have different naming conventions, especially if we are on customer-provided infrastructure.

@schlapzz (acend/helm-basics-training#395) already used this in the helm training, so I reused it from there. Also $USER is set in the webshell and so the trainees can simply copy/paste it.
We should use the same scheme in all training. Let's align on this in a S1 Stream meeting or update day

@schlapzz
Copy link
Contributor

schlapzz commented Apr 22, 2023

As Seba already mentioned, we're make heavy use of this Env Var in our Trainings ($LAB_USER in AMM Techlab, later renamed in the Helm & ArgoCD Techlab from $STUDENT to $USER, see here and later here

The naming of the var is not that important for me. But regarding the new Training Cluster setup it would be nice if we use the same Var Name for all trainings 💙

@bliemli
Copy link
Member

bliemli commented May 25, 2023

As Seba already mentioned, we're make heavy use of this Env Var in our Trainings ($LAB_USER in AMM Techlab, later renamed in the Helm & ArgoCD Techlab from $STUDENT to $USER, see here and later here

The naming of the var is not that important for me. But regarding the new Training Cluster setup it would be nice if we use the same Var Name for all trainings blue_heart

Still, the best option imho would be to use a placeholder as described here. This doesn't require setting an environment variable on the terminal and is widely used in the Kubernetes Basics training.

@splattner
Copy link
Member Author

I replaced <namespace> with $USER using the placeholder feature and I also introduced a placeholder for appdomain.

@splattner splattner force-pushed the no-more-imperative-and-more branch from e07e571 to dc70d14 Compare July 3, 2023 13:12
@splattner splattner merged commit 380fe43 into main Aug 7, 2023
@splattner splattner deleted the no-more-imperative-and-more branch August 7, 2023 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants