mirror of
https://github.com/arangodb/kube-arangodb.git
synced 2024-12-14 11:57:37 +00:00
45 lines
No EOL
859 B
Bash
Executable file
45 lines
No EOL
859 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# Create the operator deployment with custom image option
|
|
|
|
NS=$1
|
|
IMAGE=$2
|
|
|
|
if [ -z $NS ]; then
|
|
echo "Specify a namespace argument"
|
|
exit 1
|
|
fi
|
|
if [ -z $IMAGE ]; then
|
|
echo "Specify an image argument"
|
|
exit 1
|
|
fi
|
|
|
|
yaml=$(cat << EOYAML
|
|
apiVersion: extensions/v1beta1
|
|
kind: Deployment
|
|
metadata:
|
|
name: arangodb-operator
|
|
spec:
|
|
replicas: 1
|
|
template:
|
|
metadata:
|
|
labels:
|
|
name: arangodb-operator
|
|
spec:
|
|
containers:
|
|
- name: arangodb-operator
|
|
imagePullPolicy: IfNotPresent
|
|
image: ${IMAGE}
|
|
env:
|
|
- name: MY_POD_NAMESPACE
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.namespace
|
|
- name: MY_POD_NAME
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.name
|
|
|
|
EOYAML
|
|
)
|
|
echo "$yaml" | kubectl --namespace=$NS create -f - |