How to use CDK/minishift OpenShift cluster with kubectl - openshift

I have installed CDK on my Windows 10 laptop.
I am following documentation on using IBM Blockchain Platform with RedHat OpenShift.
One of the first steps is issuing kubectl commands.
I see CDK comes with the OpenShift CLI (oc) installed but not with kubectl. Do I need to install kubectl separatelly ? If so, how do I configure kubectl to know about my OpenShift cluster running in CDK/minishift?

To answer your specific question, any time you see a "kubectl" command you can replace it with "oc".
You can also download kubectl directly from upstream, and it will use the same (by default, or use $KUBECONFIG to override) ~/.kube/config file.
However, you should know that CDK is based on OpenShift 3.11.z and is approaching end-of-life. I would suggest you take a look at CRC, which is based on 4.x. Start here for more information -- https://console.redhat.com/openshift/create/local

Related

Install AppDynamics in OpenShift 4.X

I am looking for a way to install AppDynamics in a OpenShift Cluster.
Unable to find proper documentation on how to install and what tools need to be installed.
Should My Application Docker file also include any images related to AppDynamics
If anyone familiar with this please share some steps or provide reference to documents.
Old docs: https://docs.appdynamics.com/22.2/en/infrastructure-visibility/monitor-containers-with-docker-visibility/use-docker-visibility-with-red-hat-openshift
New Docs: https://docs.appdynamics.com/22.2/en/infrastructure-visibility/monitor-kubernetes-with-the-cluster-agent
Note that there is not a prescribed way to instrument as such, you need to make some decisions.
i.e. (from the second doc link):
The first decision is to use the officially released pre-built
Appdynamics Operator images published on DockerHub and Redhat
Registry or If you want to build a custom Appdynamics Operator image.
See Build the Custom Cluster Agent Image.
The second decision is whether to use the officially released
pre-built Cluster Agent images published on DockerHub and Redhat
Registry or If you want to build a custom Cluster Agent image. See
Cluster Agent Container Image.
The third decision is whether to install the Cluster Agent using the
Kubernetes CLI or the Cluster Agent Helm Chart. See Install the
Cluster Agent with the Kubernetes CLI and Install the Cluster Agent
with Helm Charts.

Openshift OKD 4.5 on VMware

I am getting the connection time out when running the command in bootstrap.
Any configuration suggestions on networking part if I am missing
It’s says kubernetes api calling time out
This is obviously very hard to debug without having access to your environment. Some tips to debug the OKD installation:
Before starting the installation, make sure your environment meets all the prerequisites. Often, the problem lies with a faulty DNS / DHCP / networking setup. Potentially deploy a separate VM into the network to check if everything works as expected.
The bootstrap node and the Master Nodes are deployed with the SSH key you specify, so in vCenter, get the IP of the machines that are already deployed and use SSH to connect to them. Once on the machine, use sudo crictl ps and sudo crictl logs <container-id> to review the logs for the running containers, focussing on the components:
kube-apiserver
etcd
machine-controller
In your case, the API is not coming up, so reviewing the logs of the above components will likely show the root cause.

Redhat Openshift 4 - Not able to make mysql connection from php pod to mysql pod

I am user of Openshift online and OKD. I am facing similar issue in both places. Please have a look.
I have created a project.
I have launched php in Developer's Catalog option. With other details, I entered my project's git url, project is cloned successfully. Now it needs to connect to mysql database only.
In Pods, I deployed mysql image from 'Deploy Image' option. It is launched successfully.
When I make mysql connection from php pod to mysql pod, it does not connect, connection time out.
How should I make connection?
Note :
I do not have datastore option to launch mysql from developer's catalog in openshift online, that's why I am launching mysql image from deploy image.
As you mentioned you are using Openshift Online and OKD and you are facing the issue at both places.
You can not create mysql from development store because currently, the OpenShift Online catalog does not provide MySQL template via the web interface directly, but you can deploy the MySQL template using the oc CLI instead. The database deployment is simplified when using templates.
Once logged in with the oc CLI, running
oc new-app -L
will list all of the templates that we were used to seeing in the web console, including the mysql-persistent. Then, you can specify all the template parameters via the oc CLI, e.g.:
oc new-app mysql-persistent -p MYSQL_USER=<desired_DB_username> -p MYSQL_PASSWORD=<mysql_password> -p MYSQL_DATABASE=<desired_database_name>
If you'd like to see all the supported template parameters, you can use
oc process <template_name> --parameters -n openshift
or, for a more detailed output,
oc describe template <template_name> -n openshift
Once the app is launched successfully, you can find this app's hostname in services and connect to it from your php pod after defining host name in php configuration file.

Application pod deployment across different openshift clusters

I have openshift 3.9 installed in one AWS region ohio. I have jenkins installed in it. I have a pipeline code in where it will take Java code from GitHub bind with jboss and deployed it in project test within the same cluster. It works fine and I'm able to access the app as pod is creating and app is also binding with jboss. Now I want to deploy this application across different clusters either within the same region or across different regions. Is there a way to achieve this?
You can use the oc command line tool in your Jenkins pipeline to deploy it to a different cluster. For a related example, check the Gitlab review apps example using an OpenShift cluster. It does something similar, where the CI pipeline deploys the required artifacts to an OpenShift cluster using oc and appropriate credentials.

How to setup Openshift all-in-one cluster

I am new to openshift origin and just downloaded binary (All-in-One Server) from below URL and untar it
https://github.com/openshift/origin/releases
Now while google i found two option to start working with it, i want to know whats difference between them??
oc cluster up
openshift start
As both are providing console like
localhost:8443/console