Difference between revisions of "Kubernetes"

From John Freier
Jump to: navigation, search
Line 18: Line 18:
 
       selector:
 
       selector:
 
         app: my-app
 
         app: my-app
 +
 +
Use the following option to make the service Headless, this is good when each of the pods has state and the state could be different between them.  This exposes each pods ip through a DNS lookup.
 +
  Service.spec.clusterIP: None
  
 
ConfigMap
 
ConfigMap

Revision as of 15:05, 4 April 2022

Configurations YAML File

Service

 - kind: Service
   apiVersion: v1
   metadata:
     name: app-service
     namespace: app-ns
   spec:
     ports:
       - port: 8080
         targetPort: 8080
     selector:
       app: my-app

Use the following option to make the service Headless, this is good when each of the pods has state and the state could be different between them. This exposes each pods ip through a DNS lookup.

 Service.spec.clusterIP: None

ConfigMap

 # ConfigMap Configuration
 - kind: ConfigMap
   apiVersion: v1
   metadata:
     name: app-config
     namespace: app-ns
   data:
     CONFIG_TEMP: soon-to-come