@@ -29,13 +29,13 @@ Kompose is released via GitHub on a three-week cycle, you can see all current re
29
29
30
30
``` sh
31
31
# Linux
32
- curl -L https://github.com/kubernetes/kompose/releases/download/v1.26 .0/kompose-linux-amd64 -o kompose
32
+ curl -L https://github.com/kubernetes/kompose/releases/download/v1.34 .0/kompose-linux-amd64 -o kompose
33
33
34
34
# macOS
35
- curl -L https://github.com/kubernetes/kompose/releases/download/v1.26 .0/kompose-darwin-amd64 -o kompose
35
+ curl -L https://github.com/kubernetes/kompose/releases/download/v1.34 .0/kompose-darwin-amd64 -o kompose
36
36
37
37
# Windows
38
- curl -L https://github.com/kubernetes/kompose/releases/download/v1.26 .0/kompose-windows-amd64.exe -o kompose.exe
38
+ curl -L https://github.com/kubernetes/kompose/releases/download/v1.34 .0/kompose-windows-amd64.exe -o kompose.exe
39
39
40
40
chmod +x kompose
41
41
sudo mv ./kompose /usr/local/bin/kompose
@@ -93,26 +93,27 @@ you need is an existing `docker-compose.yml` file.
93
93
1 . Go to the directory containing your ` docker-compose.yml ` file. If you don't have one, test using this one.
94
94
95
95
``` yaml
96
- version : " 2"
97
96
98
97
services :
99
98
100
- redis-master :
101
- image : registry.k8s.io/redis:e2e
99
+ redis-leader :
100
+ container_name : redis-leader
101
+ image : redis
102
102
ports :
103
103
- " 6379"
104
104
105
- redis-slave :
106
- image : gcr.io/google_samples/gb-redisslave:v3
105
+ redis-replica :
106
+ container_name : redis-replica
107
+ image : redis
107
108
ports :
108
109
- " 6379"
109
- environment :
110
- - GET_HOSTS_FROM=dns
110
+ command : redis-server --replicaof redis-leader 6379 --dir /tmp
111
111
112
- frontend :
113
- image : gcr.io/google-samples/gb-frontend:v4
112
+ web :
113
+ container_name : web
114
+ image : quay.io/kompose/web
114
115
ports :
115
- - " 80:80 "
116
+ - " 8080:8080 "
116
117
environment :
117
118
- GET_HOSTS_FROM=dns
118
119
labels :
@@ -129,27 +130,27 @@ you need is an existing `docker-compose.yml` file.
129
130
The output is similar to :
130
131
131
132
` ` ` none
132
- INFO Kubernetes file "frontend-tcp -service.yaml" created
133
- INFO Kubernetes file "redis-master -service.yaml" created
134
- INFO Kubernetes file "redis-slave -service.yaml" created
135
- INFO Kubernetes file "frontend- deployment.yaml" created
136
- INFO Kubernetes file "redis-master -deployment.yaml" created
137
- INFO Kubernetes file "redis-slave -deployment.yaml" created
133
+ INFO Kubernetes file "redis-leader -service.yaml" created
134
+ INFO Kubernetes file "redis-replica -service.yaml" created
135
+ INFO Kubernetes file "web-tcp -service.yaml" created
136
+ INFO Kubernetes file "redis-leader- deployment.yaml" created
137
+ INFO Kubernetes file "redis-replica -deployment.yaml" created
138
+ INFO Kubernetes file "web -deployment.yaml" created
138
139
` ` `
139
140
140
141
` ` ` bash
141
- kubectl apply -f frontend -tcp-service.yaml,redis-master -service.yaml,redis-slave -service.yaml,frontend -deployment.yaml,redis-master -deployment.yaml,redis-slave -deployment.yaml
142
+ kubectl apply -f web -tcp-service.yaml,redis-leader -service.yaml,redis-replica -service.yaml,web -deployment.yaml,redis-leader -deployment.yaml,redis-replica -deployment.yaml
142
143
` ` `
143
144
144
145
The output is similar to :
145
146
146
147
` ` ` none
147
- service/frontend-tcp created
148
- service /redis-master created
149
- service/redis-slave created
150
- deployment.apps/frontend created
151
- deployment.apps /redis-master created
152
- deployment.apps/redis-slave created
148
+ deployment.apps/redis-leader created
149
+ deployment.apps /redis-replica created
150
+ deployment.apps/web created
151
+ service/redis-leader created
152
+ service /redis-replica created
153
+ service/web-tcp created
153
154
` ` `
154
155
155
156
Your deployments are running in Kubernetes.
@@ -159,39 +160,35 @@ you need is an existing `docker-compose.yml` file.
159
160
If you're already using `minikube` for your development process :
160
161
161
162
` ` ` bash
162
- minikube service frontend
163
+ minikube service web-tcp
163
164
` ` `
164
165
165
166
Otherwise, let's look up what IP your service is using!
166
167
167
168
` ` ` sh
168
- kubectl describe svc frontend
169
+ kubectl describe svc web-tcp
169
170
` ` `
170
171
171
172
` ` ` none
172
- Name: frontend-tcp
173
- Namespace: default
174
- Labels: io.kompose.service=frontend-tcp
175
- Annotations: kompose.cmd: kompose convert
176
- kompose.service.type: LoadBalancer
177
- kompose.version: 1.26.0 (40646f47)
178
- Selector: io.kompose.service=frontend
179
- Type: LoadBalancer
180
- IP Family Policy: SingleStack
181
- IP Families: IPv4
182
- IP: 10.43.67.174
183
- IPs: 10.43.67.174
184
- Port: 80 80/TCP
185
- TargetPort: 80/TCP
186
- NodePort: 80 31254/TCP
187
- Endpoints: 10.42.0.25:80
188
- Session Affinity: None
189
- External Traffic Policy: Cluster
190
- Events:
191
- Type Reason Age From Message
192
- ---- ------ ---- ---- -------
193
- Normal EnsuringLoadBalancer 62s service-controller Ensuring load balancer
194
- Normal AppliedDaemonSet 62s service-controller Applied LoadBalancer DaemonSet kube-system/svclb-frontend-tcp-9362d276
173
+ Name: web-tcp
174
+ Namespace: default
175
+ Labels: io.kompose.service=web-tcp
176
+ Annotations: kompose.cmd: kompose convert
177
+ kompose.service.type: LoadBalancer
178
+ kompose.version: 1.33.0 (3ce457399)
179
+ Selector: io.kompose.service=web
180
+ Type: LoadBalancer
181
+ IP Family Policy: SingleStack
182
+ IP Families: IPv4
183
+ IP: 10.102.30.3
184
+ IPs: 10.102.30.3
185
+ Port: 8080 8080/TCP
186
+ TargetPort: 8080/TCP
187
+ NodePort: 8080 31624/TCP
188
+ Endpoints: 10.244.0.5:8080
189
+ Session Affinity: None
190
+ External Traffic Policy: Cluster
191
+ Events: <none>
195
192
` ` `
196
193
197
194
If you're using a cloud provider, your IP will be listed next to `LoadBalancer Ingress`.
@@ -206,7 +203,7 @@ you need is an existing `docker-compose.yml` file.
206
203
resources used.
207
204
208
205
` ` ` sh
209
- kubectl delete -f frontend -tcp-service.yaml,redis-master -service.yaml,redis-slave -service.yaml,frontend -deployment.yaml,redis-master -deployment.yaml,redis-slave -deployment.yaml
206
+ kubectl delete -f web -tcp-service.yaml,redis-leader -service.yaml,redis-replica -service.yaml,web -deployment.yaml,redis-leader -deployment.yaml,redis-replica -deployment.yaml
210
207
` ` `
211
208
212
209
<!-- discussion -->
0 commit comments