How can I create IBM Cloud Private namespaces, together with PSPs using the commandline? - ibm-cloud-private

I want to create namespaces in IBM Cloud Private 3.1.1 using the cli. These namespaces need to be associated with pod security policies.
I don't see this as a documented capability in the cloudctl commandline.

You can refer below ICP documentation to add the PSP to a namespace by CLI.
https://www.ibm.com/support/knowledgecenter/SSBS6K_3.1.1/user_management/psp_addbind_ns.html
The command likes below:
kubectl -n appsales create rolebinding ibm-anyuid-clusterrole-rolebinding --clusterrole=ibm-anyuid-clusterrole --group=system:serviceaccounts:appsales
Or you can refer below ICP documentation for more details.
https://www.ibm.com/support/knowledgecenter/SSBS6K_3.1.1/app_center/nd_helm.html
Happy new year.

You can refer to namespace creating in management console. Once you create a new namespace with ibm-privileged-psp, the rolebinding=ibm-privileged-clusterrole-rolebinding will be created in the new namespace. Also you create another new namespace and rolebinding refer to this define with kubectl, the new namespace with your PSP will be enabled in kubectl.

Related

Cloudwatch custom metrics namespace in Grafana

My application is pushing custom metrics to CloudWatch. Furthermore, these metrics are plotted using Grafana.
For this to work I need to configure Grafana to look for my custom metrics namespaces by adding them under Datasources -> CloudWatch. Like this:
The only problem is that I'm having another custom metric namespace called "MyApp (prod,en)". Since there is a comma in the namespace itself, it messes up the list above (which is comma separated).
I have not chosen the namespace name myself. Is was automatically generated. It's a Spring boot app called MyApp using 2 spring profiles: 'prod' and 'en'
My questions is how do I get the metrics from the namespace "MyApp (prod,en)" into Grafana?
I changed the namespace name to "MyApp (prod en)" when initializing the CloudWatchConfig. This fixed my problem.

Deploy and Upgrade pods in Namespace

I am working in a Java Springboot microservice-based complex application that comprises 30 services.
All are containerized and from ECR, services are deployed inside the Kubernetes namespace in AWS.
Every time, the namespace is purged and all services are re-deployed.
How can I update only one service inside a namespaceā€¦is it possible to do that kind of deployment.
Can someone please Any sample configurations using helm or any useful links
How can I update only one service inside a namespaceā€¦is it possible to do that kind of deployment.
If you are executing helm upgrade it should only update the resources which are updated.
you need to understand how does Helm packs the resources, helm is using Kustomization so if you are updating Secrets, ConfigMap etc it will generate new names for those resources.
As a side effect, it will "change" the Deployment and the results will be a "full" deploy of all the resources

ConfigurationHostSettings is internal

I want to bind host options from appsettings.json file using IConfiguration.GetSection(...).Get<ConfigurationHostSettings>().
IRabbitMqBusFactoryConfigurator.Host has overload for that, but ConfigurationHostSettings is internal
Use fluent interfacecs when configuring MassTransit from configuration file is a pain =/
If you want to use ASP.NET Core configuration, you should create your own class that has the settings you want to configure via appsettings.json and use that to configure the host in MassTransit.
If your configuration class implements the correct interface, you should be able to pass it directly so that MassTransit can get the appropriate host settings.

How to create a new deployment and service in kubernetes using Gradle pugin (or task)

I see there are many Github pages for gradle kubernetes plugin like
https://github.com/bmuschko/gradle-kubernetes-plugin
https://github.com/kolleroot/gradle-kubernetes-plugin
https://github.com/qaware/gradle-cloud-deployer
None of these having any concrete example how to connect to kubernetes from gradle and create a new deployment and service I tried all about git link in gradle but no luck...
Since I also faced a lack of plugins that deal with Kubernetes I started working on a Gradle plugin to make deploying resources to a Kubernetes cluster easier: https://github.com/kuberig-io/kuberig.
In the user manual you will find details about how to connect to a kubernetes cluster here:
https://kuberig-io.github.io/kuberig/#/initializing-an-environment
It also includes an example of how to define a deployment here: https://kuberig-io.github.io/kuberig/#/defining-a-deployment
And a service here:
https://kuberig-io.github.io/kuberig/#/defining-a-service
It may also be useful to go through the quickstart first https://kuberig-io.github.io/kuberig/#/quick-start.
Hope it can be of use to you.

S/4HANA Cloud SDK :com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces does not exist

The build is fails due to lack of resource: class com.sap.cloud.sdk.s4hana.datamodel.odata.services.BusinessPartnerService
Do we need to have/create this model classes in our project structure or will SDK take care of this static import?
Error after executing: mvn clean install
There are likely several things happening in parallel here:
Version 1.3.0 of the SAP S/4HANA Cloud SDK moved the entity classes of a service such as BusinessPartner to their own package, in your case, you now need to import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.businesspartner.BusinessPartner;.
Furthermore, BusinessPartnerService is now an interface with a default implementation available with DefaultBusinessPartnerService. You need to replace the static access with new DefaultBusinessPartnerService() (or you could use dependency injection). See the release-notes that Akhil already referenced.
There is no email field on the entity BusinessPartner. You need to use the entity AddressEmailAddress and associate it to the business partner via a BusinessPartnerAddress.
Please use the latest SDK release in your project. Info here:
https://sap.github.io/cloud-s4-sdk-examples/release-notes/
This should resolve the error.
Best regards,
Akhil

Resources