Welcome to this series of hands on video tutorials
from the SAP HANA Academy I'm Philip Mugglestone in this series,
we're covering the SAP Business Technology Platform
in this video tutorial we're going to cover how
to configure a custom domain in the SAP BTP, Kyma runtime
runtime we'll also see how you can build and deploy
an application that then uses that configured custom domain.
So instead of using SAP BTP, Kyma runtime .ondemand.com
which is kind of the default
you wanted to use your actual domain of your organization for example, we might use
dot info
Now I'm going to assume that you're already up to
speed with working with the SAP BTP, Kyma runtime environment and runtime,
there's a video in the onboarding series that
basically covers how to get started with that,
so basically not going to cover that again here,
but what we can see if we go to our global account,
we can see we've got the SAP BTP, Kyma runtime environment enabled,
we've got our kubeconfig URL so we can access it.
We've also got the dashboard here so we can
see here the default address will be something like this
in terms of when your applications are running. So we're gonna change that.
So it uses our own custom domain
So obviously you need to design what your domain or
sub domain you're going to use is for example,
we might use apps.partnerengineering.info it works very well,
particularly Use wild cards,
then you have a lot less work to do in terms
of setting up actually the domains on the domain name service level
and of course you're gonna need a provider you're going to actually purchase
that domain and you're gonna need a provider where you manage your DNS
now, in this example, I'm going to be using Amazon Web services and route 53.
So you can see we've got a hosted zone
and we can see we've got partnerengineering.info
Now.
Part of the process of configuring the custom domain
from the SAP BTP, Kyma runtime will actually need to be
able to log into amazon web services so that
we can perform some configuration automatically for you.
You'll need to have, for example, access keys set up.
So if we just go to a terminal window firstly we can just check
we've got access to AWS route 53 we can list the hosted zones,
we can see we've got access so it looks like the credential we're using makes sense.
Also we can check our name spaces with a kubectl get ns
Forget name space notices the one called istio-system there
were going to be using that one shortly.
So the first thing we might want to do is create a name space for our projects.
So we could do that with the kubectl command or we could
do that actually using the dashboard so we can go to name spaces
we'll create a name space
we give it a name, for example, we'll call it DEV but call it whatever you want.
And again,
if we go back and look at our name spaces we can see that now is in
the list but we don't see the istio-system one that we're going to be using later.
So the way around that in the dashboard here is to click on your user icon,
go to your preferences,
choose clusters and then say show hidden name spaces
and now you should finally get a
number of additional ones including the istio-system
Of course you can turn that back off at some point if you prefer.
So the tests were going to perform basically
we're going to need to set up some secrets
without Amazon Web Services credentials or it would be whichever
provider for your domain name services you're using.
Well then create a DNS provider and a DNS entry
actually within the SAP BTP, Kyma runtime will create an issuer,
will set up a certificate and a gateway.
Then we'll be ready to build and deploy our application.
So the first thing we can do is go into our
dev name space that we've created
and we can create
a secret without AWS credentials. So we'll go to secrets.
I'm going to create a secret,
we can give it a name such as aws-creds
and we'll need to provide the keys basically to
access it typically is the AWS access key ID
then the secret access key
and in some cases depending on your policies you may need also to use a session token.
So I'm going to paste in those values
and then I can hit create
the next thing to do is to create a DNS provider
so if we scroll down the configuration, you've got something called DNS providers.
So let's select that. I'm going to create one
now call it whatever you want,
we need to give the name space a name of
the secret you're going to use to connect this DNS provider
and in case it's Amazon Web Services and we just put those credentials in
so we'll connect to that secret.
Now in terms of the domains that we want to be allowed for that,
we would just pop over here and we would pick up our hosted zone
and paste that in.
Now of course we're also going to need to say who are provider type is
So in that case you can choose from a number of different DNS providers.
In our case it's going to be Amazon Web Services route 53
then we can create
and after a few seconds you should find the status changes to ready,
which means that the connection has been made.
Now we're ready to create a DNS entry. So we'll choose DNS entries
so we'll create our DNS entry.
Of course we can give it a name,
then we'll select the DNS name that we want to create and for that,
I'm going to create a wild card
so I'm going to basically take *.apps.partnerengineering.info
so that will work for all of the individual host names of
our applications that we deploy and then for the a record target,
simply go to the pull down list and you can
pick up the istio ingress Gateway that's already been defined
and then we can hit create
now what that's actually going to do in the
background is configure some stuff for you within route 53
so you can see the status is now ready. If we go to route 53
refresh,
you'll see that it's now being created for us.
Now the next thing we're going to need to do is to create a certificate
and to do that we're going to need to register an issue
so we go to the issue as option
and we can create an issuer
and we're going to be using let's encrypt,
it's one of the many issues that you can work with.
So it's a type of ACME
and we're going to need to give the survey
URL for when you're working with let's encrypt.
So for that it's this URL if you want to know more about that.
It depends on your issuer but you can just go to the let's encrypt
dot org and you'll get the details of how to find the issuer.
URL to use then you'll need to put in an email address
and you also need to include which domains. So for that
I'm going to add a couple the core
partnerengineering.info and then also my wild card which is
*.apps.partnerengineering.info So we go ahead and create that issue.
Now once we've done that we can actually do our certificate signing process.
So for that we're going to create a certificate however,
we don't do that in our regular development name space.
We need to do this in the istio system name space.
So let's go and select that. And then if we have a look at the
certificate option,
you can see down here in config we're going to create a certificate
and we can give it a name, choose what you want.
I'm going to use the advanced option here so that we get the right options presented.
The first thing we need to put in is
a common name so we can put in partnerengineering.info
and then for the DNS names we want we can put in our wildcard
sub domain. So that one will be the *.apps.partnerengineering.info
then we'll need to provide information of who the issue is going to be
so that we can select
the dev name space where we created our issuer for let's encrypt.
What we'll also need to do is provide a name for our secret
that's going to be created so we can give it this name
up to you what name you choose.
So now we should be good to go let's hit create
And then basically watch the status as it changes depending
and in fact if you have a look at route 53 and you refresh,
you'll see that it's doing some ACME challenges.
So it's basically doing the process of the signing of the certificate for you
and now we can see the status is ready so that process is complete.
The final step is to create an istio gateway and we'll be
doing that within the name space where we're going to deploy applications
to choose the dev name space
and go to istio Gateways. So I'm going to create a gateway,
we can give it a name, it's going to be an istio ingress gateway.
And then in terms of the protocol we're going to use,
we'll go with https port 443,
we can give that a name
in the TLS mode,
we're going to need to select the credentials that we just created a moment ago
and we can leave the motors simple and then for the hosts, what we need to do is put in
the wild cards sub domain that we're going to be using. So
*.apps.partnerengineering.info
and then we can hit, create
all that now remains is for us to build out
an application that will actually go ahead and use it.
So for that we can go to visual studio code, we can use the application wizard
again, we saw that in the onboarding
so go to the command palette
and choose open template wizard.
We've got the SAP HANA Academy MTA generator
so I'm going to hit start,
so I'm going to create an app, let's call it maybe my app one,
we're going to be deploying it to the SAP BTP, Kyma runtime
and then the name space, we're going to deploy it to what we called it.
dev we need to put in our docker ID now we have a
choice in terms of which way we want to build our containers.
You could use docker directly,
you could use an alternative such as pod man or in this case we're going to use cloud
native build packs which are based around Paketo then
you can set up what functionality you want.
We'll just stick with the default here
but what we are going to do is specify a wildcard custom
domain that we're going to be using because that's the whole point.
We've got a custom domain.
So I'm going to put in
custom domain is apps.partnerengineering.info It will then ask you for
the gateway of that custom domain in your SAP BTP, Kyma runtime.
So basically we need to go and get our gateway name that we've created.
That's basically this value here,
name space will be dev
and then svc dot cluster dot local,
we can then stick with the rest of the
defaults hit next and it will scaffold out our project
so we can see we've got my app one so we can have a look at a couple of items,
particularly in the helm area,
we'll see that we've got
our overall values and you can see that for the Gateway, it's using the value,
we just specified
and for the cluster domain, it's using our wild card. Custom domain for the apps
will be saying for the router, the front end part of the application
as well using the custom domain
and the gateway.
And also if we look at our back end service, we're going to be having
UAA authentication service and we look at the configuration for that.
If we look at the redirect URI
notice again it's using our cluster domain when it does it's
callback and which effectively is going to go back to our
custom domain
so it's all looking good so we can go ahead and build and deploy this application now.
We've got to make file here which has got some
commands that will do a number of steps for you.
So for example we can do make and then Docker push
we'll just need to change into the project folder
and we can do make.
Docker push actually build and push the two microservices.
Once the containers have been built and pushed to Docker hub
we can then deploy them effectively run a helm upgrade with install
so you can do that again using the make command
so once it's deployed we can go and authorize business users to actually
use the application so I can do that within the SAP BTP cockpit.
If I go to
security and users pick my user so I can click on role collections
and assign any role collections that were created as the app was deployed
to my business user
then I should be able to go to our cluster and
we can actually have a look at the Discovery Network API rules
and you can see that we've got our two apps
and notice that they're using our custom domain here.
If you want to launch the app we can just click on it, see it's using our custom domain.
Once we are authenticated,
then again we can go ahead and use it.
There's not much functionality in there,
but we can see the point that we've deployed
an application and it's using our custom domain,
in fact our wildcard sub domain.
So basically we've got these
different hosts then using our apps.partnerengineering.info
rather than the default domain name.
That would be used by the SAP BTP, Kyma runtime.
So in this video tutorial we've seen how we can configure a custom domain.
In SAP BTP, Kyma runtime.
We've also seen how we can build and deploy
an application that then uses that configured custom domain.
You can find more video tutorials on our Youtube channel
if you'd like to be informed as soon as
new video tutorials are published then please subscribe.
Thanks for watching