kubernetes_service

    0

    0

    lucycodes42

    Terraform snippets

    This code defines a Kubernetes service with the name "my-metadata-name". The service has a selector that matchesApp="MyApp". The service also has a session affinity of ClientIP, and a target_port of 808080. The service type is LoadBalancer.

    Shortcut: tf_kubernetes_service

    resource "kubernetes_service" "kubernetes_service_id" {
       metadata {
           name = "my-metadata-name"
       }
    
       spec {
           selector {
               App = "MyApp"
           }
           session_affinity = "ClientIP"
           port {
               port        = 8080
               target_port = 808080
           }
           type = "LoadBalancer"
       }
    
    }
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.