Skip to content

Commit c3f48a4

Browse files
Chad MoonChad Moon
Chad Moon
authored and
Chad Moon
committed
save tpr resources to repo
1 parent a78e17e commit c3f48a4

File tree

5 files changed

+83
-4
lines changed

5 files changed

+83
-4
lines changed

manifests/deployment.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
apiVersion: extensions/v1beta1
2+
kind: Deployment
3+
metadata:
4+
name: etcd-operator
5+
spec:
6+
replicas: 1
7+
template:
8+
metadata:
9+
labels:
10+
name: etcd-operator
11+
spec:
12+
containers:
13+
- name: etcd-operator
14+
image: quay.io/coreos/etcd-operator:v0.4.2
15+
env:
16+
- name: MY_POD_NAMESPACE
17+
valueFrom:
18+
fieldRef:
19+
fieldPath: metadata.namespace
20+
- name: MY_POD_NAME
21+
valueFrom:
22+
fieldRef:
23+
fieldPath: metadata.name

manifests/example-etcd-cluster.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: "etcd.coreos.com/v1beta1"
2+
kind: "Cluster"
3+
metadata:
4+
name: "example-etcd-cluster"
5+
spec:
6+
size: 3
7+
version: "3.1.8"

manifests/service.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"kind": "Service",
3+
"apiVersion": "v1",
4+
"metadata": {
5+
"name": "example-etcd-cluster-client-service"
6+
},
7+
"spec": {
8+
"selector": {
9+
"etcd_cluster": "example-etcd-cluster",
10+
"app": "etcd"
11+
},
12+
"ports": [
13+
{
14+
"protocol": "TCP",
15+
"port": 2379,
16+
"targetPort": 2379,
17+
"nodePort": 32379
18+
}
19+
],
20+
"type": "NodePort"
21+
}
22+
}

scripts/etcd-crd.sh

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
3+
echo "installing etcd operator"
4+
kubectl create -f https://raw.githubusercontent.com/coreos/etcd-operator/master/example/deployment.yaml
5+
kubectl rollout status -f https://raw.githubusercontent.com/coreos/etcd-operator/master/example/deployment.yaml
6+
7+
until kubectl get thirdpartyresource cluster.etcd.coreos.com
8+
do
9+
echo "waiting for operator"
10+
sleep 2
11+
done
12+
13+
echo "pausing for 10 seconds for operator to settle"
14+
sleep 10
15+
16+
kubectl create -f https://raw.githubusercontent.com/coreos/etcd-operator/master/example/example-etcd-cluster.yaml
17+
18+
echo "installing etcd cluster service"
19+
kubectl create -f https://raw.githubusercontent.com/coreos/etcd-operator/master/example/example-etcd-cluster-nodeport-service.json
20+
21+
echo "waiting for etcd cluster to turnup"
22+
23+
until kubectl get pod example-etcd-cluster-0002
24+
do
25+
echo "waiting for etcd cluster to turnup"
26+
sleep 2
27+
done

scripts/etcd.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env bash
22

33
echo "installing etcd operator"
4-
kubectl create -f https://raw.githubusercontent.com/coreos/etcd-operator/master/example/deployment.yaml
5-
kubectl rollout status -f https://raw.githubusercontent.com/coreos/etcd-operator/master/example/deployment.yaml
4+
kubectl create -f manifests/deployment.yaml
5+
kubectl rollout status -f manifests/deployment.yaml
66

77
until kubectl get thirdpartyresource cluster.etcd.coreos.com
88
do
@@ -13,10 +13,10 @@ done
1313
echo "pausing for 10 seconds for operator to settle"
1414
sleep 10
1515

16-
kubectl create -f https://raw.githubusercontent.com/coreos/etcd-operator/master/example/example-etcd-cluster.yaml
16+
kubectl create -f manifests/example-etcd-cluster.yaml
1717

1818
echo "installing etcd cluster service"
19-
kubectl create -f https://raw.githubusercontent.com/coreos/etcd-operator/master/example/example-etcd-cluster-nodeport-service.json
19+
kubectl create -f manifests/service.json
2020

2121
echo "waiting for etcd cluster to turnup"
2222

0 commit comments

Comments
 (0)