Lighthouse Scanner: How To Setup a Local Kubernetes Staging Environment

Local Kubernetes Staging Environment

k3sup install --ip $SERVER_IP --user $USERk3sup join --ip $NODE_IP --server-ip $SERVER_IP --user $USERNAME

Unified Configuration Management

  • Docker image: Copy config files into the container or define fixed environment variables
  • Docker container: Mount config files into the container, define runtime environment variables
  • Kubernetes Deployments: Mount config files or environment variables into the containers
apiVersion: v1
kind: ConfigMap
metadata:
name: redis-config
data:
redis.conf: |
save 60 1
appendonly yes
...
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis
spec:
replicas: 1
...
spec:
containers:
- name: redis
image: docker.admantium.com/redis-multi:latest
...
volumeMounts:
- name: redis-config
mountPath: /usr/local/etc/redis/
...

Simplifying Container Communication

apiVersion: v1
kind: Service
metadata:
name: redis
spec:
ports:
- protocol: TCP
port: 7139
targetPort: 7139
selector:
app: redis

Docker Multiarch Build

  • Install Docker Community Edition version 2.0.4.0 or higher
  • Enable experimental features
  • Create a multiarch builder object
  • Use docker buildx build --platform

Conclusion

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store