Skip to content
This repository was archived by the owner on Mar 24, 2023. It is now read-only.

Commit 908ad07

Browse files
authored
Allow unfork command to be pointed to forked k8s yaml (#744)
1 parent 9bdc2f9 commit 908ad07

30 files changed

+1199
-62
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ web/.state/
1717
/rendered.yaml
1818

1919
.DS_Store
20+
21+
# delve
22+
cmd/ship/.ship
23+
cmd/ship/base

integration/unfork/redis-k8s/expected/.ship/state.json

+28
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
# Source: redis/templates/configmap.yaml
3+
apiVersion: v1
4+
kind: ConfigMap
5+
metadata:
6+
labels:
7+
app: redis
8+
chart: redis-5.0.0
9+
heritage: Tiller
10+
release: redis
11+
name: redis
12+
data:
13+
redis.conf: |-
14+
# User-supplied configuration:
15+
# maxmemory-policy volatile-lru
16+
master.conf: |-
17+
dir /data
18+
rename-command FLUSHDB ""
19+
rename-command FLUSHALL ""
20+
replica.conf: |-
21+
dir /data
22+
rename-command FLUSHDB ""
23+
rename-command FLUSHALL ""
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
# Source: redis/templates/health-configmap.yaml
3+
apiVersion: v1
4+
kind: ConfigMap
5+
metadata:
6+
labels:
7+
app: redis
8+
chart: redis-5.0.0
9+
heritage: Tiller
10+
release: redis
11+
name: redis-health
12+
data:
13+
ping_local.sh: |-
14+
response=$(
15+
redis-cli \
16+
-a $REDIS_PASSWORD \
17+
-h localhost \
18+
-p $REDIS_PORT \
19+
ping
20+
)
21+
if [ "$response" != "PONG" ]; then
22+
echo "$response"
23+
exit 1
24+
fi
25+
ping_master.sh: |-
26+
response=$(
27+
redis-cli \
28+
-a $REDIS_MASTER_PASSWORD \
29+
-h $REDIS_MASTER_HOST \
30+
-p $REDIS_MASTER_PORT_NUMBER \
31+
ping
32+
)
33+
if [ "$response" != "PONG" ]; then
34+
echo "$response"
35+
exit 1
36+
fi
37+
ping_local_and_master.sh: |-
38+
script_dir="$(dirname "$0")"
39+
exit_status=0
40+
"$script_dir/ping_local.sh" || exit_status=$?
41+
"$script_dir/ping_master.sh" || exit_status=$?
42+
exit $exit_status
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
kind: ""
2+
apiversion: ""
3+
resources:
4+
- configmap.yaml
5+
- health-configmap.yaml
6+
- redis-master-statefulset.yaml
7+
- redis-master-svc.yaml
8+
- redis-slave-deployment.yaml
9+
- redis-slave-svc.yaml
10+
- secret.yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
---
2+
# Source: redis/templates/redis-master-statefulset.yaml
3+
apiVersion: apps/v1beta2
4+
kind: StatefulSet
5+
metadata:
6+
name: redis-master
7+
labels:
8+
app: redis
9+
chart: redis-5.0.0
10+
release: "redis"
11+
heritage: "Tiller"
12+
spec:
13+
selector:
14+
matchLabels:
15+
release: "redis"
16+
role: master
17+
app: redis
18+
serviceName: redis-master
19+
template:
20+
metadata:
21+
labels:
22+
release: "redis"
23+
chart: redis-5.0.0
24+
role: master
25+
app: redis
26+
annotations:
27+
checksum/health: a70f637bcac29808c7ba9227b633914ef262bc8a0358bd4e7aeab02ba1ac8ea2
28+
checksum/configmap: 23853843a059c57c5633a34ba022f8145d1401d7b00dc5945ead28cf322e18df
29+
checksum/secret: 03e3983832be9f64ed7155c4bf08a7abb0c53892aee18dc8fe29b2d2d9d4d6d1
30+
spec:
31+
securityContext:
32+
fsGroup: 1001
33+
runAsUser: 1001
34+
serviceAccountName: "default"
35+
containers:
36+
- name: redis
37+
image: "docker.io/bitnami/redis:4.0.11"
38+
imagePullPolicy: "Always"
39+
command:
40+
- /run.sh
41+
42+
args:
43+
- "--port"
44+
- "$(REDIS_PORT)"
45+
- "--requirepass"
46+
- "$(REDIS_PASSWORD)"
47+
- "--include"
48+
- "/opt/bitnami/redis/etc/redis.conf"
49+
- "--include"
50+
- "/opt/bitnami/redis/etc/master.conf"
51+
env:
52+
- name: REDIS_REPLICATION_MODE
53+
value: master
54+
- name: REDIS_PASSWORD
55+
valueFrom:
56+
secretKeyRef:
57+
name: redis
58+
key: redis-password
59+
- name: REDIS_PORT
60+
value: "6379"
61+
ports:
62+
- name: redis
63+
containerPort: 6379
64+
livenessProbe:
65+
initialDelaySeconds: 5
66+
periodSeconds: 5
67+
timeoutSeconds: 5
68+
successThreshold: 1
69+
failureThreshold: 5
70+
exec:
71+
command:
72+
- sh
73+
- -c
74+
- /health/ping_local.sh
75+
readinessProbe:
76+
initialDelaySeconds: 5
77+
periodSeconds: 5
78+
timeoutSeconds: 1
79+
successThreshold: 1
80+
failureThreshold: 5
81+
exec:
82+
command:
83+
- sh
84+
- -c
85+
- /health/ping_local.sh
86+
resources:
87+
null
88+
89+
volumeMounts:
90+
- name: health
91+
mountPath: /health
92+
- name: redis-data
93+
mountPath: /data
94+
subPath:
95+
- name: config
96+
mountPath: /opt/bitnami/redis/etc
97+
initContainers:
98+
- name: volume-permissions
99+
image: "docker.io/bitnami/minideb:latest"
100+
imagePullPolicy: "IfNotPresent"
101+
command: ["/bin/chown", "-R", "1001:1001", "/data"]
102+
securityContext:
103+
runAsUser: 0
104+
volumeMounts:
105+
- name: redis-data
106+
mountPath: /data
107+
subPath:
108+
volumes:
109+
- name: health
110+
configMap:
111+
name: redis-health
112+
defaultMode: 0755
113+
- name: config
114+
configMap:
115+
name: redis
116+
volumeClaimTemplates:
117+
- metadata:
118+
name: redis-data
119+
labels:
120+
app: "redis"
121+
component: "master"
122+
release: "redis"
123+
heritage: "Tiller"
124+
spec:
125+
accessModes:
126+
- "ReadWriteOnce"
127+
resources:
128+
requests:
129+
storage: "8Gi"
130+
updateStrategy:
131+
type: RollingUpdate
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
# Source: redis/templates/redis-master-svc.yaml
3+
apiVersion: v1
4+
kind: Service
5+
metadata:
6+
name: redis-master
7+
labels:
8+
app: redis
9+
chart: redis-5.0.0
10+
release: "redis"
11+
heritage: "Tiller"
12+
spec:
13+
type: ClusterIP
14+
ports:
15+
- name: redis
16+
port: 6379
17+
targetPort: redis
18+
selector:
19+
app: redis
20+
release: "redis"
21+
role: master
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
---
2+
# Source: redis/templates/redis-slave-deployment.yaml
3+
4+
apiVersion: extensions/v1beta1
5+
kind: Deployment
6+
metadata:
7+
name: redis-slave
8+
labels:
9+
app: redis
10+
chart: redis-5.0.0
11+
release: "redis"
12+
heritage: "Tiller"
13+
spec:
14+
replicas: 1
15+
selector:
16+
matchLabels:
17+
release: "redis"
18+
role: slave
19+
app: redis
20+
template:
21+
metadata:
22+
labels:
23+
release: "redis"
24+
chart: redis-5.0.0
25+
role: slave
26+
app: redis
27+
annotations:
28+
checksum/health: a70f637bcac29808c7ba9227b633914ef262bc8a0358bd4e7aeab02ba1ac8ea2
29+
checksum/configmap: 23853843a059c57c5633a34ba022f8145d1401d7b00dc5945ead28cf322e18df
30+
checksum/secret: 9797325eb1d5751f4afda1cecae802d5a7f6e91a636a931abc0812801211739a
31+
spec:
32+
securityContext:
33+
fsGroup: 1001
34+
runAsUser: 1001
35+
serviceAccountName: "default"
36+
containers:
37+
- name: redis
38+
image: docker.io/bitnami/redis:4.0.11
39+
imagePullPolicy: "Always"
40+
command:
41+
- /run.sh
42+
43+
args:
44+
- "--port"
45+
- "$(REDIS_PORT)"
46+
- "--slaveof"
47+
- "$(REDIS_MASTER_HOST)"
48+
- "$(REDIS_MASTER_PORT_NUMBER)"
49+
- "--requirepass"
50+
- "$(REDIS_PASSWORD)"
51+
- "--masterauth"
52+
- "$(REDIS_MASTER_PASSWORD)"
53+
- "--include"
54+
- "/opt/bitnami/redis/etc/redis.conf"
55+
- "--include"
56+
- "/opt/bitnami/redis/etc/replica.conf"
57+
env:
58+
- name: REDIS_REPLICATION_MODE
59+
value: slave
60+
- name: REDIS_MASTER_HOST
61+
value: redis-master
62+
- name: REDIS_PORT
63+
value: "6379"
64+
- name: REDIS_MASTER_PORT_NUMBER
65+
value: "6379"
66+
- name: REDIS_PASSWORD
67+
valueFrom:
68+
secretKeyRef:
69+
name: redis
70+
key: redis-password
71+
- name: REDIS_MASTER_PASSWORD
72+
valueFrom:
73+
secretKeyRef:
74+
name: redis
75+
key: redis-password
76+
ports:
77+
- name: redis
78+
containerPort: 6379
79+
livenessProbe:
80+
initialDelaySeconds: 5
81+
periodSeconds: 5
82+
timeoutSeconds: 5
83+
successThreshold: 1
84+
failureThreshold: 5
85+
exec:
86+
command:
87+
- sh
88+
- -c
89+
- /health/ping_local_and_master.sh
90+
readinessProbe:
91+
initialDelaySeconds: 5
92+
periodSeconds: 5
93+
timeoutSeconds: 1
94+
successThreshold: 1
95+
failureThreshold: 5
96+
exec:
97+
command:
98+
- sh
99+
- -c
100+
- /health/ping_local_and_master.sh
101+
resources:
102+
null
103+
104+
volumeMounts:
105+
- name: health
106+
mountPath: /health
107+
- name: redis-data
108+
mountPath: /data
109+
- name: config
110+
mountPath: /opt/bitnami/redis/etc
111+
volumes:
112+
- name: health
113+
configMap:
114+
name: redis-health
115+
defaultMode: 0755
116+
- name: config
117+
configMap:
118+
name: redis
119+
- name: redis-data
120+
emptyDir: {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
# Source: redis/templates/redis-slave-svc.yaml
3+
4+
apiVersion: v1
5+
kind: Service
6+
metadata:
7+
name: redis-slave
8+
labels:
9+
app: redis
10+
chart: redis-5.0.0
11+
release: "redis"
12+
heritage: "Tiller"
13+
spec:
14+
type: ClusterIP
15+
ports:
16+
- name: redis
17+
port: 6379
18+
targetPort: redis
19+
selector:
20+
app: redis
21+
release: "redis"
22+
role: slave
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
# Source: redis/templates/secret.yaml
3+
apiVersion: v1
4+
kind: Secret
5+
metadata:
6+
name: redis
7+
labels:
8+
app: redis
9+
chart: redis-5.0.0
10+
release: "redis"
11+
heritage: "Tiller"
12+
type: Opaque
13+
data:
14+
redis-password: "R2JNc2Yxdm5LeQ=="

0 commit comments

Comments
 (0)