IBM Support

Using Kubernetes provider in Cloud Automation Manager in order to create a namespace in a managed OCP cluster

How To


Summary

How to use a Kubernetes provider in order to create a namespaces in a remote OCP cluster?

Objective

Create a remote namespace

Environment

OCP 4.x , CAM 1.x

Steps

Generally the steps in the terraform documentation can be followed for this specific task:


Some customer have hit an issue when they deploy the template, namely:

Error applying plan:1 error(s) occurred: * kubernetes_namespace.example: 1 error(s) occurred: * kubernetes_namespace.example: Posthostname:8443/api/v1/namespaces: x509: certificate signed by unknown authority

The cause is the statical credentials in the TF files.

The following should be used:  client_certificate = file("~/.kube/client-cert.pem") client_key = file("~/.kube/client-key.pem") cluster_ca_certificate = file("~/.kube/cluster-ca-cert.pem")

client_certificate, client_key and cluster_ca_certificate .

Where the variables are used to point to the pem files containing the needed details.

There are two options in regards to where to put these variables:

  • 1. if you want to go on your path and provide the credentials in the terraform template, then you can copy the client certificate and the required files to the provider terraform PV. You can access them in terraform template in /home/terraform/<your folder>
  • 2. You can define a new provider in CAM so you can create cloud connections later on. These steps can be done using CAM APIs.

Further info on point 1:
You would need to follow these steps to copy the client_certificate, client_key and cluster_ca_certificate to the provider terraform persisted volume.

Document Location

Worldwide


[{"Line of Business":{"code":"LOB45","label":"Automation"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SS2L37","label":"IBM Cloud Automation Manager"},"ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Version(s)"}]

Product Synonym

CAM, MCM, OCP, KUBE

Document Information

More support for:
IBM Cloud Automation Manager

Software version:
All Version(s)

Document number:
6360751

Modified date:
05 November 2020

UID

ibm16360751

Manage My Notification Subscriptions