我尝试按照此网页上的说明进行操作:https://dbafromthecold.com/2019/02/20/creating-custom-sql-server-helm-charts/,即
1)头盔初始化 2)mkdir C:\ Helm 3)CD C:\头盔 4)创建testsqlchart舵 5)cd testsqlchart /模板 6)rm部署.yaml rm service.yaml rm ingress.yaml
7)重新创建deployment.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获得豆荚
为什么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
注意错误:评估期已过。 我已经注意到,如果我进入:deployment.yaml并将映像行更改为:
图片:microsoft / mssql-server-linux
然后它可以工作,即我可以通过SQL Studio管理器进行连接。
答案 0 :(得分:0)
经过几次尝试,我发现所有2019-CTP-*
images都存在相同的问题。
"2019-CTP2.0",
"2019-CTP2.0-ubuntu",
"2019-CTP2.1",
"2019-CTP2.1-ubuntu",
"2019-CTP2.2",
"2019-CTP2.2-ubuntu",
"2019-CTP2.3",
"2019-CTP2.3-ubuntu",
"2019-CTP2.4",
"2019-CTP2.4-ubuntu",
"2019-CTP2.5",
"2019-CTP2.5-ubuntu",
"2019-CTP3.0",
"2019-CTP3.0-ubuntu",
"2019-CTP3.1",
"2019-CTP3.1-ubuntu",
"2019-CTP3.2",
"2019-CTP3.2-ubuntu",
Featured 2019-CU4-ubuntu-16.04
版本完全没有问题。
建议您使用与CTP
版本不同的
$ kubectl get pods | grep sql
sqlserver-55c86b7c8b-2wrb7 1/1 Running 0 5m58s