Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add container insights and rbac to azure provisioning settings #4205

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions dashboard/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"@babel/preset-typescript": "^7.15.0",
"@ianvs/prettier-plugin-sort-imports": "^4.1.1",
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.3",
"@porter-dev/api-contracts": "^0.2.84",
"@porter-dev/api-contracts": "^0.2.93",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
Expand Down
33 changes: 33 additions & 0 deletions dashboard/src/components/AzureProvisionerSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
} from "./azureUtils";
import InputRow from "./form-components/InputRow";
import Button from "./porter/Button";
import Checkbox from "./porter/Checkbox";
import Error from "./porter/Error";
import Icon from "./porter/Icon";
import Link from "./porter/Link";
Expand Down Expand Up @@ -78,6 +79,9 @@ const AzureProvisionerSettings: React.FC<Props> = (props) => {
const [clusterVersion, setClusterVersion] = useState("v1.27.3");
const [isReadOnly, setIsReadOnly] = useState(false);
const [skuTier, setSkuTier] = useState(AksSkuTier.FREE);
const [rbacEnabled, setRbacEnabled] = useState(false);
const [containerInsightsEnabled, setContainerInsightsEnabled] =
useState(false);
const [errorMessage, setErrorMessage] = useState<string>("");
const [errorDetails, setErrorDetails] = useState<string>("");
const [isClicked, setIsClicked] = useState(false);
Expand Down Expand Up @@ -225,6 +229,8 @@ const AzureProvisionerSettings: React.FC<Props> = (props) => {
}),
],
skuTier,
enableRbac: rbacEnabled,
enableContainerInsights: containerInsightsEnabled,
}),
},
}),
Expand Down Expand Up @@ -340,6 +346,8 @@ const AzureProvisionerSettings: React.FC<Props> = (props) => {
if (aksValues.skuTier !== AksSkuTier.UNSPECIFIED) {
setSkuTier(aksValues.skuTier);
}
setRbacEnabled(aksValues.enableRbac);
setContainerInsightsEnabled(aksValues.enableContainerInsights);
}
}, [props.selectedClusterVersion]);

Expand Down Expand Up @@ -437,6 +445,31 @@ const AzureProvisionerSettings: React.FC<Props> = (props) => {
label="VPC CIDR range"
placeholder="ex: 10.78.0.0/16"
/>
<Checkbox
checked={containerInsightsEnabled}
disabled={isReadOnly}
toggleChecked={() => {
setContainerInsightsEnabled(!containerInsightsEnabled);
}}
disabledTooltip={
"Wait for provisioning to complete before editing this field."
}
>
<Text color="helper">Enable Azure Container Insights</Text>
</Checkbox>
<Spacer y={0.25} />
<Checkbox
checked={rbacEnabled}
disabled={isReadOnly}
toggleChecked={() => {
setRbacEnabled(!rbacEnabled);
}}
disabledTooltip={
"Wait for provisioning to complete before editing this field."
}
>
<Text color="helper">Enable Azure RBAC</Text>
</Checkbox>
</>
)}
</>
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ require (
github.com/matryer/is v1.4.0
github.com/nats-io/nats.go v1.24.0
github.com/open-policy-agent/opa v0.44.0
github.com/porter-dev/api-contracts v0.2.91
github.com/porter-dev/api-contracts v0.2.93
github.com/riandyrn/otelchi v0.5.1
github.com/santhosh-tekuri/jsonschema/v5 v5.0.1
github.com/stefanmcshane/helm v0.0.0-20221213002717-88a4a2c6e77d
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1527,6 +1527,8 @@ github.com/porter-dev/api-contracts v0.2.90 h1:0ceIXz0xWNQpqVqhUMt3/RDeEawccfXx3
github.com/porter-dev/api-contracts v0.2.90/go.mod h1:fX6JmP5QuzxDLvqP3evFOTXjI4dHxsG0+VKNTjImZU8=
github.com/porter-dev/api-contracts v0.2.91 h1:jiFWQ+WISAtfjXalOmWJdSr1ZOm7/ov+3ozrCeYA9Ws=
github.com/porter-dev/api-contracts v0.2.91/go.mod h1:fX6JmP5QuzxDLvqP3evFOTXjI4dHxsG0+VKNTjImZU8=
github.com/porter-dev/api-contracts v0.2.93 h1:ui3x0CwDGtVCnjZaI6F4O+nnMLKMv1r1v4H6o5vM5iY=
github.com/porter-dev/api-contracts v0.2.93/go.mod h1:fX6JmP5QuzxDLvqP3evFOTXjI4dHxsG0+VKNTjImZU8=
github.com/porter-dev/switchboard v0.0.3 h1:dBuYkiVLa5Ce7059d6qTe9a1C2XEORFEanhbtV92R+M=
github.com/porter-dev/switchboard v0.0.3/go.mod h1:xSPzqSFMQ6OSbp42fhCi4AbGbQbsm6nRvOkrblFeXU4=
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
Expand Down
Loading