

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 5
click for more info
Not enough gems
Cost: 6 gems
1: Config Maps
incomplete
2: Applying the Config Map
incomplete
3: Config Maps Are Insecure
incomplete
4: Crawler
incomplete
This lesson's interactive features are locked, please to keep using them
Now that we have a config map, we need to connect it to our deployment.
Open up your api-deployment.yaml file. We're going to add a few things to it. Under the containers section, add the following to the first (and only) entry:
env:
- name: API_PORT
valueFrom:
configMapKeyRef:
name: synergychat-api-configmap
key: API_PORT
This tells Kubernetes to set the API_PORT environment variable to the value of the API_PORT key in the synergychat-api-configmap config map. Reference the official docs if you're confused about the structure of the yaml.
Next, apply the deployment. Hopefully, you remember the command for this by now.
Once it's applied, you should be able to take a look at the pods and see that a new API pod has been deployed and isn't crashing!
Let's forward the API pod's 8080 port to our local machine so we can test it out.
kubectl port-forward <pod-name> 8080:8080
Make sure it returns a 404 response when you hit the root:
curl http://localhost:8080
Run and submit the CLI tests.