🍏 iOS / Mac OSNew government liaison Tim Cook to dine with AI & world leaders(17.09.2026 um 02:10 Uhr)
🍏 iOS / Mac OSNew government liaison Tim Cook to dine with AI & world leaders(17.09.2026 um 02:10 Uhr)
🔧 Programmierung 🕛 vor 2 Jahren 4 Min Lesezeit
0

Kubernetes -Services, Ingress, and ConfigurationsDay 9 of 50 days DevOps Tools Series

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht




Introduction



Welcome to Day 9 of our 50 Days DevOps Tools series. Over the past two days, we have covered the fundamental and advanced concepts of Kubernetes, including its architecture, basic commands, Deployments, StatefulSets, and persistent storage. Today, we will delve into more advanced Kubernetes concepts such as Services, Ingress, and Configurations. These concepts are essential for managing network traffic and configuring applications within Kubernetes.



Services

In Kubernetes, a Service is an abstraction that defines a logical set of pods and a policy by which to access them. Services enable loose coupling between dependent pods. Kubernetes supports several types of services, such as ClusterIP, NodePort, and LoadBalancer.



Key Features of Services:



Stable Network Endpoint: Services provide a stable IP address and DNS name.

Load Balancing: Distributes traffic across multiple pods.

Service Discovery: Kubernetes automatically discovers services and endpoints.

Isolation: Services can isolate internal and external traffic.



Types of Services



ClusterIP: Exposes the service on an internal IP in the cluster. This is the default service type.

NodePort: Exposes the service on the same port of each selected node in the cluster.

LoadBalancer: Exposes the service using a cloud provider's load balancer.

ExternalName: Maps the service to the contents of the externalName field (e.g., foo.bar.example.com).



Creating a Service:

Here’s how to create a Service using a YAML configuration file.



ClusterIP Service (default)




CODE
apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
selector:
app: MyApp
ports:
- protocol: TCP
port: 80
targetPort: 9376






NodePort Service




CODE
apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
type: NodePort
selector:
app: MyApp
ports:
- protocol: TCP
port: 80
targetPort: 9376
nodePort: 30007







LoadBalancer Service




CODE
apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
type: LoadBalancer
selector:
app: MyApp
ports:
- protocol: TCP
port: 80
targetPort: 9376






Explanation:



apiVersion: Specifies the API version.

kind: Specifies the type of Kubernetes object (Service).

metadata: Contains metadata about the Service, including the name.

spec: Defines the desired state of the Service.

type: Specifies the type of Service (ClusterIP, NodePort, LoadBalancer).

selector: Selects pods based on labels.

ports: Defines the port configurations for the Service.



Commands:



kubectl apply -f service.yaml #Create a service

kubectl get services #Get services

kubectl describe service my-service #Describe a service

kubectl delete service my-service #Delete a service





Ingress



Ingress is a Kubernetes object that manages external access to services within a cluster, typically HTTP. Ingress can provide load balancing, SSL termination, and name-based virtual hosting.



Key Features of Ingress:



Load Balancing: Distributes traffic across multiple backend services.

SSL/TLS Termination: Terminate SSL/TLS at the ingress point.

Name-Based Virtual Hosting: Route traffic based on the host name.

Creating an Ingress Resource:



Here’s how to create an Ingress resource using a YAML configuration file.




CODE
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-ingress
spec:
rules:
- host: my-app.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: my-service
port:
number: 80






Explanation:



apiVersion: Specifies the API version.

kind: Specifies the type of Kubernetes object (Ingress).

metadata: Contains metadata about the Ingress, including the name.

spec: Defines the desired state of the Ingress.

rules: Specifies the routing rules for the Ingress.

host: The host name to match.

http: Specifies the HTTP rules.

paths: Defines the paths to match and the backend services to route to.

path: The path to match.

pathType: The type of path matching (Prefix, Exact).

backend: The backend service and port to route to.





Configurations: ConfigMaps and Secrets



Kubernetes provides ConfigMaps and Secrets to manage configuration data and sensitive information, respectively.



ConfigMaps

ConfigMaps are used to store non-confidential data in key-value pairs. They can be used to configure applications without hardcoding configuration data in the container images.



Creating a ConfigMap:

Here’s how to create a ConfigMap using a YAML configuration file.




CODE
apiVersion: v1
kind: ConfigMap
metadata:
name: my-config
data:
database_url: mongodb://my-db:27017
feature_enabled: "true"






Explanation:



apiVersion: Specifies the API version.

kind: Specifies the type of Kubernetes object (ConfigMap).

metadata: Contains metadata about the ConfigMap, including the name.

data: Defines the key-value pairs for the configuration data.



Secrets

Secrets are used to store confidential data, such as passwords, OAuth tokens, and SSH keys. Secrets are similar to ConfigMaps but are specifically designed to store sensitive information.



Creating a Secret:

Here’s how to create a Secret using a YAML configuration file.




CODE
apiVersion: v1
kind: Secret
metadata:
name: my-secret
type: Opaque
data:
username: YWRtaW4=
password: MWYyZDFlMmU2N2Rm






Conclusion



Understanding Services, Ingress, and Configurations (ConfigMaps and Secrets) in Kubernetes is crucial for managing network traffic and configuring applications within a cluster. These concepts help in maintaining a stable, secure, and scalable environment for your applications.



With this post, we conclude our three-day deep dive into Kubernetes. From tomorrow, we will explore other exciting DevOps tools that will further enhance your DevOps workflow. Stay tuned!



🔄 Subscribe to our blog to get notifications on upcoming posts.

Vollständiger Original-Artikel
Den kompletten Beitrag mit allen Details direkt auf dev.to lesen.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
2 Quellen
Your README code examples are silently lying — I built a CLI to detect documentation drift using only AST, no LLM
1 Quelle
An Outbox for 3 Million Events a Day on Azure SQL: the Engineering Behind It
1 Quelle
Vibe Coding Was Never Going to Be the Future. Architecture Is.
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Kubernetes -Services, Ingress, and ConfigurationsDay 9 of 50 days DevOps Tools Series

Thematisch verwandte Begriffe: Kubernetes, Services, Ingress, ConfigurationsDay · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...