You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							65 lines
						
					
					
						
							1.5 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							65 lines
						
					
					
						
							1.5 KiB
						
					
					
				
								function (
							 | 
						|
								    containerPort=80, 
							 | 
						|
								    image="gcr.io/heptio-images/ks-guestbook-demo:0.2", 
							 | 
						|
								    name="jsonnet-guestbook-ui",
							 | 
						|
								    replicas=1,
							 | 
						|
								    servicePort=80, 
							 | 
						|
								    type="LoadBalancer"
							 | 
						|
								)
							 | 
						|
								    [
							 | 
						|
								    {
							 | 
						|
								        "apiVersion": "v1",
							 | 
						|
								        "kind": "Service",
							 | 
						|
								        "metadata": {
							 | 
						|
								            "name": name
							 | 
						|
								        },
							 | 
						|
								        "spec": {
							 | 
						|
								            "ports": [
							 | 
						|
								                {
							 | 
						|
								                "port": servicePort,
							 | 
						|
								                "targetPort": containerPort
							 | 
						|
								                }
							 | 
						|
								            ],
							 | 
						|
								            "selector": {
							 | 
						|
								                "app": name
							 | 
						|
								            },
							 | 
						|
								            "type": type
							 | 
						|
								        }
							 | 
						|
								    },
							 | 
						|
								    {
							 | 
						|
								        "apiVersion": "apps/v1",
							 | 
						|
								        "kind": "Deployment",
							 | 
						|
								        "metadata": {
							 | 
						|
								            "name": name
							 | 
						|
								        },
							 | 
						|
								        "spec": {
							 | 
						|
								            "replicas": replicas,
							 | 
						|
								            "revisionHistoryLimit": 3,
							 | 
						|
								            "selector": {
							 | 
						|
								                "matchLabels": {
							 | 
						|
								                "app": name
							 | 
						|
								                },
							 | 
						|
								            },
							 | 
						|
								            "template": {
							 | 
						|
								                "metadata": {
							 | 
						|
								                "labels": {
							 | 
						|
								                    "app": name
							 | 
						|
								                }
							 | 
						|
								                },
							 | 
						|
								                "spec": {
							 | 
						|
								                "containers": [
							 | 
						|
								                    {
							 | 
						|
								                        "image": image,
							 | 
						|
								                        "name": name,
							 | 
						|
								                        "ports": [
							 | 
						|
								                        {
							 | 
						|
								                            "containerPort": containerPort
							 | 
						|
								                        }
							 | 
						|
								                        ]
							 | 
						|
								                    }
							 | 
						|
								                ]
							 | 
						|
								                }
							 | 
						|
								            }
							 | 
						|
								        }
							 | 
						|
								    }
							 | 
						|
								    ]
							 | 
						|
								
							 |