So, here you are, on a team that uses Ambassador Cloud for your Kubernetes workflow.
Everyone knows it can be rough adopting new software into your workflow. Maybe you still long for the simple days of the PHP monolith when you built everything locally, before you had to deal with Kubernetes environments with a hundred microservices across your clusters. Or maybe your resume is more of a “aspirational” document. Nobody’s making judgements.
Either way, we all know the days of running all your services at once on a monolith application are rightfully over. It wasn’t the best solution. Does that mean it’s going to be a headache if you want to make a simple change, though? Nah, we’re here with a Cloud-based painkiller designed to relieve the headaches of Kubernetes development and simplify your workflow.
With Telepresence, you can create an “intercept” of service to code easier. The coding changes you make on the intercepted service can be viewed as if you were running the cluster on your laptop. It’s simple. No long waits or build time = more time to code.
This guide walks you through a quick hypothetical example to show how to create an intercept, make a basic change, and then use the automatically generated preview link to send to your teammates to impress them with how quickly you’re getting the hang of things.
Let’s say you’re doing some front end development. You already have Git access, and Ambassador Cloud has been set up so that all the services for your clusters are displayed. Your team has been working on a new feature, and you need to add a new button style to the CSS to show them how it’ll look on the app.
All you need to do is add the button to the CSS, make sure it looks classy, and then show off what it looks like live. With an intercept, you can test your work and share a preview link so that others can see the results in a matter of minutes.
Ambassador Cloud Connection
To begin, let’s open Ambassador Cloud and take in the view.
All your services are listed.
At the top of the page you’ll see the not connected icon. Click the icon to open the dropdown and click connect to open the “Connect computer” slideout.
In the slideout, you’ll see a two or three steps listed, depending on your operating system. Follow the steps and enter the listed commands in your command prompt to download and login to it Telepresence.
You’re now connected and ready to make some changes.
Create an intercept
The moment we’ve all been waiting for: intercept time.
To begin, let’s return to that Connected icon in Ambassador Cloud. Click the Connected icon, hover over the connected cluster you’re working on, and the Intercept button will show up. Click the Intercept button to open the “Intercept Requests to a service” slideout.
The available services on the cluster are all listed here. Select the service you want to make changes on and you’ll see two questions:
- How do requests enter the cluster? Open the dropdown and select the way requests enter the cluster.
- What port handles requests to the service? - Enter the port number for local requests.
Once you’ve taken care of those questions, click the Intercept button.
The intercept is created. Nice one! Are you sure this is your first time?
The slideout now displays the preview URL and the HTTP header details. Don’t worry about the HTTP header stuff for now. The preview URL is what we’re here for.
If you go back to the Services page in Ambassador Cloud, you can see the service you intercepted listed on the page with a green intercept icon next to it. Now we can make those CSS changes and see how they look before we send it off to the team.
Make a change
Now it’s just like the good ol’ days, only easier. You can make your changes as you normally would, then send the preview off to your team so they can look at the changes as if they had the same environment build on their computers.
So, open your editor of choice and make those CSS changes on your local repo. Add a new button, maybe put a little border on the radius, adjust the padding, maybe add a focus pseudo-class to jazz it up a bit. Do what feels good, then save your changes.
Now it’s time to go to the preview URL for the intercept. Head back to the Ambassador Cloud Services page and click on the intercept . In the intercept’s service details page, click Activities and the preview URL will be shown on the page. Click on it to open the service and see your work.
Since that new button you created is looking sweet, then why not reap your due praise? Slack the preview URL to some people on your team and then they can see the changes running on your laptop as well.
See? Way easier than the days of the PHP monolith. Welcome to the new “good ol’ days.”