Creating a Kubernetes Cluster Environment

Create a reference to Kubernetes Engine (OKE) cluster target environment.

Before you begin, you must create a Kubernetes Engine 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.

    1. Open the navigation menu and click Developer Services. Under DevOps, click Projects.
    2. On the DevOps Projects page, select an existing project, or create a DevOps project.
    3. On the details page of the project, from the left side, click Environments.
    4. On the Environments page, click Create environment.
    5. In the Basic information section, provide the following details and click Next:
      • Select Oracle Kubernetes Engine as the environment type.
      • Enter a name for the environment.
      • (Optional) Add a description for the environment.
      • (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.

    6. In the Environment details section, select the region where the cluster is located.
    7. Select the compartment in which the cluster is located.
    8. Select an OKE cluster. You can select either a public or a private cluster.
      Note

      We do not support IPv6 enabled subnets for private endpoints.

      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.
        If you are using the Quick Create workflow for creating the cluster, then select the default VCN and subnet provided by the workflow.
      2. (Optional) Select a network security group (NSG) . You can add multiple NSGs.
    9. Click Create environment.

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

  • 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
  • To create a reference to a Kubernetes cluster environment, use the CreateDeployEnvironment operation. For the deployEnvironmentType attribute, specify the OKE_CLUSTER value.