I use gcloud beta version.
I want set a integration as kind of Custom Domains - Google Cloud Load Balancing with multi domain.
I have a problem with the syntax of the command.
In load balancer, SSL certificate can be built to support multiple domains.
So, How to create a integration with multi domain mapping?
sample command:
gcloud beta run integrations create --type=custom-domains --region=us-central1 --parameters='set-mapping=domain1.com:serviceName'
In this image, you can see that it is possible to define with several domains:
The GCP document links:
gcloud beta run integrations create
Map custom domains using a global external HTTP(S) load balancer
Please visit this question in google cloud community:
https://www.googlecloudcommunity.com/gc/Serverless/gcloud-cloud-run-set-a-custom-domains-Integration-with-multi/m-p/512687#M1061
I took a look at the question in the google cloud community and the GCP documents you linked and I think I know what the issue is.
In your first link under the synopsis. The parameters are a list of key value pairs.
[--parameters=[PARAMETER=VALUE,…]]
What you posted in the in the google cloud community
--parameters='set-mapping=domain1.com:serviceName,domain2.com:serviceName'
You never defined the parameter name for domain2. It should look like this.
--parameters='set-mapping=domain1.com:serviceName,set-mapping=domain2.com:serviceName'
Hope that helps you.
I looked more into this and it looks like the reason the command wasn't working was because : was being used a separator for the values and the whole key-value pair, which was confusing the command.
Example
--parameter'parameter1=value1:parameter2=value2'
Can also be used like this
--parameter'parameter1=value1:value2'
In order to get around this you need to use escape characters.
gcloud beta run integrations create --type=custom-domains --region=us-central1 --parameters='^~^set-mapping="(example.com/*:myservice1,example2.com/*:myservice2)"~'
More info on escape characters.
Hope this helps.
Related
I am using AWS Managed Prometheus service and setup a Prometheus server on my EKS cluster to collect and write metrics on my AMP workspace, using the helm chart, as per tutorial from AWS. All works fine, I am also connecting to a cluster run Grafana and I can see the metrics no problem.
However, my use case is to query metrics from my web application which runs on the cluster and to display the said metrics using my own diagram widgets. In other words, I don't want to use Grafana.
So I was thinking to use the AWS SDK (Java in my case, https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/amp/model/package-summary.html), which works fine (I can list my workspaces etc...), except it doesn't have any method for querying metrics!?
The documentation indeed mentions that this is not out of the box (!) and basically redirects to Grafana...
This seems fairly odd to me as the basic use case would be to run some queries no? Am I missing something here? do I need to create my own HTTP requests for this?
FYI, I ended up doing the query manually, creating an SdkHttpFullRequest and using an AWS4Signer to sign it. Works OK but I wonder why it couldn't be included in the SDK directly... The only gotcha was to make sure to specify the "aps" for the signing name in the Aws4SignerParams creation.
I need to deploy two cloud run servicen on GCP, one is frontend and the other is backend so I wanna ask
is it possible to connect 2 services like this ones?
if its possible what is the best way of connecting those two services which will be able to communicate?
I searched through the internet didn't find a lot of useful info
Please consider the official documentation :
Securing Cloud Run services tutorial
This tutorial walks through how to create a secure two-service
application running on Cloud Run. This application is a Markdown
editor which includes a public "frontend" service which anyone can use
to compose markdown text, and a private "backend" service which
renders Markdown text to HTML.
Yes you i'm not going to go into details. but i will give you a quick overview of the workflow.
Assuming you don't have the code in source control and this is an already built docker containers.
you want to load the docker image via gcloud by using
docker load to load the docker .tar image.
next you will tag that image.
push the image to container registry
navigate to cloud web-console click create service or you can run gcloud run image on the cli.
if you need a db its much better to use the cloud sql assuming its postgresql. you want to create one beforehand in the same region.
during deployment you can click connection tab and attach your db instance set the container port to your listening port.
don't for get to like if it helps!
I want to add a secret to access my Mongo Atlas databases via my Cloud Run Managed application.
I followed this guide: https://cloud.google.com/run/docs/configuring/using-secrets?hl=en
It described to first create the secrets - I did that
Then I have to add the secrets to my Cloud Run Service. However I can't find the option to do so. I only see the option to create "Environment Variables".
This is what I expect to find when following the documentation
But I can only see this
Do I miss to configure something to "activate" secrets beforehand for my Cloud Run Service?
Per the note on the top of that page:
Important: This feature is not available for Cloud Run (fully managed).
I want the hostname in my Managed CloudRun service to be MyServiceName.RevisionName.InstanceId or anything better than "localhost" which I am getting now.
Is this possible ?
Cloud Run is a serverless managed compute platform, meaning that it is precisely built to abstract away all the infrastructure management. The container instances on which Cloud Run services run are ephemeral, meaning that your Cloud Run services will not be mapped to a specific static instance ID. Setting the hostname as you describe on your question will not be possible.
Depending on the nature of the application you can follow one of two possible ways:
Follow one of the suggestions already given on the comments (generate and save an UUID as a variable to the running container's scope so it can serve as an identifier during the container's lifespan). Which I assume would be the best workaround given the simplicity of creating UUIDs. Here are some examples on how to generate UUIDs programatically using Python, JavaScript, and C# given by the Stackoverflow community.
Migrate the container application from Cloud Run services to a Compute Engine VM instance with a custom hostname.
The metadata server provides some attributes to uniquely identify your service instance and correlate it to logs and other information sources.
See cloud run specific attributes and the [metadata server docs](https://cloud.google.com/compute/docs/storing-retrieving-metadata]
I trying to create some firewall rules in google compute, everything goes well, but some time later, they are just disappears.
I tried to add rules on default network, and also custom created - in both cases result same.
Tried both: through web UI, and through gcloud tool
If you believe that someone or something is reverting your Firewall changes, you can take multiple approaches to verify that.
inspect Cloud Console Activity logs
same using CLI: gcloud beta logging read "resource.type=gce_firewall_rule"
check GCE Operations section in Cloud Console
check GCE API requests in Cloud Console Logging, using this advanced filter:
resource.type="gce_firewall_rule"
jsonPayload.event_subtype:"compute.firewalls"