Я пытался следовать инструкциям на этой веб-странице: https://dbafromthecold.com/2019/02/20/creating-custom-sql-server-helm-charts/ т.е.
1) helm init 2) mkdir C: \ Helm 3) cd C: \ Helm 4) helm create testsqlchart 5) cd testsqlchart / templates 6) rm deploy.yaml rm service.yaml rm ingress.yaml
7) Повторно создайте deploy.yaml: -
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: sqlserver
spec:
replicas: 1
template:
metadata:
labels:
name: sqlserver
spec:
containers:
- name: sqlserver1
image: mcr.microsoft.com/mssql/server:2019-CTP2.2-ubuntu
ports:
- containerPort: 1433
env:
- name: SA_PASSWORD
value: "Testing1122"
- name: ACCEPT_EULA
value: "Y"
8) Пересоздайте файл service.yaml:
apiVersion: v1
kind: Service
metadata:
name: sqlserver-service
spec:
ports:
- name: sqlserver
port: 1433
targetPort: 1433
selector:
name: sqlserver
type: LoadBalancer
9) cd C: \ Helm
10) helm install ./testsqlchart --name testsqlserver
11) kubectl get pods
Почему Pod находится в состоянии ошибки? Вот результат: kubectl describe pod sqlserver-68865dd9f8-7xrtp
Name: sqlserver-68865dd9f8-7xrtp
Namespace: default
Priority: 0
Node: docker-desktop/192.168.65.3
Start Time: Fri, 10 Apr 2020 10:22:24 +0100
Labels: name=sqlserver
pod-template-hash=68865dd9f8
Annotations: <none>
Status: Running
IP: 10.1.1.11
Controlled By: ReplicaSet/sqlserver-68865dd9f8
Containers:
sqlserver1:
Container ID: docker://ac6c42c381a8368d7e354ab385181a2d94754ebefddf9fb5412f232a2c8539e6
Image: mcr.microsoft.com/mssql/server:2019-CTP2.2-ubuntu
Image ID: docker-pullable://mcr.microsoft.com/mssql/server@sha256:5beefc726eab1546a05a6520cdea9a795e7f64287821393f29099b6c21379419
Port: 1433/TCP
Host Port: 0/TCP
State: Waiting
Reason: CrashLoopBackOff
Last State: Terminated
Reason: Error
Exit Code: 139
Started: Fri, 10 Apr 2020 10:28:12 +0100
Finished: Fri, 10 Apr 2020 10:28:13 +0100
Ready: False
Restart Count: 6
Environment:
SA_PASSWORD: Testing1122
ACCEPT_EULA: Y
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from default-token-bncbh (ro)
Conditions:
Type Status
Initialized True
Ready False
ContainersReady False
PodScheduled True
Volumes:
default-token-bncbh:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-bncbh
Optional: false
QoS Class: BestEffort
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 8m2s default-scheduler Successfully assigned default/sqlserver-68865dd9f8-7xrtp to docker-desktop
Normal Pulled 6m30s (x5 over 8m1s) kubelet, docker-desktop Container image "mcr.microsoft.com/mssql/server:2019-CTP2.2-ubuntu" already present on machine
Normal Created 6m30s (x5 over 8m1s) kubelet, docker-desktop Created container sqlserver1
Normal Started 6m30s (x5 over 8m1s) kubelet, docker-desktop Started container sqlserver1
Warning BackOff 2m50s (x26 over 7m56s) kubelet, docker-desktop Back-off restarting failed container
и результат: kubectl log sqlserver-68865dd9f8-7xrtp
log is DEPRECATED and will be removed in a future version. Use logs instead.
Error: The evaluation period has expired.
This program has encountered a fatal error and cannot continue running at Fri Apr 10 09:28:13 2020
The following diagnostic information is available:
Reason: 0x00000003
Message: Unexpected call to legacy ABI.
Stacktrace: 00005624f716fab4 00005624f716f645 00005624f70b2cbe
00005624f70f6b17
Process: 1 - sqlservr
Thread: 6
Instance Id: e667ce1e-2281-4bf1-a82c-5ee7f67cef46
Crash Id:
Build stamp: 05d4bbaeb108ea432efd44222e380bef8c0a58f369e177ebabf61c807e4b3893
Timestamp: Fri Apr 10 09:28:13 2020
Обратите внимание на ошибку: период оценки истек. Я заметил, что если я go в: deploy.yaml и изменить строку изображения на:
image: microsoft / ms sql -server- linux
, то это работает т.е. я могу подключиться через SQL Studio Manager.