Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example for alpine-chrome deployment on k8s #139

Merged
merged 2 commits into from
Oct 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions examples/k8s/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# zenika/alpine-chrome in k8s

Here is an example with kubernetes on how to launch and use `zenika/alpine-chrome`.

## Launch

Inside this folder, run the following command:

```
kubectl apply -f deployment.yml
```

## Test

You can port forward from your cluster to your local machine with following command

```
kubectl port-forward deployment/alpine-chrome-deployment 9222
```

Then go to `localhost:9222` with your browser (must be a chrome base browser!)
You can enter `https://google.com` or any service you want to call.

## Configuration

You may change the `zenika/alpine-chrome` image you want to use modifying the line 23 in `deployment.yml`.
64 changes: 64 additions & 0 deletions examples/k8s/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: alpine-chrome-deployment
labels:
app: alpine-chrome
spec:
replicas: 1
selector:
matchLabels:
name: alpine-chrome
template:
metadata:
labels:
name: alpine-chrome
spec:
containers:
- args:
- --remote-debugging-address=0.0.0.0
- --remote-debugging-port=9222
- --headless
- --disable-gpu
image: zenika/alpine-chrome
livenessProbe:
httpGet:
path: /json
port: 9222
initialDelaySeconds: 10
timeoutSeconds: 10
name: zenika-alpine-chrome
readinessProbe:
httpGet:
path: /json
port: 9222
initialDelaySeconds: 10
timeoutSeconds: 10
resources:
limits:
cpu: "1"
memory: 2Gi
requests:
cpu: "1"
memory: 100Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
add:
- SYS_ADMIN
readOnlyRootFilesystem: true
volumeMounts:
- mountPath: /tmp
name: tmp
- mountPath: /home/chrome
name: chrome
restartPolicy: Always
securityContext:
runAsNonRoot: true
runAsUser: 1000
volumes:
- emptyDir: {}
name: tmp
- emptyDir: {}
name: chrome
status: {}