mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Updated some offensive words in kubernetes plugin/service with inclusive words/terms. (#5171)
This commit is contained in:
parent
293dd4d8ef
commit
f81d79da8e
@ -142,8 +142,8 @@ public class KubernetesClusterResourceModifierActionWorker extends KubernetesClu
|
|||||||
private String getKubernetesNodeConfig(final String joinIp, final boolean ejectIso) throws IOException {
|
private String getKubernetesNodeConfig(final String joinIp, final boolean ejectIso) throws IOException {
|
||||||
String k8sNodeConfig = readResourceFile("/conf/k8s-node.yml");
|
String k8sNodeConfig = readResourceFile("/conf/k8s-node.yml");
|
||||||
final String sshPubKey = "{{ k8s.ssh.pub.key }}";
|
final String sshPubKey = "{{ k8s.ssh.pub.key }}";
|
||||||
final String joinIpKey = "{{ k8s_master.join_ip }}";
|
final String joinIpKey = "{{ k8s_control_node.join_ip }}";
|
||||||
final String clusterTokenKey = "{{ k8s_master.cluster.token }}";
|
final String clusterTokenKey = "{{ k8s_control_node.cluster.token }}";
|
||||||
final String ejectIsoKey = "{{ k8s.eject.iso }}";
|
final String ejectIsoKey = "{{ k8s.eject.iso }}";
|
||||||
String pubKey = "- \"" + configurationDao.getValue("ssh.publickey") + "\"";
|
String pubKey = "- \"" + configurationDao.getValue("ssh.publickey") + "\"";
|
||||||
String sshKeyPair = kubernetesCluster.getKeyPair();
|
String sshKeyPair = kubernetesCluster.getKeyPair();
|
||||||
|
|||||||
@ -89,8 +89,8 @@ public class KubernetesClusterStartWorker extends KubernetesClusterResourceModif
|
|||||||
return kubernetesClusterVersion;
|
return kubernetesClusterVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Pair<String, Map<Long, Network.IpAddresses>> getKubernetesControlIpAddresses(final DataCenter zone, final Network network, final Account account) throws InsufficientAddressCapacityException {
|
private Pair<String, Map<Long, Network.IpAddresses>> getKubernetesControlNodeIpAddresses(final DataCenter zone, final Network network, final Account account) throws InsufficientAddressCapacityException {
|
||||||
String controlIp = null;
|
String controlNodeIp = null;
|
||||||
Map<Long, Network.IpAddresses> requestedIps = null;
|
Map<Long, Network.IpAddresses> requestedIps = null;
|
||||||
if (Network.GuestType.Shared.equals(network.getGuestType())) {
|
if (Network.GuestType.Shared.equals(network.getGuestType())) {
|
||||||
List<Long> vlanIds = new ArrayList<>();
|
List<Long> vlanIds = new ArrayList<>();
|
||||||
@ -100,16 +100,16 @@ public class KubernetesClusterStartWorker extends KubernetesClusterResourceModif
|
|||||||
}
|
}
|
||||||
PublicIp ip = ipAddressManager.getAvailablePublicIpAddressFromVlans(zone.getId(), null, account, Vlan.VlanType.DirectAttached, vlanIds,network.getId(), null, false);
|
PublicIp ip = ipAddressManager.getAvailablePublicIpAddressFromVlans(zone.getId(), null, account, Vlan.VlanType.DirectAttached, vlanIds,network.getId(), null, false);
|
||||||
if (ip != null) {
|
if (ip != null) {
|
||||||
controlIp = ip.getAddress().toString();
|
controlNodeIp = ip.getAddress().toString();
|
||||||
}
|
}
|
||||||
requestedIps = new HashMap<>();
|
requestedIps = new HashMap<>();
|
||||||
Ip ipAddress = ip.getAddress();
|
Ip ipAddress = ip.getAddress();
|
||||||
boolean isIp6 = ipAddress.isIp6();
|
boolean isIp6 = ipAddress.isIp6();
|
||||||
requestedIps.put(network.getId(), new Network.IpAddresses(ipAddress.isIp4() ? ip.getAddress().addr() : null, null));
|
requestedIps.put(network.getId(), new Network.IpAddresses(ipAddress.isIp4() ? ip.getAddress().addr() : null, null));
|
||||||
} else {
|
} else {
|
||||||
controlIp = ipAddressManager.acquireGuestIpAddress(networkDao.findById(kubernetesCluster.getNetworkId()), null);
|
controlNodeIp = ipAddressManager.acquireGuestIpAddress(networkDao.findById(kubernetesCluster.getNetworkId()), null);
|
||||||
}
|
}
|
||||||
return new Pair<>(controlIp, requestedIps);
|
return new Pair<>(controlNodeIp, requestedIps);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isKubernetesVersionSupportsHA() {
|
private boolean isKubernetesVersionSupportsHA() {
|
||||||
@ -127,20 +127,20 @@ public class KubernetesClusterStartWorker extends KubernetesClusterResourceModif
|
|||||||
return haSupported;
|
return haSupported;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getKubernetesControlConfig(final String controlIp, final String serverIp,
|
private String getKubernetesControlNodeConfig(final String controlNodeIp, final String serverIp,
|
||||||
final String hostName, final boolean haSupported,
|
final String hostName, final boolean haSupported,
|
||||||
final boolean ejectIso) throws IOException {
|
final boolean ejectIso) throws IOException {
|
||||||
String k8sControlConfig = readResourceFile("/conf/k8s-control-node.yml");
|
String k8sControlNodeConfig = readResourceFile("/conf/k8s-control-node.yml");
|
||||||
final String apiServerCert = "{{ k8s_master.apiserver.crt }}";
|
final String apiServerCert = "{{ k8s_control_node.apiserver.crt }}";
|
||||||
final String apiServerKey = "{{ k8s_master.apiserver.key }}";
|
final String apiServerKey = "{{ k8s_control_node.apiserver.key }}";
|
||||||
final String caCert = "{{ k8s_master.ca.crt }}";
|
final String caCert = "{{ k8s_control_node.ca.crt }}";
|
||||||
final String sshPubKey = "{{ k8s.ssh.pub.key }}";
|
final String sshPubKey = "{{ k8s.ssh.pub.key }}";
|
||||||
final String clusterToken = "{{ k8s_master.cluster.token }}";
|
final String clusterToken = "{{ k8s_control_node.cluster.token }}";
|
||||||
final String clusterInitArgsKey = "{{ k8s_master.cluster.initargs }}";
|
final String clusterInitArgsKey = "{{ k8s_control_node.cluster.initargs }}";
|
||||||
final String ejectIsoKey = "{{ k8s.eject.iso }}";
|
final String ejectIsoKey = "{{ k8s.eject.iso }}";
|
||||||
final List<String> addresses = new ArrayList<>();
|
final List<String> addresses = new ArrayList<>();
|
||||||
addresses.add(controlIp);
|
addresses.add(controlNodeIp);
|
||||||
if (!serverIp.equals(controlIp)) {
|
if (!serverIp.equals(controlNodeIp)) {
|
||||||
addresses.add(serverIp);
|
addresses.add(serverIp);
|
||||||
}
|
}
|
||||||
final Certificate certificate = caManager.issueCertificate(null, Arrays.asList(hostName, "kubernetes",
|
final Certificate certificate = caManager.issueCertificate(null, Arrays.asList(hostName, "kubernetes",
|
||||||
@ -149,9 +149,9 @@ public class KubernetesClusterStartWorker extends KubernetesClusterResourceModif
|
|||||||
final String tlsClientCert = CertUtils.x509CertificateToPem(certificate.getClientCertificate());
|
final String tlsClientCert = CertUtils.x509CertificateToPem(certificate.getClientCertificate());
|
||||||
final String tlsPrivateKey = CertUtils.privateKeyToPem(certificate.getPrivateKey());
|
final String tlsPrivateKey = CertUtils.privateKeyToPem(certificate.getPrivateKey());
|
||||||
final String tlsCaCert = CertUtils.x509CertificatesToPem(certificate.getCaCertificates());
|
final String tlsCaCert = CertUtils.x509CertificatesToPem(certificate.getCaCertificates());
|
||||||
k8sControlConfig = k8sControlConfig.replace(apiServerCert, tlsClientCert.replace("\n", "\n "));
|
k8sControlNodeConfig = k8sControlNodeConfig.replace(apiServerCert, tlsClientCert.replace("\n", "\n "));
|
||||||
k8sControlConfig = k8sControlConfig.replace(apiServerKey, tlsPrivateKey.replace("\n", "\n "));
|
k8sControlNodeConfig = k8sControlNodeConfig.replace(apiServerKey, tlsPrivateKey.replace("\n", "\n "));
|
||||||
k8sControlConfig = k8sControlConfig.replace(caCert, tlsCaCert.replace("\n", "\n "));
|
k8sControlNodeConfig = k8sControlNodeConfig.replace(caCert, tlsCaCert.replace("\n", "\n "));
|
||||||
String pubKey = "- \"" + configurationDao.getValue("ssh.publickey") + "\"";
|
String pubKey = "- \"" + configurationDao.getValue("ssh.publickey") + "\"";
|
||||||
String sshKeyPair = kubernetesCluster.getKeyPair();
|
String sshKeyPair = kubernetesCluster.getKeyPair();
|
||||||
if (!Strings.isNullOrEmpty(sshKeyPair)) {
|
if (!Strings.isNullOrEmpty(sshKeyPair)) {
|
||||||
@ -160,8 +160,8 @@ public class KubernetesClusterStartWorker extends KubernetesClusterResourceModif
|
|||||||
pubKey += "\n - \"" + sshkp.getPublicKey() + "\"";
|
pubKey += "\n - \"" + sshkp.getPublicKey() + "\"";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
k8sControlConfig = k8sControlConfig.replace(sshPubKey, pubKey);
|
k8sControlNodeConfig = k8sControlNodeConfig.replace(sshPubKey, pubKey);
|
||||||
k8sControlConfig = k8sControlConfig.replace(clusterToken, KubernetesClusterUtil.generateClusterToken(kubernetesCluster));
|
k8sControlNodeConfig = k8sControlNodeConfig.replace(clusterToken, KubernetesClusterUtil.generateClusterToken(kubernetesCluster));
|
||||||
String initArgs = "";
|
String initArgs = "";
|
||||||
if (haSupported) {
|
if (haSupported) {
|
||||||
initArgs = String.format("--control-plane-endpoint %s:%d --upload-certs --certificate-key %s ",
|
initArgs = String.format("--control-plane-endpoint %s:%d --upload-certs --certificate-key %s ",
|
||||||
@ -171,9 +171,9 @@ public class KubernetesClusterStartWorker extends KubernetesClusterResourceModif
|
|||||||
}
|
}
|
||||||
initArgs += String.format("--apiserver-cert-extra-sans=%s", serverIp);
|
initArgs += String.format("--apiserver-cert-extra-sans=%s", serverIp);
|
||||||
initArgs += String.format(" --kubernetes-version=%s", getKubernetesClusterVersion().getSemanticVersion());
|
initArgs += String.format(" --kubernetes-version=%s", getKubernetesClusterVersion().getSemanticVersion());
|
||||||
k8sControlConfig = k8sControlConfig.replace(clusterInitArgsKey, initArgs);
|
k8sControlNodeConfig = k8sControlNodeConfig.replace(clusterInitArgsKey, initArgs);
|
||||||
k8sControlConfig = k8sControlConfig.replace(ejectIsoKey, String.valueOf(ejectIso));
|
k8sControlNodeConfig = k8sControlNodeConfig.replace(ejectIsoKey, String.valueOf(ejectIso));
|
||||||
return k8sControlConfig;
|
return k8sControlNodeConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
private UserVm createKubernetesControlNode(final Network network, String serverIp) throws ManagementServerException,
|
private UserVm createKubernetesControlNode(final Network network, String serverIp) throws ManagementServerException,
|
||||||
@ -183,13 +183,13 @@ public class KubernetesClusterStartWorker extends KubernetesClusterResourceModif
|
|||||||
ServiceOffering serviceOffering = serviceOfferingDao.findById(kubernetesCluster.getServiceOfferingId());
|
ServiceOffering serviceOffering = serviceOfferingDao.findById(kubernetesCluster.getServiceOfferingId());
|
||||||
List<Long> networkIds = new ArrayList<Long>();
|
List<Long> networkIds = new ArrayList<Long>();
|
||||||
networkIds.add(kubernetesCluster.getNetworkId());
|
networkIds.add(kubernetesCluster.getNetworkId());
|
||||||
Pair<String, Map<Long, Network.IpAddresses>> ipAddresses = getKubernetesControlIpAddresses(zone, network, owner);
|
Pair<String, Map<Long, Network.IpAddresses>> ipAddresses = getKubernetesControlNodeIpAddresses(zone, network, owner);
|
||||||
String controlIp = ipAddresses.first();
|
String controlNodeIp = ipAddresses.first();
|
||||||
Map<Long, Network.IpAddresses> requestedIps = ipAddresses.second();
|
Map<Long, Network.IpAddresses> requestedIps = ipAddresses.second();
|
||||||
if (Network.GuestType.Shared.equals(network.getGuestType()) && Strings.isNullOrEmpty(serverIp)) {
|
if (Network.GuestType.Shared.equals(network.getGuestType()) && Strings.isNullOrEmpty(serverIp)) {
|
||||||
serverIp = controlIp;
|
serverIp = controlNodeIp;
|
||||||
}
|
}
|
||||||
Network.IpAddresses addrs = new Network.IpAddresses(controlIp, null);
|
Network.IpAddresses addrs = new Network.IpAddresses(controlNodeIp, null);
|
||||||
long rootDiskSize = kubernetesCluster.getNodeRootDiskSize();
|
long rootDiskSize = kubernetesCluster.getNodeRootDiskSize();
|
||||||
Map<String, String> customParameterMap = new HashMap<String, String>();
|
Map<String, String> customParameterMap = new HashMap<String, String>();
|
||||||
if (rootDiskSize > 0) {
|
if (rootDiskSize > 0) {
|
||||||
@ -201,13 +201,13 @@ public class KubernetesClusterStartWorker extends KubernetesClusterResourceModif
|
|||||||
}
|
}
|
||||||
hostName = getKubernetesClusterNodeAvailableName(hostName);
|
hostName = getKubernetesClusterNodeAvailableName(hostName);
|
||||||
boolean haSupported = isKubernetesVersionSupportsHA();
|
boolean haSupported = isKubernetesVersionSupportsHA();
|
||||||
String k8sControlConfig = null;
|
String k8sControlNodeConfig = null;
|
||||||
try {
|
try {
|
||||||
k8sControlConfig = getKubernetesControlConfig(controlIp, serverIp, hostName, haSupported, Hypervisor.HypervisorType.VMware.equals(clusterTemplate.getHypervisorType()));
|
k8sControlNodeConfig = getKubernetesControlNodeConfig(controlNodeIp, serverIp, hostName, haSupported, Hypervisor.HypervisorType.VMware.equals(clusterTemplate.getHypervisorType()));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
logAndThrow(Level.ERROR, "Failed to read Kubernetes control configuration file", e);
|
logAndThrow(Level.ERROR, "Failed to read Kubernetes control node configuration file", e);
|
||||||
}
|
}
|
||||||
String base64UserData = Base64.encodeBase64String(k8sControlConfig.getBytes(StringUtils.getPreferredCharset()));
|
String base64UserData = Base64.encodeBase64String(k8sControlNodeConfig.getBytes(StringUtils.getPreferredCharset()));
|
||||||
controlVm = userVmService.createAdvancedVirtualMachine(zone, serviceOffering, clusterTemplate, networkIds, owner,
|
controlVm = userVmService.createAdvancedVirtualMachine(zone, serviceOffering, clusterTemplate, networkIds, owner,
|
||||||
hostName, hostName, null, null, null,
|
hostName, hostName, null, null, null,
|
||||||
Hypervisor.HypervisorType.None, BaseCmd.HTTPMethod.POST, base64UserData, kubernetesCluster.getKeyPair(),
|
Hypervisor.HypervisorType.None, BaseCmd.HTTPMethod.POST, base64UserData, kubernetesCluster.getKeyPair(),
|
||||||
@ -218,12 +218,12 @@ public class KubernetesClusterStartWorker extends KubernetesClusterResourceModif
|
|||||||
return controlVm;
|
return controlVm;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getKubernetesAdditionalControlConfig(final String joinIp, final boolean ejectIso) throws IOException {
|
private String getKubernetesAdditionalControlNodeConfig(final String joinIp, final boolean ejectIso) throws IOException {
|
||||||
String k8sControlConfig = readResourceFile("/conf/k8s-control-node-add.yml");
|
String k8sControlNodeConfig = readResourceFile("/conf/k8s-control-node-add.yml");
|
||||||
final String joinIpKey = "{{ k8s_master.join_ip }}";
|
final String joinIpKey = "{{ k8s_control_node.join_ip }}";
|
||||||
final String clusterTokenKey = "{{ k8s_master.cluster.token }}";
|
final String clusterTokenKey = "{{ k8s_control_node.cluster.token }}";
|
||||||
final String sshPubKey = "{{ k8s.ssh.pub.key }}";
|
final String sshPubKey = "{{ k8s.ssh.pub.key }}";
|
||||||
final String clusterHACertificateKey = "{{ k8s_master.cluster.ha.certificate.key }}";
|
final String clusterHACertificateKey = "{{ k8s_control_node.cluster.ha.certificate.key }}";
|
||||||
final String ejectIsoKey = "{{ k8s.eject.iso }}";
|
final String ejectIsoKey = "{{ k8s.eject.iso }}";
|
||||||
String pubKey = "- \"" + configurationDao.getValue("ssh.publickey") + "\"";
|
String pubKey = "- \"" + configurationDao.getValue("ssh.publickey") + "\"";
|
||||||
String sshKeyPair = kubernetesCluster.getKeyPair();
|
String sshKeyPair = kubernetesCluster.getKeyPair();
|
||||||
@ -233,12 +233,12 @@ public class KubernetesClusterStartWorker extends KubernetesClusterResourceModif
|
|||||||
pubKey += "\n - \"" + sshkp.getPublicKey() + "\"";
|
pubKey += "\n - \"" + sshkp.getPublicKey() + "\"";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
k8sControlConfig = k8sControlConfig.replace(sshPubKey, pubKey);
|
k8sControlNodeConfig = k8sControlNodeConfig.replace(sshPubKey, pubKey);
|
||||||
k8sControlConfig = k8sControlConfig.replace(joinIpKey, joinIp);
|
k8sControlNodeConfig = k8sControlNodeConfig.replace(joinIpKey, joinIp);
|
||||||
k8sControlConfig = k8sControlConfig.replace(clusterTokenKey, KubernetesClusterUtil.generateClusterToken(kubernetesCluster));
|
k8sControlNodeConfig = k8sControlNodeConfig.replace(clusterTokenKey, KubernetesClusterUtil.generateClusterToken(kubernetesCluster));
|
||||||
k8sControlConfig = k8sControlConfig.replace(clusterHACertificateKey, KubernetesClusterUtil.generateClusterHACertificateKey(kubernetesCluster));
|
k8sControlNodeConfig = k8sControlNodeConfig.replace(clusterHACertificateKey, KubernetesClusterUtil.generateClusterHACertificateKey(kubernetesCluster));
|
||||||
k8sControlConfig = k8sControlConfig.replace(ejectIsoKey, String.valueOf(ejectIso));
|
k8sControlNodeConfig = k8sControlNodeConfig.replace(ejectIsoKey, String.valueOf(ejectIso));
|
||||||
return k8sControlConfig;
|
return k8sControlNodeConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
private UserVm createKubernetesAdditionalControlNode(final String joinIp, final int additionalControlNodeInstance) throws ManagementServerException,
|
private UserVm createKubernetesAdditionalControlNode(final String joinIp, final int additionalControlNodeInstance) throws ManagementServerException,
|
||||||
@ -255,13 +255,13 @@ public class KubernetesClusterStartWorker extends KubernetesClusterResourceModif
|
|||||||
customParameterMap.put("rootdisksize", String.valueOf(rootDiskSize));
|
customParameterMap.put("rootdisksize", String.valueOf(rootDiskSize));
|
||||||
}
|
}
|
||||||
String hostName = getKubernetesClusterNodeAvailableName(String.format("%s-control-%d", kubernetesClusterNodeNamePrefix, additionalControlNodeInstance + 1));
|
String hostName = getKubernetesClusterNodeAvailableName(String.format("%s-control-%d", kubernetesClusterNodeNamePrefix, additionalControlNodeInstance + 1));
|
||||||
String k8sControlConfig = null;
|
String k8sControlNodeConfig = null;
|
||||||
try {
|
try {
|
||||||
k8sControlConfig = getKubernetesAdditionalControlConfig(joinIp, Hypervisor.HypervisorType.VMware.equals(clusterTemplate.getHypervisorType()));
|
k8sControlNodeConfig = getKubernetesAdditionalControlNodeConfig(joinIp, Hypervisor.HypervisorType.VMware.equals(clusterTemplate.getHypervisorType()));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
logAndThrow(Level.ERROR, "Failed to read Kubernetes control configuration file", e);
|
logAndThrow(Level.ERROR, "Failed to read Kubernetes control configuration file", e);
|
||||||
}
|
}
|
||||||
String base64UserData = Base64.encodeBase64String(k8sControlConfig.getBytes(StringUtils.getPreferredCharset()));
|
String base64UserData = Base64.encodeBase64String(k8sControlNodeConfig.getBytes(StringUtils.getPreferredCharset()));
|
||||||
additionalControlVm = userVmService.createAdvancedVirtualMachine(zone, serviceOffering, clusterTemplate, networkIds, owner,
|
additionalControlVm = userVmService.createAdvancedVirtualMachine(zone, serviceOffering, clusterTemplate, networkIds, owner,
|
||||||
hostName, hostName, null, null, null,
|
hostName, hostName, null, null, null,
|
||||||
Hypervisor.HypervisorType.None, BaseCmd.HTTPMethod.POST, base64UserData, kubernetesCluster.getKeyPair(),
|
Hypervisor.HypervisorType.None, BaseCmd.HTTPMethod.POST, base64UserData, kubernetesCluster.getKeyPair(),
|
||||||
|
|||||||
@ -101,9 +101,9 @@ public class KubernetesClusterResponse extends BaseResponse implements Controlle
|
|||||||
@Param(description = "keypair details")
|
@Param(description = "keypair details")
|
||||||
private String keypair;
|
private String keypair;
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated(since = "4.16")
|
||||||
@SerializedName(ApiConstants.MASTER_NODES)
|
@SerializedName(ApiConstants.MASTER_NODES)
|
||||||
@Param(description = "the master nodes count for the Kubernetes cluster")
|
@Param(description = "the master nodes count for the Kubernetes cluster. This parameter is deprecated, please use 'controlnodes' parameter.")
|
||||||
private Long masterNodes;
|
private Long masterNodes;
|
||||||
|
|
||||||
@SerializedName(ApiConstants.CONTROL_NODES)
|
@SerializedName(ApiConstants.CONTROL_NODES)
|
||||||
|
|||||||
@ -196,7 +196,7 @@ write-files:
|
|||||||
if [[ "$PATH" != *:/opt/bin && "$PATH" != *:/opt/bin:* ]]; then
|
if [[ "$PATH" != *:/opt/bin && "$PATH" != *:/opt/bin:* ]]; then
|
||||||
export PATH=$PATH:/opt/bin
|
export PATH=$PATH:/opt/bin
|
||||||
fi
|
fi
|
||||||
kubeadm join {{ k8s_master.join_ip }}:6443 --token {{ k8s_master.cluster.token }} --control-plane --certificate-key {{ k8s_master.cluster.ha.certificate.key }} --discovery-token-unsafe-skip-ca-verification
|
kubeadm join {{ k8s_control_node.join_ip }}:6443 --token {{ k8s_control_node.cluster.token }} --control-plane --certificate-key {{ k8s_control_node.cluster.ha.certificate.key }} --discovery-token-unsafe-skip-ca-verification
|
||||||
|
|
||||||
sudo touch /home/core/success
|
sudo touch /home/core/success
|
||||||
echo "true" > /home/core/success
|
echo "true" > /home/core/success
|
||||||
@ -229,7 +229,7 @@ coreos:
|
|||||||
Type=simple
|
Type=simple
|
||||||
StartLimitInterval=0
|
StartLimitInterval=0
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
ExecStartPre=/usr/bin/curl -k https://{{ k8s_master.join_ip }}:6443/version
|
ExecStartPre=/usr/bin/curl -k https://{{ k8s_control_node.join_ip }}:6443/version
|
||||||
ExecStart=/opt/bin/deploy-kube-system
|
ExecStart=/opt/bin/deploy-kube-system
|
||||||
|
|
||||||
update:
|
update:
|
||||||
|
|||||||
@ -29,17 +29,17 @@ write-files:
|
|||||||
- path: /etc/kubernetes/pki/cloudstack/ca.crt
|
- path: /etc/kubernetes/pki/cloudstack/ca.crt
|
||||||
permissions: '0644'
|
permissions: '0644'
|
||||||
content: |
|
content: |
|
||||||
{{ k8s_master.ca.crt }}
|
{{ k8s_control_node.ca.crt }}
|
||||||
|
|
||||||
- path: /etc/kubernetes/pki/cloudstack/apiserver.crt
|
- path: /etc/kubernetes/pki/cloudstack/apiserver.crt
|
||||||
permissions: '0644'
|
permissions: '0644'
|
||||||
content: |
|
content: |
|
||||||
{{ k8s_master.apiserver.crt }}
|
{{ k8s_control_node.apiserver.crt }}
|
||||||
|
|
||||||
- path: /etc/kubernetes/pki/cloudstack/apiserver.key
|
- path: /etc/kubernetes/pki/cloudstack/apiserver.key
|
||||||
permissions: '0600'
|
permissions: '0600'
|
||||||
content: |
|
content: |
|
||||||
{{ k8s_master.apiserver.key }}
|
{{ k8s_control_node.apiserver.key }}
|
||||||
|
|
||||||
- path: /opt/bin/setup-kube-system
|
- path: /opt/bin/setup-kube-system
|
||||||
permissions: 0700
|
permissions: 0700
|
||||||
@ -204,7 +204,7 @@ write-files:
|
|||||||
fi
|
fi
|
||||||
retval=0
|
retval=0
|
||||||
set +e
|
set +e
|
||||||
kubeadm init --token {{ k8s_master.cluster.token }} --token-ttl 0 {{ k8s_master.cluster.initargs }}
|
kubeadm init --token {{ k8s_control_node.cluster.token }} --token-ttl 0 {{ k8s_control_node.cluster.initargs }}
|
||||||
retval=$?
|
retval=$?
|
||||||
set -e
|
set -e
|
||||||
if [ $retval -eq 0 ]; then
|
if [ $retval -eq 0 ]; then
|
||||||
|
|||||||
@ -196,7 +196,7 @@ write-files:
|
|||||||
if [[ "$PATH" != *:/opt/bin && "$PATH" != *:/opt/bin:* ]]; then
|
if [[ "$PATH" != *:/opt/bin && "$PATH" != *:/opt/bin:* ]]; then
|
||||||
export PATH=$PATH:/opt/bin
|
export PATH=$PATH:/opt/bin
|
||||||
fi
|
fi
|
||||||
kubeadm join {{ k8s_master.join_ip }}:6443 --token {{ k8s_master.cluster.token }} --discovery-token-unsafe-skip-ca-verification
|
kubeadm join {{ k8s_control_node.join_ip }}:6443 --token {{ k8s_control_node.cluster.token }} --discovery-token-unsafe-skip-ca-verification
|
||||||
|
|
||||||
sudo touch /home/core/success
|
sudo touch /home/core/success
|
||||||
echo "true" > /home/core/success
|
echo "true" > /home/core/success
|
||||||
@ -229,7 +229,7 @@ coreos:
|
|||||||
Type=simple
|
Type=simple
|
||||||
StartLimitInterval=0
|
StartLimitInterval=0
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
ExecStartPre=/usr/bin/curl -k https://{{ k8s_master.join_ip }}:6443/version
|
ExecStartPre=/usr/bin/curl -k https://{{ k8s_control_node.join_ip }}:6443/version
|
||||||
ExecStart=/opt/bin/deploy-kube-system
|
ExecStart=/opt/bin/deploy-kube-system
|
||||||
|
|
||||||
update:
|
update:
|
||||||
|
|||||||
@ -430,7 +430,7 @@ export default {
|
|||||||
fields.push('zonename')
|
fields.push('zonename')
|
||||||
return fields
|
return fields
|
||||||
},
|
},
|
||||||
details: ['name', 'description', 'zonename', 'kubernetesversionname', 'size', 'masternodes', 'cpunumber', 'memory', 'keypair', 'associatednetworkname', 'account', 'domain', 'zonename'],
|
details: ['name', 'description', 'zonename', 'kubernetesversionname', 'size', 'controlnodes', 'cpunumber', 'memory', 'keypair', 'associatednetworkname', 'account', 'domain', 'zonename'],
|
||||||
tabs: [{
|
tabs: [{
|
||||||
name: 'k8s',
|
name: 'k8s',
|
||||||
component: () => import('@/views/compute/KubernetesServiceTab.vue')
|
component: () => import('@/views/compute/KubernetesServiceTab.vue')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user