Docker Cookbook


Upgrading from an Old API Version | 163



Download 6,31 Mb.
Pdf ko'rish
bet135/260
Sana21.04.2022
Hajmi6,31 Mb.
#570749
1   ...   131   132   133   134   135   136   137   138   ...   260
Bog'liq
Docker Cookbook

5.14 Upgrading from an Old API Version | 163


Use the 
kube-version-change
Golang program. It is available in the source under
the 
/cmd/
directory.
Assuming you followed 
Recipe 5.10
, you are all set to build the binary for this pro‐
gram. If you have not built Kubernetes from source yet, do so now (see 
Recipe 5.10
).
In the root of the Kubernetes source checked out from GitHub, do the following:
$ hack/build-go.sh cmd/kube-version-change
This uses your local Golang installation to build the 
kube-version-change
program
and place it into the 
/_output/local/bin/
directory. On a 64-bit Linux machine, it will
be located precisely in 
_output/dockerized/bin/linux/amd64/kube-version-change
.
Discussion
With the version change tool compiled, you are ready to migrate your configuration
file to a new API version. Assuming you have a MySQL pod definition file
(
mysql.yaml
), use the 
v1beta2
API specification like so:
apiVersion: v1beta2
desiredState:
manifest:
containers:
- name: mysql
image: mysql
env:
- name: MYSQL_ROOT_PASSWORD
value: password
ports:
- containerPort: 3306
name: mysql
protocol: TCP
id: mysql
kind: Pod
labels:
name: mysql
Change the version to 
v1
:
$ ./kube-version-change -i mysql.yaml -o mysql3.yaml
This results in a 
mysql3.yaml
pod definition that uses the 
v1beta3
API specification:
apiVersion: v1beta3
kind: Pod
metadata:
creationTimestamp: null
labels:
name: mysql
name: mysql
spec:
164 | Chapter 5: Kubernetes


containers:
- capabilities: {}
env:
- name: MYSQL_ROOT_PASSWORD
value: password
image: mysql
imagePullPolicy: IfNotPresent
name: mysql
ports:
- containerPort: 3306
name: mysql
protocol: TCP
resources: {}
securityContext:
capabilities: {}
privileged: false
terminationMessagePath: /dev/termination-log
dnsPolicy: ClusterFirst
restartPolicy: Always
serviceAccount: 
""
volumes: null
status: {}
You can also migrate from 
v1beta3
to previous API versions. This
might be handy to explore the specification. Try this:
$ ./kube-version-change -i mysql3.yaml -o mysql2.yaml -v v1beta2

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   131   132   133   134   135   136   137   138   ...   260




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish