Middle
How closely have you worked with Kubernetes? How did you configure the service configs?
sobes.tech AI
Answer from AI
In working with Kubernetes, I configured services through YAML manifest files, using objects such as Deployment, Service, ConfigMap, and Secret.
For service setup, I usually did the following:
- Deployment — specified the number of replicas, container image, environment variables, resources (CPU, memory), and update strategies.
- Service — created for pod access, choosing the type (ClusterIP, NodePort, LoadBalancer) based on needs.
- ConfigMap and Secret — for passing configuration data and secrets to containers without changing the image.
Example of a simple Deployment with ConfigMap:
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-service
spec:
replicas: 3
selector:
matchLabels:
app: my-service
template:
metadata:
labels:
app: my-service
spec:
containers:
- name: my-service-container
image: my-service-image:latest
envFrom:
- configMapRef:
name: my-service-config
ports:
- containerPort: 8080
I also configured readiness and liveness probes to monitor container health, as well as resources to limit consumption.
For complex services, I used Helm charts to manage configurations and deployment parameterization.