Creating a Kubernetes Cluster Environment

Learn how to create a reference to Container Engine for Kubernetes (OKE) cluster target environment.

Before you begin, you must create a Container Engine for Kubernetes cluster. For creating IAM policy specific to private OKE environment, see Environment Policies.

For accessing DevOps using the Oracle Cloud Console, REST API, and CLI, see Accessing DevOps.

Using the Console

  1. Open the navigation menu and click Developer Services. Under DevOps, click Projects.
  2. Select an existing project, or create a DevOps project.
  3. Click Create environment.
  4. For Environment type, select Oracle Kubernetes Engine.
  5. Enter a name and optional description for the environment.
  6. (Optional) To add tags to the environment, click Show tagging options. Tagging is a metadata system that lets you organize and track the resources in your tenancy.

    If you have permissions to create a resource, you also have permissions to add free-form tags to that resource.

    To add a defined tag, you must have permissions to use the tag namespace.

    For more information, see Resource Tags.

  7. Click Next.
  8. Select the region where the cluster is located.
  9. Select the compartment in which the cluster is located.
  10. Select an OKE cluster. You can select either a public or a private cluster.

    You can configure security rule to allow specific type of traffic. For ingress rule, you must provide the source and source type. The source you provide depends on the source type you choose. Source type can be Classless Inter-Domain Routing (CIDR), Network Security Group, or Service. For information about defining security rules, see Security Rules.

    For public endpoints, you can use the Oracle service CIDR labels to restrict OKE API server access to only DevOps service for deployment. Example: all-phx-services-in-oracle-services-network is a service CIDR label that represents all the CIDRs for the supported services in the Oracle Services Network in the US West (Phoenix) region. For more information, see Access to Oracle Services.

    Private clusters isolate nodes from inbound or outbound public internet connectivity.

    Note

    If you select a private cluster and create the environment reference, then you cannot change to public cluster again.
    1. If you select a private cluster, then select the VCN and subnet that has network access to the Kubernetes API endpoint such as a node pool's subnet. See Creating a Kubernetes Cluster.
    2. (Optional) Select a network security group (NSG) . You can add multiple NSGs.
  11. Click Create environment.

The reference to the Kubernetes cluster environment is created. You can create a deployment pipeline to deploy artifacts to a Container Engine for Kubernetes (OKE) cluster.

Using the CLI

To create a reference to a Kubernetes cluster environment, run the create-oke-cluster-environment command:

oci devops deploy-environment create-oke-cluster-environment

Required parameters for the create-oke-cluster-environment command:

  • --cluster-id
  • --project-id

To get all the commands for deploy-environment:

oci devops deploy-environment -h

To get help for the create-oke-cluster-environment command:

oci devops deploy-environment create-oke-cluster-environment -h

Using the API

To create a reference to a Kubernetes cluster environment, use the CreateDeployEnvironment operation. For the deployEnvironmentType attribute, specify the OKE_CLUSTER value.