Skip to content

Instantly share code, notes, and snippets.

@antweiss
Created February 2, 2022 09:29
Show Gist options
  • Save antweiss/51afd3da19d3fde4f629e41722408d6a to your computer and use it in GitHub Desktop.
Save antweiss/51afd3da19d3fde4f629e41722408d6a to your computer and use it in GitHub Desktop.
Exercise:
1. Please create a configmap with the following values:
```
NAME=<your name>
LASTNAME=<yourlastname>
COMPANY=Soluto
```
2. Run a deployment based on otomato/httpenv so that the configmap values are injected into the container environment.
If you already have a deployment:
`kubectl get deployment httpenv -oyaml > mydeployment.yaml`
if no deployment yet - create a yaml with dry run:
`kubectl create deployment httpenv --image=otomato/httpenv --dry-run=client -oyaml > mydeployment.yaml`
Edit mydeployment.yaml
kubectl apply -f mydeployment.yaml
3. Expose the deployment as a NodePort service on port 30001 of your host and send me the URL to access your httpenv service.
Generate the service yaml with: `kubectl expose deployment httpenv --port=8888 --type=NodePort --dry-run=client -oyaml`
And add NodePort

Exercise:

  1. Please create a configmap with the following values:
NAME=<your name>
LASTNAME=<yourlastname>
COMPANY=Soluto
  1. Run a deployment based on otomato/httpenv so that the configmap values are injected into the container environment.

If you already have a deployment: kubectl get deployment httpenv -oyaml > mydeployment.yaml

if no deployment yet - create a yaml with dry run:

kubectl create deployment httpenv --image=otomato/httpenv --dry-run=client -oyaml > mydeployment.yaml Edit mydeployment.yaml kubectl apply -f mydeployment.yaml

  1. Expose the deployment as a NodePort service on port 30001 of your host and send me the URL to access your httpenv service.

Generate the service yaml with: kubectl expose deployment httpenv --port=8888 --type=NodePort --dry-run=client -oyaml

And add NodePort

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment