feat(app/endpoint): add deployment instructions for windows (#4442)

* feat(app/endpoint): add deployment instructions for windows

* feat(app/endpoint): hide instructions for kubernetes via load balancer and kubernetes via node port when windows is selected

* feat(endpoint): minor UI update

Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com>
pull/4587/head
Alice Groux 2020-12-13 03:50:42 +01:00 committed by GitHub
parent b360936454
commit 341378e783
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 4 deletions

View File

@ -19,6 +19,7 @@ angular
) {
$scope.state = {
EnvironmentType: 'agent',
PlatformType: 'linux',
actionInProgress: false,
deploymentTab: 0,
allowCreateTag: Authentication.isAdmin(),
@ -56,8 +57,12 @@ angular
};
$scope.copyAgentCommand = function () {
if ($scope.state.deploymentTab === 2) {
if ($scope.state.deploymentTab === 2 && $scope.state.PlatformType === 'linux') {
clipboard.copyText('curl -L https://downloads.portainer.io/agent-stack.yml -o agent-stack.yml && docker stack deploy --compose-file=agent-stack.yml portainer-agent');
} else if ($scope.state.deploymentTab === 2 && $scope.state.PlatformType === 'windows') {
clipboard.copyText(
'curl -L https://downloads.portainer.io/agent-stack-windows.yml -o agent-stack.yml && docker stack deploy --compose-file=agent-stack-windows.yml portainer-agent'
);
} else if ($scope.state.deploymentTab === 1) {
clipboard.copyText('curl -L https://downloads.portainer.io/portainer-agent-k8s-nodeport.yaml -o portainer-agent-k8s.yaml; kubectl apply -f portainer-agent-k8s.yaml');
} else {

View File

@ -74,24 +74,33 @@
<div class="form-group">
<span class="col-sm-12 text-muted small">
Ensure that you have deployed the Portainer agent in your cluster first. Refer to the platform related command below to deploy it.
<div class="input-group input-group-sm" style="margin-top: 10px; margin-bottom: 10px;">
<div class="btn-group btn-group-sm">
<label class="btn btn-primary" ng-model="state.PlatformType" uib-btn-radio="'linux'"><i class="fab fa-linux" style="margin-right: 2px;"></i> Linux</label>
<label class="btn btn-primary" ng-model="state.PlatformType" uib-btn-radio="'windows'"><i class="fab fa-windows" style="margin-right: 2px;"></i> Windows</label>
</div>
</div>
<div style="margin-top: 10px;">
<uib-tabset active="state.deploymentTab">
<uib-tab index="0" heading="Kubernetes via load balancer">
<uib-tab index="0" ng-if="state.PlatformType === 'linux'" heading="Kubernetes via load balancer">
<code style="display: block; white-space: pre-wrap; padding: 16px 90px;"
>curl -L https://downloads.portainer.io/portainer-agent-k8s-lb.yaml -o portainer-agent-k8s.yaml; kubectl apply -f portainer-agent-k8s.yaml</code
>
</uib-tab>
<uib-tab index="1" heading="Kubernetes via node port">
<uib-tab index="1" ng-if="state.PlatformType === 'linux'" heading="Kubernetes via node port">
<code style="display: block; white-space: pre-wrap; padding: 16px 90px;"
>curl -L https://downloads.portainer.io/portainer-agent-k8s-nodeport.yaml -o portainer-agent-k8s.yaml; kubectl apply -f portainer-agent-k8s.yaml</code
>
</uib-tab>
<uib-tab index="2" heading="Docker Swarm">
<code style="display: block; white-space: pre-wrap; padding: 16px 90px;"
<code ng-if="state.PlatformType === 'linux'" style="display: block; white-space: pre-wrap; padding: 16px 90px;"
>curl -L https://downloads.portainer.io/agent-stack.yml -o agent-stack.yml && docker stack deploy --compose-file=agent-stack.yml portainer-agent</code
>
<code ng-if="state.PlatformType === 'windows'" style="display: block; white-space: pre-wrap; padding: 16px 90px;"
>curl -L https://downloads.portainer.io/agent-stack-windows.yml -o agent-stack.yml && docker stack deploy --compose-file=agent-stack-windows.yml portainer-agent</code
>
</uib-tab>
</uib-tabset>
<div style="margin-top: 10px;">