Kubernetes

From John Freier
Revision as of 14:05, 4 April 2022 by Jfreier (Talk | contribs)

Jump to: navigation, search

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